Difference between revisions of "MPUZ: Object Variables"

From Mario Fan Games Galaxy Wiki
m
m (mrf)
Line 2: Line 2:
 
'''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'':
 
'''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===
 
===Variables and Object Structure===
Note, the values of these variables are examples only.
+
Note: the values of these variables are examples only.
 
  <nowiki>object = {
 
  <nowiki>object = {
 
     sysid = 1,
 
     sysid = 1,
Line 32: Line 32:
 
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: Plugins|plugins]]). Attached plugins are stored as keys in the '''plugin''' subtable, with their current status as their value.
 
===Events===
 
===Events===
 
''Triggered''
 
''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.
+
*'''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.
+
*'''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''
 
''Continuous''

Revision as of 16:05, 15 May 2009

This information is subject to change.
MPUZ
Mpuz logo.png
Development Main Page
Basics
Intermediate
Advanced
  • none
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 plugins). Attached plugins are stored as keys in the plugin subtable, with their current status as their value.

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