Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: MaiSacNjo Mouf on Fri 05/08/2005 05:46:25

Title: Determine if an object is visible [SOLVED]
Post by: MaiSacNjo Mouf on Fri 05/08/2005 05:46:25
This seems simple enough, and I've been searching the forums for hours looking for an answer, so now I'm posting...
I really hope this isn't posted somewhere else, if so, i'm really really sorry i didn't find it.

I'm just trying to determine if an object is visible...

function object1_a() {
  // script for Object 1: Interact object
if (oFire.visible == true) {
FireRemoveObject(0);
}
else{
  FireAddObject(0,10,11); 
oFire.Visible = true; 
}
}

I'm actually using the fire plugin, and I have an object setting over/behind it (firewood)
This code is in the Interact object of the firewood, so that if the fire is burning, interacting the wood will put it out, and if it's not, interacting the wood will start the fire.  I will make it more elaborate later (use matches/water) but anyway, when I compile I get:
'visible' is not a public member of 'Object'

I can figure out the rest, just need to know how to test if oFire is visible or not.
Seems really simple, I must be overlooking something, and I know I'm going to feel really stupid when I find the answer...

Thanks for any help!
Title: Re: Determine if an object is visible
Post by: Gilbert on Fri 05/08/2005 06:07:15
Visible.
Check the cases, most of the properties need at least the first letter to be capital letter (except for a few cases, which was for backward compatibility with old versions, like  mouse.x, mouse.y, but I think they're not considered properties).
Title: Re: Determine if an object is visible
Post by: MaiSacNjo Mouf on Fri 05/08/2005 06:16:13
Thanks Gilbot!

I knew it, I knew I would feel stupid when I found out what it was!
Title: Re: Determine if an object is visible
Post by: TerranRich on Fri 05/08/2005 22:48:02
I'll have to add a note regarding this fact to the BFAQ. :)