get out of a loop

brainfreezebrainfreeze Member Posts: 2
edited November -1 in Working with GS (Mac)
Hi Everyone,

First off, I'm new to the GS community. I've been reading the forums for the past month or so, so thanks everyone for creating such an awesome community. Looks like when someone has a question, it really does get answered.

I'm creating a children's rhymes app that will contain a bunch of animations created by some amazing illustrators. So I'm going to have a ton of 24fps animations. So here's my question.

I'm running into an issue where I have 1 animation png sequence, "Sequence1". I have a rule set up that when self.image is "X", then run Timer/Animate New png sequence with a loop, "Sequence2". This works perfect.

I'm running into a problem that when I create another png sequence "Sequence3" the same way, once that one finishes (not a loop), it goes back to "Sequence2", where I want it to just stop on the last frame.

I've tried a bunch of things like "restore actor image", and even "Change Image", but it always goes back into the Sequence 2 loop. Any ideas? Sorry if this isn't the most clear explanation.

Any help is appreciated, and I'm sure I'll have a bunch more questions. And I'm excited to start participating in the forums to help others as I go. You guys have been a great help thus far. Thanks.

Comments

  • synthesissynthesis Member Posts: 1,693
    Use an animation controller.

    Create an attribute integer called "animSeqStep" and set it to the default step number
    self.animSeqStep = 1

    Then have a set of rules inside a trigger wrapper...

    Rule (WRAPPER): when game.playMyMovie = True (otherwise self.animSeqStep=1 ... this otherwise assignment will reset the movie when false and is optional)

    Rule:
    When self.animSeqStep = 1
    ....[play animation 1]
    Timer: After X seconds self.animSeqStep=2

    Rule:
    When self.animSeqStep = 2
    ....[play animation 2]
    Timer: After X seconds self.animSeqStep=3

    Rule:
    When self.animSeqStep = 3
    ....[play animation 3]
    Timer: After X seconds self.animSeqStep=4

    etc. until the animation is over.
  • brainfreezebrainfreeze Member Posts: 2
    Thanks synthesis for responding,

    Can you clarify what you mean by "wrapper"?

    Do i create the "animSeqStep" attribute inside my actor that is containing all the animation sequences, or do i use a separate actor that will talk to that actor?

    Thanks for you're help. I think i'm almost there.
Sign In or Register to comment.