Community

SCI Programming => SCI Syntax Help => Topic started by: Doan Sephim on July 17, 2021, 06:37:18 PM

Title: SetMotion: End and animation hiccups
Post by: Doan Sephim on July 17, 2021, 06:37:18 PM
I have an animation that goes through various stages, so I have it scripted out in a changeState method.

I have the cycleSpeed set to 4, but when the animation reaches its final cel and moves on to the next state, the last cel lasts for only 1 game cycle before moving on to the next state.

This makes sense because it moves to the next state when it reaches the end because I told it to with SetCycle: End self.

Is there an elegant solution to this to make the last cel last for the full amount of gameCycles (according to what cycleSpeed is set at) before moving to the next state?
Title: Re: SetMotion: End and animation hiccups
Post by: MusicallyInspired on July 17, 2021, 09:14:48 PM
Put a new state in between that only lasts for as many cycles as your cycleSpeed (maybe one less actually) before continuing on to the next state of whatever you want to happen.

Code: [Select]
(1
    (anObject cycleSpeed: 4 setCycle: End self)
)
(2
     (= cycles 3)
)
(3
     (doMoreCode)
)

If your cycleSpeed is set to 4. I'm guessing with this because obviously the last cel will take up at least one game cycle before it moves on to the next state. I can't recall if cycles correlate to cycleSpeed exactly...but adjust as visually necessary.
Title: Re: SetMotion: End and animation hiccups
Post by: Doan Sephim on July 18, 2021, 12:45:07 PM
Thanks! That's a fairly reasonable work around, until I find a more elegant solution anyway.