Welcome to the Creatures Wiki! Log in and join the community.


From Creatures Wiki
Jump to navigation Jump to search

NULL is a CAOS command.


Syntax: NULL

Returns the null agent.

Some commands, such as TARG, OWNR, _IT_ and others, may return NULL.

You cannot act on the null agent. Attempts to do so will result in Invalid agent.

Note that NULL ne 0 because they are of different types.


Null is often used in ENUM scripts to check if the TARG agent still exists:

**This example enumerates through all creatures and kills the ownr agent if the creature no longer exists
enum 4 0 0
doif targ eq null
kill ownr

The opposite, doif targ ne null, is used in the snotrock and Ghosthande's Hungry Critter Tutorial to help the snotrocks hunt tubas, which may vanish before the snotrock can get to them! By checking that the target agent does not not exist, the critter does not get stuck on a phantom foodstuff.