Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Duckbutcher on Fri 04/05/2018 08:13:24

Title: Wait for the end of idle loop before taking action.
Post by: Duckbutcher on Fri 04/05/2018 08:13:24
Hey all, hope you're well. I have a problem.

I'm doing trampoline based puzzle. When my character gets on the trampoline, he bounces up and down as an idle animation. The player can then select various hotspots for him to jump to, at which point a specific blocking animation will play showing him jumping from the trampoline to the particular hotspot.
The problem is of course that the new animation interrupts the idle animation no matter what frame it's on, so I get a jarring effect of my character jumping “mid jump” rather than from the trampoline.

Is there any way to get the game to run to the end of the current loop (ie when he lands back on the trampoline) and then play the next animation?
Title: Re: Wait for the end of idle loop before taking action.
Post by: Khris on Fri 04/05/2018 10:24:29
You should be a able to check player.Frame in room_RepExec. The basic idea is to store the click and postpone its handling until the player's frame is equal to 0.
Title: Re: Wait for the end of idle loop before taking action.
Post by: Duckbutcher on Fri 04/05/2018 12:15:17
Could you be more specific? I've played about with if (player.frame==whatever) etc but can't get the results I'm after. I don't know how to have the game “wait” in terms of frames rather than game loops. Let me know if you can, thanks a lot!

Edit: scratch that, I sorted it! Thanks for getting me started!