DSB/Messages

From DmWiki
< DSB
Jump to: navigation, search

Base messages as defined by DSB and used in ESB are the following:

  • Activate (M_ACTIVATE) - Enables instances, opens pits, closes doors, triggers generators, etc.
  • Deactivate (M_DEACTIVATE) - Disables instances, closes pits, opens doors, etc.
  • Toggle (M_TOGGLE) - Enables a disabled instance and disables an enabled one.
  • Next Tick (M_NEXTTICK) - Tells instances to proceed. Makes doors continue to open and close, monster generators re-enable, etc.
  • Expire (M_EXPIRE) - Triggers an on_expire event, or simply destroys the instance if there is no such event.
  • Clean Up (M_CLEANUP) - Deletes the targeted instance from the target list of all instances in the dungeon.
  • Reset Counter (M_RESET) - Sets a counter back to its default value.
  • Destroy (M_DESTROY) - Removes the instance from the dungeon. This can cause Lua errors if triggers etc. target it and it isn't sent a Clean Up first.

Define new messages with dsb_add_msgtype.

There is also a special set of messages that can be sent to the special target SYSTEM, either from dsb_msg or from a msgzone.

They take some extra parameters, which can be either sent as data with the msg, or added as parameters to the call to dsb_msgzone. (i.e., this special case of dsb_msgzone takes 10 parameters instead of the usual 8) The extra parameters are noted after the name of the system message. If a 0 is listed, just pass 0.

  • SYS_MAGIC_PPOS (ppos, 0) = Sets the currently displayed spellcaster to the specified ppos.
  • SYS_MAGIC_RUNE (ppos, rune_number) = Stores the specified rune into the specified ppos's pending spell.
  • SYS_MAGIC_BACK (ppos, 0) = Deletes the last rune from the specified ppos's pending spell.
  • SYS_MAGIC_CAST (ppos, 0) = Casts the current spell for the specified ppos. Does a bit of internal processing and then calls sys_spell_cast.
  • SYS_METHOD_OBJ (ppos, location) = Shows the attack method dialogue for a given ppos from a given location
  • SYS_METHOD_SEL (inst, method) = Selects the given attack method for the given instance. (Note: Currently, if the method was not first popped up via * SYS_METHOD_OBJ, this will do nothing.)
  • SYS_METHOD_CLEAR (ppos, 0) = Clears the attack method for the given ppos.