Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • a handler tied to "gmcp.Char" will fire on gmcp.Char, gmcp.Char.Vitals and gmcp.Char.Effects
  • a handler tied to "gmcp.Char.Vitals" will NOT fire on gmcp.Char.Status or gmcp.Char.Effects
Info

While a super will fire if a sub event is sent, That does not mean that all the data on the super is updated, or indeed, available.

It is recommended best practice to make the event handlers as small as possible, reacting to the "lowest possible" sub module because of this. Also that the handler only uses data from its own "node" and "downwards"

Example:

  • You do not want to make a handler for gmcp.Char as the submodules below this fire at completely different intervals and events. Also there is no guarantee that all data in gmcp.Char is available at this time
  • Rather make separate handlers for gmcp.Char.Vitals and gmcp.Char.Effects
    • In these handlers, don't access other trees like gmcp.Char.Spells or gmcp.Char.Status


There are two main ways to setup handlers for events in Mudlet. I recommend reading the documentation for the Mudlet Event_Engine for details, but i will brifely describe the methods here:

...