Difference between revisions of "MPUZ: Object Variables"
m |
m |
||
Line 1: | Line 1: | ||
{{MPUZ}} | {{MPUZ}} | ||
− | '''Objects''' in [[MPUZ]] have a list of variables that are used to store various information. Following is a list of those variables, which are generally accessed | + | '''Objects''' in [[MPUZ]] have a list of variables that are used to store various information. Following is a list of those variables, which are generally accessed like ''[[MPUZ: Generic Terms|selector]].sysid'': |
− | + | ===Variables and Object Structure=== | |
− | + | Note, the values of these variables are examples only. | |
− | + | <nowiki>object = { | |
− | + | sysid = 1, | |
− | + | objid = "MP_OBJECT", | |
− | + | linkid = 0, | |
− | + | -- | |
− | + | x = 0, | |
− | + | y = 0, | |
− | + | xleft = 0, | |
− | + | xright = 0, | |
+ | ytop = 0, | ||
+ | ybottom = 0, | ||
+ | xscale = 0, | ||
+ | yscale = 0, | ||
+ | angle = 0, | ||
+ | direction = 0, | ||
+ | alpha = 0, | ||
+ | prop1 = "", | ||
+ | prop2 = "", | ||
+ | prop3 = "", | ||
+ | prop4 = "", | ||
+ | prop5 = "", | ||
+ | sys = { }, | ||
+ | cust = { }, | ||
+ | plugin = { }, | ||
+ | } | ||
+ | </nowiki> | ||
These are not the only variables which the engine may store in an object, but these are so-called "standard" variables which all objects will have. | These are not the only variables which the engine may store in an object, but these are so-called "standard" variables which all objects will have. | ||
Within these tutorials, a subtable ''cust'' will be used to store custom variables that are unique to a single object, such as ''me.cust.health''. MPUZ itself may store various other variables in the ''sys'' subtable; which variables these are depends upon certain aspects of the object code (such as variables used by [[MPUZ: Modules|modules]]). Speaking of modules, activated modules use their own table, ''mod'', to specify when they are activated. | Within these tutorials, a subtable ''cust'' will be used to store custom variables that are unique to a single object, such as ''me.cust.health''. MPUZ itself may store various other variables in the ''sys'' subtable; which variables these are depends upon certain aspects of the object code (such as variables used by [[MPUZ: Modules|modules]]). Speaking of modules, activated modules use their own table, ''mod'', to specify when they are activated. | ||
+ | ===Events=== | ||
+ | ''Triggered'' | ||
+ | *'''onCreate( ''OBJECT'' caller)''': called after the object is first created. For any object, this is the first event ever to be called. '''caller''' is a reference to the object that called this event, or a reference to the [[MPUZ: Null Object|Null Object]] if something other than another object called the event. | ||
+ | *'''onDestroy( ''OBJECT'' caller)''': called before the object is destroyed. This is always the last event called for objects. '''caller''' is, again, the calling object, or the Null Object. | ||
+ | ''Continuous'' |
Revision as of 16:03, 15 May 2009
MPUZ |
---|
Development Main Page |
Basics |
Intermediate |
Advanced |
|
Reference |
[Edit] |
Objects in MPUZ have a list of variables that are used to store various information. Following is a list of those variables, which are generally accessed like selector.sysid:
Variables and Object Structure
Note, the values of these variables are examples only.
object = { sysid = 1, objid = "MP_OBJECT", linkid = 0, -- x = 0, y = 0, xleft = 0, xright = 0, ytop = 0, ybottom = 0, xscale = 0, yscale = 0, angle = 0, direction = 0, alpha = 0, prop1 = "", prop2 = "", prop3 = "", prop4 = "", prop5 = "", sys = { }, cust = { }, plugin = { }, }
These are not the only variables which the engine may store in an object, but these are so-called "standard" variables which all objects will have.
Within these tutorials, a subtable cust will be used to store custom variables that are unique to a single object, such as me.cust.health. MPUZ itself may store various other variables in the sys subtable; which variables these are depends upon certain aspects of the object code (such as variables used by modules). Speaking of modules, activated modules use their own table, mod, to specify when they are activated.
Events
Triggered
- onCreate( OBJECT caller): called after the object is first created. For any object, this is the first event ever to be called. caller is a reference to the object that called this event, or a reference to the Null Object if something other than another object called the event.
- onDestroy( OBJECT caller): called before the object is destroyed. This is always the last event called for objects. caller is, again, the calling object, or the Null Object.
Continuous