Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Babar on Fri 08/08/2003 12:29:11

Title: Running Dialogs
Post by: Babar on Fri 08/08/2003 12:29:11
I already have another problem now. See, I wanted it that when one of my NPCs say something, after that they would disappear (like a spell that causes invisiblity). I chose run dialog in the interactions menu of the NPC, and after that I added a script to move NPC to a different room. The problem is that when the player talks to the NPC, the NPC disappears and THEN the dialog is run. I read the manual and it said that dialogs are run at the end of the script, so maybe thats the problem. How do I fix it so that the player finishes the dialog AND THEN the NPC disappears?
Thanks again
Title: Re:Running Dialogs
Post by: Necro on Fri 08/08/2003 13:17:58
Most people put stuff like that IN the dialog.

Check yout the Runscript commeand in the dialogs section of the manual on how to call script commands from within a dialog.
Title: Re:Running Dialogs
Post by: Ishmael on Fri 08/08/2003 14:46:01
in the dialog, in the end point (where you want the NPC to disappear) put run-script 1, and in the global script create a new function like this (unless you allrady have the function):

function dialog_request(int parameter) {
 if (parameter == 1)
   charater[NAME].room = -1
}

That shoud do it...