Better understanding at Attributes??
eliehang
Member, PRO Posts: 105
Can anyone give me a better understanding of how attributes works... I see a lot of .. example:
create an integer. If 1 does this, then 1 activates or what not. I still have some trouble understanding how game attributes and numbers work together in the rules.
create an integer. If 1 does this, then 1 activates or what not. I still have some trouble understanding how game attributes and numbers work together in the rules.
Comments
In a nutshell, an attribute is an object where you can store data. That data can be accessed and modified by behaviors in an actor, depending on where that actor(prototype or instance) and the attribute(game,scene,actor types) are located. <see the link above>
When an attribute is used in a rule's condition (e.g. if Attribute, self.blah is ? <some expression>), it is comparing that attribute to the value of the expression. (you can just use a value that is not an express, but just a plain value)
Somehow I always manage to figure it out, but it would be nice if there were an in depth guide somewhere other than this one.
http://gamesalad.com/wiki/how_tos:gsc_create_attribute
Real Numbers have decimal points: 1.2, 3.45, 66.78,etc. Only use them if you need the precision that they offer. They are generally considered more taxing on the system, but that matters less and less as time goes on.
An Index is basically an integer, but it can only be positive - no negative numbers. They are generally used for counting lists of items. i.e: there are 5 apples in this bag. There can never be -5 apples in the bag. You do not really need to use an index attribute with GameSalad. You can forget that one for now!
A boolean is an attribute that can only be true or false. One or the other. Off or on. You will use these a lot as well.
http://gamesalad.com/game/play/36994
attributes are where you store/access information that your actors use for different behaviors... variables in other programming languages... characteristics of a particular actor in GS...
Excellent descriptions...FMG!
though I seldom use boolean...and use Index often...for image display in a scene... and to assign to a touch/drag actor position... or may even try them to have appropriate background (etc.) for scene at runtime without actually adding the image in the editor... just make drag-in Note with a list of your images/# for index...
MH
Much appreciation to all of you. I really appreciate the help. /hug