Difference between revisions of "MPUZ: Null Object"

From Mario Fan Games Galaxy Wiki
 
m
 
Line 2: Line 2:
 
The '''Null Object''' is a special object in [[MPUZ]]'s runtime engine. It never participates during gameplay, has no onscreen object, its events are normally never run, and it contains no useful information. However, it finds use as an error handler and a source of an object reference in cases where a valid reference would not be produced.
 
The '''Null Object''' is a special object in [[MPUZ]]'s runtime engine. It never participates during gameplay, has no onscreen object, its events are normally never run, and it contains no useful information. However, it finds use as an error handler and a source of an object reference in cases where a valid reference would not be produced.
  
There are actually two kinds of Null Object: created Null Objects and the Null Object at [[MPUZ: Object Variables|sysid]] 0. Null Objects are created when some error happens during an attempt to load or create another [[MPUZ: Objects|object]]. In these cases, the Null Object outputs an error message to the error log and immediately destroys itself.
+
The Null Object is referenced by the variable <tt>null</tt>. Null Objects are created when some error happens during an attempt to load or create another [[MPUZ: Objects|object]]. In these cases, the Null Object outputs an error message to the error log and immediately destroys itself.
  
Null Objects have all of their numeric variables set to 0 (except created Null Objects, which have their own sysid), and all of their string variables are empty except for '''objid''', which contains "MP_Null". The Null Object at sysid 0 is not counted in object counts or in any other instances that deal with objects, but other Null Objects are.
+
Null Objects have all of their numeric variables set to 0, and all of their string variables are empty except for '''objid''', which contains "MP_Null".

Latest revision as of 07:45, 4 March 2010

This information is subject to change.
MPUZ
Mpuz logo.png
Development Main Page
Basics
Intermediate
Advanced
  • none
Reference
[Edit]


The Null Object is a special object in MPUZ's runtime engine. It never participates during gameplay, has no onscreen object, its events are normally never run, and it contains no useful information. However, it finds use as an error handler and a source of an object reference in cases where a valid reference would not be produced.

The Null Object is referenced by the variable null. Null Objects are created when some error happens during an attempt to load or create another object. In these cases, the Null Object outputs an error message to the error log and immediately destroys itself.

Null Objects have all of their numeric variables set to 0, and all of their string variables are empty except for objid, which contains "MP_Null".