« Prog debuggery | Main | No surprises there »
July 22, 2005
MPROG Tutorial
I get into the meanest, nastiest frame of mind I can manage, and I write the nastiest (testing) code I can think of. Then I turn around and embed that in even nastier constructions that are nearly obscene.Donald Knuth
The tutorials on MPROGs are more or less complete. Code testing resulting from this has squished a good many obfuscated bugs.
It is important to remember that mobs, objects and rooms see the world from slightly different perspectives, so the $ codes may vary in their output slightly when run by different entities. Please test your programs with the object/room/mob that will be running it.
1. An introduction to *progs: The basics
2. Creating a simple mprog
3. Triggers: Setting the prog loose on the world
4. Mob commands
5. Control logic waltz - IF then ELSE then ENDIF
An important note on the order of prog execution
Mprogs are always fired in this order:
Room
Mob
Object
So if you have a speech trigger on all three, the room will react first, then the mob, then the object.
I have added some validation code so that if an item/mob is purged/removed from play whilst it's running (by itself or another prog), it's code will no longer be executed, avoiding unfortunate crashes and hangups.
Scrawled illegibly by Meathe at July 22, 2005 04:08 PM
Comments