vsTASKER 7 User Manual
×
Menu
Index

Events

 
An Event is a named signal that carries (or not) user defined values. An Event is initiated by an object and is propagated to other objects that can react to Events (observers).
Propagation is limited by the scope of the triggering. The propagation is also limited at one cycle.
If a reaction to one event raises another event, the latest will be processed at the next cycle. This behavior can be overridden with the risk of infinite loop.
 
 
From the GUI, see here.
 
From the code, do the following:
 
  <initiator>.raiseEvent("event name", { T_Ptr, pointer, Scope });
 
For example, if the entity tank must send the event Fire to all scenario, do the following:
 
  Vt_Entity* tank = S:findEntity("tank");
 tank->raiseEvent("Fire", SCENARIO);
 
To specifically informs the entity target that it has been fired at by tank, do the following:
 
 Vt_Entity* tank = S:findEntity("tank");
 Vt_Entity* target = S:findEntity("target");
 target->raiseEvent("Fire", T_Ptr, tank);
 
 
For now, it is only possible to observe an Event from an Entry Point, under Reaction mode. Components and Data-Models can also react to events.