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

MESG WRIT

From Creatures Wiki
Jump to navigation Jump to search

MESG WRIT is a command used to allow objects to affect each other, or for communication between objects and creatures. It sends a message (from the message numbers) to a particular object (which is defined in terms of FROM, TARG, etc.).

Usage

Syntax: MESG WRIT agent message_id(int)

Examples

From the DS lemon pod, using the message number to trigger the push script when a creature pulls the lemon pod (thus reducing the lines of code needed to run the lemon pod, and avoiding copy-paste errors and having to bugfix two identical sections of code each time). This helps prevent the common coding mistake of repeating yourself.

** Pod Pull Script
scrp 2 23 6 2
** Stim the pusher with "Pushed Machinery"
	stim writ from 90 1
** Activate the push script
	mesg writ ownr 0
endm

See also

External links