Animated objects becoming quite squares upon ending animation

I noticed that when I transferred my game to my phone for testing purposes, explosions from destroying enemies (it's a shoot 'em up) would become white squares upon the ending of the animation and being destroyed with the "destroy" action. I thought it may have been a transferring glitch that didn't happen often and I transferred it again (it was a while later but I still did it), only to find the same result. Has anyone else had a similar issue, and does anyone know how to fix it? Thank you in advance.

Having trouble with your game? Sounds like a personal problem.

Comments

  • ADSentertainmentADSentertainment Member Posts: 397

    Someone, anyone, please? I'm literally crying right now. :'(

    Having trouble with your game? Sounds like a personal problem.

  • LovejoyLovejoy Member Posts: 2,078

    @ADSentertainment said:
    Someone, anyone, please? I'm literally crying right now. :'(

    Try unchecking restore actor image when done

    Fortuna Infortuna Forti Una

  • ADSentertainmentADSentertainment Member Posts: 397

    @Lovejoy It is unchecked actually .-.

    Having trouble with your game? Sounds like a personal problem.

  • LovejoyLovejoy Member Posts: 2,078

    @ADSentertainment said:
    Lovejoy It is unchecked actually .-.

    Delete and re add the images from your project.

    Fortuna Infortuna Forti Una

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I don't use the Animate behavior enough to know if this would work but I would try something like:

    Timer every 0 seconds
         Log Debugging Statement self.Image

    And watch the values to see if there's anything unexpected showing up.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @ADSentertainment said:
    Someone, anyone, please? I'm literally crying right now. :'(

    You've not really supplied any useful information so all you'll probably get is a bunch of random guesses, all we know about your project is that you are playing it on some phone (could be a 4 year old iPhone, could be the latest HTC) and it's a shoot 'em up - that's pretty much the entirety of the background information supplied !

    It's hard enough to trying to diagnose an issue when people don't show you the code that is causing the issue - and I'd say a question like yours is even more vague.

    If I genuinely wanted and needed to get an issue resolved (to the point that I was in tears :smile:) I would probably offer up as many details as I thought might be useful, the type of phone I'm using, the OS on the phone, the version of GameSalad I'm using, the rules and behaviours that control the destruction and animation of the actor, the kind of image files I'm using (png, Jpeg . . etc), whether they have transparency or not (32bit or 24 bit), how I am animating them, at what frame rate . . . . etc etc etc . . . . and I would also do all the obvious tests and add that information into my post - for example 'I made a new project, with only this animation in, nothing else, and the problem still occurs/doesn't occur', 'I swapped the animation frames for some stand-in replacements and the problem still occurs/doesn't occur'' 'If I switch off destroy, the last frame still goes white/doesn't go white', 'If I end the animation early, just use 6 frames instead of 18, the last frame is still white / works just fine' . . . etc etc.

    But at the moment the question is 'I get a white square at the end of an animation when I test my shoot 'em up on a phone, why is that?' - so like I say you will probably just get a bunch of random guesses.

  • ADSentertainmentADSentertainment Member Posts: 397

    @Socks That probably would help. Guess I just didn't think it would be too important at the time. I'm on a 6+ with iOS 8.3. The way I have it get destroyed was that originally after 1 second, the object would be destroyed, which was slightly longer than the actual animation. I didn't have "loop" or "restore actor image when done" checked off for the explosions. They do indeed have transparency, they go at 20 fps. I tried re-publishing it, but having it get destroyed after 0.9 seconds, which would be right at the end of the animation. (It had 18 frames with 20 fps as stated earlier) but that didn't work either. I've checked the debugging like @tatiang mentioned, and that hasn't worked either. I don't have anything else yet, but I'll see if I can answer the other questions when I get to them, which will require me to publish it with those slight modifications of code. The white square looks like the white box you typically start with if your actor has no image.

    Having trouble with your game? Sounds like a personal problem.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Are you using an Animate behavior? Are you doing anything with tables or Change/Constrain Attribute behaviors with regard to the actor's self.Image attribute?

    When you say the debugging "hasn't worked" do you mean that you couldn't figure out how to do it or that you did see the debugging statements but that there was nothing out of the ordinary (such as a blank line or the name of an image that doesn't exist as a file in your project)?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    @ADSentertainment said:
    Socks That probably would help. Guess I just didn't think it would be too important at the time. I'm on a 6+ with iOS 8.3.

    Ok, so we can rule out an underpowered iPhone3 struggling with the project.

    @ADSentertainment said:
    The way I have it get destroyed was that originally after 1 second, the object would be destroyed, which was slightly longer than the actual animation.

    If you don't want to use a (resource hungry) timer you can duplicate the last frame, call it something like ''end frame" and import it into GameSalad with all the other frames, then place it as the last frame in your Animate behaviour.

    Then your rule can say, when image name contains 'end frame' destroy actor.

    @ADSentertainment said:
    I'll see if I can answer the other questions when I get to them . .

    They are just a random list of questions I thought up, knowing how your project works means you are probably better able to decide what kind of information might be useful. But I would try separating the explosion animation out into a new project to see if it still displays the issue.

  • ADSentertainmentADSentertainment Member Posts: 397

    @Socks okay, so I tried doing what you told me to replace the timer, that didn't work. Instead, it actually made it worse because it never actually destroyed the object, it just stayed white. So maybe there's a corrupted image or something. I've also tried replacing all of the images like @lovejoy said with no luck. I can't use the debugging log either because the glitch only happens when I'm physically playing it on my phone (@tatiang that's what I meant). If I make a new project, would I have to make a new provisioning profile or whatever and go through that whole process to test it on my phone? The glitch NEVER happens when I'm testing it via the creator.

    Having trouble with your game? Sounds like a personal problem.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @ADSentertainment said:
    Socks okay, so I tried doing what you told me to replace the timer, that didn't work.

    My suggestion was not an attempt to solve your issue, I haven't got a clue what it is in your project that is causing the issue - the idea behind using a 'final frame' was simply an suggestion as to how to get rid of (resource hungry) timers.

    @ADSentertainment said:
    it actually made it worse because it never actually destroyed the object, it just stayed white

    Could you upload a screenshot of the offending code ?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You could still Display Text self.Image on the device and see if anything is out of the ordinary. It's just a little trickier because you have to watch more carefully and don't have a written record of the values.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ADSentertainmentADSentertainment Member Posts: 397

    @tatiang I can try that
    @Socks here are examples of a couple explosions that have that issue:


    In fact, I believe those are the only explosions that actually HAVE that issue. Because I have two other explosions that I tested out and they both seem to work fine, here are those:

    Having trouble with your game? Sounds like a personal problem.

  • ADSentertainmentADSentertainment Member Posts: 397

    @Socks
    @Lovejoy
    @tatiang

    Okay, I think the issue lies simply with the image itself. All other explosion animations I use are fine except those two. Any actor that uses it has that problem, I'm gonna replace the images and see what happens then.

    Having trouble with your game? Sounds like a personal problem.

Sign In or Register to comment.