Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: markbilly on Sat 28/03/2009 10:55:41

Title: Easy question on running scripts in dialogs.
Post by: markbilly on Sat 28/03/2009 10:55:41
I've been using AGS 2.72 for ages and recently moved to 3. Just getting used to all the changes, dialog stuff being one of them...

You can now put scripts directly in the dialog, which is great, but I have a problem. Doing things like moving the player character, etc are fine, but what happens if you want an object to do something? Because, clearly an object is a room thing, and the dialog is global?

Do you have to resort back to the AGS 2 method of running scripts in a dialog? If so, how do you do it in AGS 3?

Thanks

P.S. Sorry if this has been answered before, or is in the manual. I have looked :/
Title: Re: Easy question on running scripts in dialogs.
Post by: Khris on Sat 28/03/2009 12:29:22
You have to use the object array, just like in the global script.
 // show object 2 in room 3
if (player.Room == 3) object[2].Visible = true;
Title: Re: Easy question on running scripts in dialogs.
Post by: markbilly on Sat 28/03/2009 12:46:27
Brilliant, works a treat. Thanks!
Title: Re: Easy question on running scripts in dialogs.
Post by: Trent R on Sat 28/03/2009 21:01:42
Related, there is also the on_call/CallRoomScript function. For readability, you can through in an enum.


~Trent