Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ninone on Fri 02/10/2009 11:58:38

Title: visible=true in dialog
Post by: Ninone on Fri 02/10/2009 11:58:38
Hi, I'm not able to turn on an object in the room during a dialog.
I tried this:
-in dialog I used
run-script 80
-under function dialog_request i inserted
if (param == 80) {
variablex=1;}

-in repeatedly execute
if (variablex == 1) { oObject1.visible = true; }

But it doesn't work.

I need this object visible=true in the middle of a dialog... please help me :) thank you.
Title: Re: visible=true in dialog
Post by: Akatosh on Fri 02/10/2009 12:20:27
If you're using the newest version of AGS, you can simply use


oObject1.Visible = true;


in the dialogue script. Copy and paste it exactly like that, the space sign is rather important.

(In case you're curious... "Indented lines signify that AGS should interpret the line as a normal scripting command rather than a dialog scripting command.", quoth the manual.)
Title: Re: visible=true in dialog
Post by: Ninone on Fri 02/10/2009 12:49:32
Quote from: Akatosh on Fri 02/10/2009 12:20:27
If you're using the newest version of AGS, you can simply use


oObject1.Visible = true;


in the dialogue script. Copy and paste it exactly like that, the space sign is rather important.

(In case you're curious... "Indented lines signify that AGS should interpret the line as a normal scripting command rather than a dialog scripting command.", quoth the manual.)

I used this method before, but it said Error (line 9): Undefined token 'oObject1'
It's indented, but it still doesn't work in the last beta version.
Title: Re: visible=true in dialog
Post by: Akatosh on Fri 02/10/2009 12:59:48
Hmm. Did you really assign that script name to the object? Or did you mean object[0] instead?
Title: Re: visible=true in dialog
Post by: NsMn on Fri 02/10/2009 13:00:07
You need to use the name of your object, or object[Objectnumber] to do this...

Edit: Too slow!  :P
Title: Re: visible=true in dialog
Post by: Ninone on Fri 02/10/2009 13:40:49
object[1] it works :D

Thank you
Title: Re: visible=true in dialog
Post by: Akatosh on Fri 02/10/2009 14:15:09
The coding ninja strikes again! Ha-HAA!

Anyhow, you're welcome.  ;)
Title: Re: visible=true in dialog
Post by: Khris on Fri 02/10/2009 14:20:50
In a global environment, room objects and hotspots can only be accessed by their global array, not by their scriptname.