MPUZ: Object Variables

From Mario Fan Games Galaxy Wiki
Revision as of 16:32, 4 December 2008 by Xgoff (talk | contribs)
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 using me.VAR:

  • sysid: the object's unique ID value, which allows it to be accessed individually.
  • objid: a string which identifies what kind of object the object is, such as "MP_Block" or "MP_Mario".
  • linkid: a value which this object may share with others; this value is used for the trigger function.
  • x and y: the object's X and Y coordinates, respectively; specifically, these refer to the current image's designated hotspot coordinates, which are not necessarily at the upper-left.
  • x_left and x_right: the X coordinates of the object's leftmost and rightmost edges, respectively.
  • y_top and y_bottom: the Y coordinates of the object's topmost and bottommost edges, respectively.
  • x_center and y_center: the center X and Y coordinate of the object, rounded down if needed.
  • dir: the current direction of the object (separate from its angle). Starting at 0 for right, 90 for up, 180 for left, and 270 for down. Generally objects will move in this direction, but this is not guaranteed.
  • angle: the current angle in which the object will be drawn onscreen, but does not affect the object's actual direction; it is a float that ranges from [0, 360), going counterclockwise with 0 pointing "right" (though your object image may not display this).
  • prop1 through prop5: strings which store the values of the 5 property values, if used.

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.