Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: deedee on Wed 25/02/2004 02:36:28

Title: properties
Post by: deedee on Wed 25/02/2004 02:36:28
I just don't understand how to make them useful. I mean, i created a boolean property but i can't find how to define what that property does. ???

Maybe i got them all wrong. I wanted to create a property similar to the "can be walked though" checkbox in the characters screen. Is it possible to create such property and then apply it to, let say, objects?
Title: Re:properties
Post by: Scummbuddy on Wed 25/02/2004 20:26:39
draw a walkable area on top of the objects place, and when you want to or not be able to walk on it, you just select the walkable area to work or not. Disable or Enable
Title: Re:properties
Post by: deedee on Thu 26/02/2004 14:34:30
Yes, i read how to do that in another topic. thanks anyway.

But still i don't understand how properties work. I would apreciate any help in the subject.

thanks
Title: Re:properties
Post by: Scorpiorus on Thu 26/02/2004 21:22:08
QuoteBut still i don't understand how properties work. I would apreciate any help in the subject.
Basically it works the way that you create a property and set it to some value. Than in script check the value to distinguish between the options you want.

Say, you want an enemy to chase the player but only in some of the rooms. You can make a boolean property - DangerRoom. Than put a code in the main global script's repeatedly execute:

if (GetRoomProperty ("DangerRoom")==1) { //if true

 FollowCharacter(ENEMY, EGO); // chase EGO

}

The code will be executed only in the rooms with the "DangerRoom" property set as true. Thus, if you decide to switch the behaviour for a certain room you don't need to alter the code, just set the property to another value.

~Cheers