Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: kinan___rod on Thu 25/06/2015 07:10:05

Title: How do I reach room objects from global script and conversations?
Post by: kinan___rod on Thu 25/06/2015 07:10:05
I used this line in a conversation script but there is a problem recognising the object (undefined token "oCards").
Code (ags) Select

  oCards.Visible = true;
Title: Re: How do I reach room objects from global script and conversations?
Post by: Gurok on Thu 25/06/2015 07:23:03
In global scripts and conversations, you can only refer to room objects by an index in the global objects array. e.g.

object[0].Visible = true;

This index listed in the room editor as the ID of the object. That was just an example. I don't know what the ID of oCards is. You'll have to use the room editor and look that up yourself.
Title: Re: How do I reach room objects from global script and conversations?
Post by: kinan___rod on Thu 25/06/2015 08:00:23
Thank you man!