Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Sun 06/12/2009 16:24:47

Title: I am looking for is a condition with Objects
Post by: barefoot on Sun 06/12/2009 16:24:47
Hi

I have 6 objects in a room. 3  that are visible when the room is entered and 3 that are invisible when the room entered.

when a gun is used on the visible objects they are replaced by the other 3 objects using the  Visible = false/true statements. (monster alive is true and monster dead is false at room load)

what I am looking for is a condition that happens when ALL 3 objects (monster alive)become visible (monster dead)

ie;


Display("You have killed the 3 monsters and it's now safe to pass")
player.ChangeRoom(23, 55, 371);

Hope this is clear enough and hope someone can help.

barefoot

Title: Re: I am looking for is a condition with Objects
Post by: monkey0506 on Sun 06/12/2009 16:47:19
That's easy. Just do something like:

if ((oMonster1Dead.Visible) && (oMonster2Dead.Visible) && (oMonster3Dead.Visible)) {
  Display("You have killed the 3 monsters and it's now safe to pass")
  player.ChangeRoom(23, 55, 371);
}
Title: Re: I am looking for is a condition with Objects
Post by: barefoot on Sun 06/12/2009 17:19:34
Cheers monkey..

at the moment i came across:

swampmonster1.Solid = true;
swampmonster1.BlockingHeight = 420;
swampmonster1.BlockingWidth = 90;

and i change it to false when the object changed... and it works for me on this occassion..

but thanks and i will use your option next time

thanks again

barefoot
Title: Re: I am looking for is a condition with Objects
Post by: monkey0506 on Sun 06/12/2009 17:25:18
You said you had 6 objects total and were just using the Visible property... :-\

....but...I guess you got it sorted out then?
Title: Re: I am looking for is a condition with Objects
Post by: barefoot on Sun 06/12/2009 18:03:43
Hi Monkey

just for the record...

6 objects in total... 3 objects visible and 3 objects invisible.

When a visible object is killed it becomes invisible and an invisible object becomes visible to take its place, if you catch my drift..

cheers
barefoot