Navigation
Aardwolf Main
Aardwolf Info
Aardwolf Wiki
Wiki Help
Mprog Guidelines
Some modern guidelines for mob programs, essential for keeping things sane on Aardwolf.
Global variables and functions should not be used without head builder approval
- All functions and variables should be declared with the 'local' keyword. Lua programs have a shared variable scope, so it is essential that this be handled safely.
Tracker objects - try not to use them!
- If you find yourself needing tracking objects to track string values (such as player names for an epic), this may be an acceptable use for a global variable. We'd rather have a global variable for this purpose rather than taking up storage space and causing disk I/O to store object state. In both cases, the variables are reset over a MUD reboot/hotboot.
- For most state data, you can make use of room.zonedata[1-5], room.data[1-5], and for mobs, ch.data[1-5], and ch.tempdata[1-5] to store state. These can store numeric values, and are a good alternative to changing mobs alignments, changing the value of tracker objects, and other similar things. Note that ch.tempdata is per mob instance, ch.data is per mob key. All but the tempdata values PERSIST OVER A REBOOT!