How to play an animation after a dialogue

Started by doctorhibert, Sun 26/02/2017 14:02:33

Previous topic - Next topic

doctorhibert

So in my script I have this.
Code: ags

dcomisariofinal.Start();
ofortbot.Animate(0, 1, eOnce, eBlock);

And I want the animation to start after the dialogue is finished, however, when I do this, the animation plays at the same time the dialogue starts. How do I make the game wait until the dialogue is finished to play the animation?

Slasher

Dialog options generally go to the bottom of the function queue and are last to run.

You'll need to put the animation code within the dialog options itself when selecting an option that causes the animation to start.

doctorhibert

I tried it but it says ofortbot is an undefined token

Slasher

#3
you must name objects by their ID not by name when you include it within a dialog option..

eg
Code: ags

ofortbot.Animate(0, 1, eOnce, eBlock); // will not run as it does not know what ofortbot is.

object[3].Animate(0, 1, eOnce, eBlock); // will know how to animate an object by its ID number.

dayowlron

In dialogs you have to reference objects by number. for instance if ofortbot is object number 1
    object[1].Animate(0, 1, eOnce, eBlock);
Pro is the opposite of Con                       Kids of today are so much different
This fact can clearly be seen,                  Don't you know?
If progress means to move forward         Just ask them where they are from
Then what does congress mean?             And they tell you where you can go.  --Nipsey Russell


SMF spam blocked by CleanTalk