Help

BEHAVIOR-EVENT-FORWARDING

For immortals

Behavior event forwarding comes into play when there are multiple behaviors assigned to a room, object, or mobile, and/or when you want to intercept a player command in a behavior.

For example, say you have two behaviors attached to a guard mobile:

1:  message event hit . (The guard screams, 'Die intruders!')
2:  fighter

The MESSAGE behavior by default NEVER forwards an event, and this message behavior has the default settings. This means that when the guard is about to enter combat, the "event hit" will get passed to the MESSAGE behavior and the guard will scream at the intruders. However, the MESSAGE behavior will NOT forward the event to fighter or to the default combat handling so the guard will ONLY scream at the intruders -- it will NOT actually attack!

The proper way to handle this situation is to:

1:  message > event hit . (The guard screams, 'Die intruders!')
2:  fighter

The ">" character means to ALWAYS forward the event. So this time, the guard will scream and then engage the foes with the FIGHTER behavior.

There are four methods of behavior forwarding:

 <nothing>      default for the behavior
 >              always forward
 <              never forward
 %              forward some of the time (randomly)

Most of the behaviors have sensible default forwardings, so you will not always have to set the forwarding setting.