Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 18/01/2004 13:59:52

Title: Script pause?
Post by: on Sun 18/01/2004 13:59:52
Hi,

I have problem with scripting.
I want to use a hotspot with an item, which will trigger a removal of said item from inventory, then a conversation dialog to be run. After the conversation has ended, I want a character view animation to be run.

I have a Conditional (if inv. item was used)

then as children:-

Game (Run Dialog)
THEN
Player (remove item from inv.)
THEN
Character (Quick animation).

The problem is, the animation runs BEFORE the dialog conversation, and after the item is used on the hotspot, EVEN though they are in the order I described above.

How can I get it so the animation plays AFTER the dialog has ended? Do I have to put in a wait command or equlivalent?

Thanks for any help you can offer; enjoying using AGS so far! :D
Title: Re:Script pause?
Post by: Shadow on Sun 18/01/2004 16:56:31
I don't know if I understood exactly what you wanted, my english is not so good. But try to put this in after Run Dialog:

while (character[EGO].talking != 0){
Wait (1);
}

the script should wait, until your Maincharacter stops talking.
Don't know if it works. Try it out.
Title: Re:Script pause?
Post by: on Sun 18/01/2004 17:43:50
Hi,

Thanks for the fast reply.

Unfortunately that doesn't seem to work; I get an error:

'talking' is not a member of 'GameCharacter'

Any other ideas?
Title: Re:Script pause?
Post by: Ishmael on Sun 18/01/2004 19:28:35
The dialog is run last bacause allways, no matter where in a single function it is, the RunDialog is processed last. So:

If I understood correctly, I think you should do this:

Just put:
Game (Run Dialog)
in the conditional.

Then, in the dialog script, put:

lose-inv x
set-globalint 1 1

or if Globalint 1 is used, replace the first 1 with a free number.

Then, in the room repeadetly execute:

Use a conditional to check if the above selected globalint is 1, if it is, do the character animation, and set the globalint back to 0.

Can you make anything out of this?