What Does Storing Frames Do? (Newest GameSalad Update)

First off, lemme just say I am super glad this update happened. I've wanted custom fonts to use in Gamesalad since I first started using it. However, upon using GameSalad since the update, I came across something in the Animate behavior. "Store Current Frame In: " followed by a text box where we can put in an equation or attribute or whatever. What does it do? Is it similar to how saving attributes works? I'd probably know if I were more active on here, which I should be.

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

Best Answer

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,922
    Accepted Answer

    @AlchimiaStudios said:

    @Socks said:

    @Lost_Oasis_Games said:
    Yep it's just a number 1,2,3,4,5 depending on the frame. So if you had five frames of animation it will count and loop 1,2,3,4,5

    I guess this is useful in that it normalises frame numbers, so an animated sequenced made up from X032, X033, X034, X035, X036 . . . becomes 1,2,3,4,5.

    @Lost_Oasis_Games said:

    @Socks said:

    @Lost_Oasis_Games said:
    Yep it's just a number 1,2,3,4,5 depending on the frame. So if you had five frames of animation it will count and loop 1,2,3,4,5

    I guess this is useful in that it normalises frame numbers, so an animated sequenced made up from X032, X033, X034, X035, X036 . . . becomes 1,2,3,4,5.

    Yep. I used the frame numbers as a multiplier for setting the power of my pinball plunger. As the plunger goes down the number goes up and I set the velocity in the ball to game.plunger X 15 no other code needed other than overlap and collide.

    Hmm that is nice! I was also wondering what benefit it had over self.image

    Yep that is how to slim down code.

