Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: Olleh19 on Mon 27/01/2020 00:45:04

Title: A custom Animation's specific frame needs to trigger another object to appear
Post by: Olleh19 on Mon 27/01/2020 00:45:04
I'm not sure the subject description is understandable enough.
Let's say i have a custom animation with 70 frames, and at frame 60 it needs to trigger another object or animation of another character/object (i'm not sure yet, depends how much effort i wanna put into this).

How would i do that in script?

Thanks!

Title: Re: A custom Animation's specific frame needs to trigger another object to appear
Post by: Crimson Wizard on Mon 27/01/2020 00:57:52
Something like this:

Code (ags) Select

function repeatedly_execute()
{
    if (oObject1.Animating && oObject1.View == MY_VIEW && oObject1.Loop == MY_LOOP && oObject1.Frame == 60) {
         // Trigger action
    }
}


In room script you would replace "repeatedly_execute" with corresponding room's event handler.
Title: Re: A custom Animation's specific frame needs to trigger another object to appear
Post by: Olleh19 on Mon 27/01/2020 01:07:02
Ahh! Yes ofc! I remember now, that .animating syntax, i forgot that, thank god for the beginner technical questions! (laugh) 
Thanks Crimson!