Answers

  • KevinCrossKevinCross London, UKMember Posts: 1,894

    Not looked at the new update yet but that description of the behavior you supplied sounds like you can store the animation frame into an attribute. Not sure why that would be useful but maybe people need the way to jump back to a certain frame of the animation at a later date. Or maybe it's so you can do rules later on i.e. if game.heroAnimationFrame = 12 do something.

  • BigDaveBigDave Member Posts: 2,239

    I use it in my new wizard game.

    You can basically trigger your rules based on a frame within an animation.
    So on frame 7 spawn projectile.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited April 2016

    It is a great feature and there are tons of clever things you can do with it. I used it in a pinball game to chart power based on how far the plunger goes down as the animation stops when you release the touch and so I can know how far down it went based on the frame number.

    I'll do a video on it.

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2016

    @BigDave said:
    I use it in my new wizard game.

    You can basically trigger your rules based on a frame within an animation.
    So on frame 7 spawn projectile.

    @Lost_Oasis_Games said:
    It is a great feature and there are tons of clever things you can do with it. I used it in a pinball game to chart power based on how far the plunger goes down as the animation stops when you release the touch and so I can know how far down it went based on the frame number.

    I'll do a video on it.

    You've always been able to do this, we can (in all pre-1.25 releases) monitor the current frame, and with lots of flexibility, for example you can say: when self.image contains (frame number) or when self.image begins with . . or ends with . . . or does not contain . . . or does not end with . . (etc).

    Does the new function differ in any way, or is it essentially the same functionality but moved to a more useful place ?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited April 2016

    @Socks said:

    @BigDave said:
    I use it in my new wizard game.

    You can basically trigger your rules based on a frame within an animation.
    So on frame 7 spawn projectile.

    @Lost_Oasis_Games said:
    It is a great feature and there are tons of clever things you can do with it. I used it in a pinball game to chart power based on how far the plunger goes down as the animation stops when you release the touch and so I can know how far down it went based on the frame number.

    I'll do a video on it.

    You've always been able to do this, we can (in all pre-1.25 releases) monitor the current frame, and with lots of flexibility, for example you can say: when self.image contains (frame number) or when self.image begins with . . or ends with . . . or does not contain . . . or does not end with . . (etc).

    Does the new function differ in any way, or is it essentially the same functionality but moved to a more useful place ?

    It is in the behavior itself and allows you to just link it to a variable. It's easier for us little people... ;)

  • ADSentertainmentADSentertainment Member Posts: 397

    @Lost_Oasis_Games So for instance, let's say that I stored the fifth frame of a ten frame animation in a boolean variable. If the animation hits the fifth frame, would the boolean variable be set to true? Or would it be vice versa where if you set the boolean variable to true that it would go to the fifth frame?

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

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @ADSentertainment said:
    @Lost_Oasis_Games So for instance, let's say that I stored the fifth frame of a ten frame animation in a boolean variable. If the animation hits the fifth frame, would the boolean variable be set to true? Or would it be vice versa where if you set the boolean variable to true that it would go to the fifth frame?

    Not even sure what this means storing the fifth frame in a Boolean. Code is code variables are variable. So the frame rate is an integer variable you can do with it what you can do with any integr variable. This stuff isn't different because it's embeded in a behavior. Gamesalad is conditional logic using variables as conditions period. No other magic going on.

  • ADSentertainmentADSentertainment Member Posts: 397

    @Lost_Oasis_Games OH. Okay I think I get it now, it was a lot more simple than I thought :D I guess I was just really confused. Thanks

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

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @ADSentertainment said:
    @Lost_Oasis_Games OH. Okay I think I get it now, it was a lot more simple than I thought :D I guess I was just really confused. Thanks

    Yep it's just a number 1,2,3,4,5 depending on the frame. So if you had five frames of animation it will count and loop 1,2,3,4,5

  • ADSentertainmentADSentertainment Member Posts: 397

    @Lost_Oasis_Games said:

    @ADSentertainment said:
    @Lost_Oasis_Games OH. Okay I think I get it now, it was a lot more simple than I thought :D I guess I was just really confused. Thanks

    Yep it's just a number 1,2,3,4,5 depending on the frame. So if you had five frames of animation it will count and loop 1,2,3,4,5

    Yeah, I just went over and tested it out to be sure

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

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

    @Lost_Oasis_Games said:
    Yep it's just a number 1,2,3,4,5 depending on the frame. So if you had five frames of animation it will count and loop 1,2,3,4,5

    I guess this is useful in that it normalises frame numbers, so an animated sequenced made up from X032, X033, X034, X035, X036 . . . becomes 1,2,3,4,5.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @Socks said:

    @Lost_Oasis_Games said:
    Yep it's just a number 1,2,3,4,5 depending on the frame. So if you had five frames of animation it will count and loop 1,2,3,4,5

    I guess this is useful in that it normalises frame numbers, so an animated sequenced made up from X032, X033, X034, X035, X036 . . . becomes 1,2,3,4,5.

    Yep. I used the frame numbers as a multiplier for setting the power of my pinball plunger. As the plunger goes down the number goes up and I set the velocity in the ball to game.plunger X 15 no other code needed other than overlap and collide.

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    @Socks said:

    @Lost_Oasis_Games said:
    Yep it's just a number 1,2,3,4,5 depending on the frame. So if you had five frames of animation it will count and loop 1,2,3,4,5

    I guess this is useful in that it normalises frame numbers, so an animated sequenced made up from X032, X033, X034, X035, X036 . . . becomes 1,2,3,4,5.

    @Lost_Oasis_Games said:

    @Socks said:

    @Lost_Oasis_Games said:
    Yep it's just a number 1,2,3,4,5 depending on the frame. So if you had five frames of animation it will count and loop 1,2,3,4,5

    I guess this is useful in that it normalises frame numbers, so an animated sequenced made up from X032, X033, X034, X035, X036 . . . becomes 1,2,3,4,5.

    Yep. I used the frame numbers as a multiplier for setting the power of my pinball plunger. As the plunger goes down the number goes up and I set the velocity in the ball to game.plunger X 15 no other code needed other than overlap and collide.

    Hmm that is nice! I was also wondering what benefit it had over self.image

    Follow us: Twitter - Website

Sign In or Register to comment.