Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:2.07

Description

Description:

Triggers an event for which an event handler had been defined (using addEventHandler).

This causes the actions, defined for this specific event handler, to be executed, even though the event does not actually occur (the event is only simulated" by this command).

Syntax

Syntax:processEvent [target,type,simulation,parameters]
Parameters:
  • target: Object - Object the event handler is assigned to (does not work with groups or side event handlers).
  • type: String - Event handler type that is assigned (see Category VBS Event Handlers for options).
  • simulation: Boolean - If true, then the original action (for example, an explosion) is also executed; if false, then only the event handler is executed (only works for the AmmoExplode event handler).
  • parameters: Array - Parameter list to send to the event handler. This array contains what a regular event normally sends in the _this array. If empty, then the regular parameters are sent.
Return Value:Boolean - Whether the event executed successfully.

Examples

Examples:Define a HitPart event for a vehicle, and then trigger it, using the processEvent command. The parameters passed include the 2nd element, which normally contains the shooter for HitPart:
car addEventHandler ["HitPart","hint format['%1 is firing at us!',(_this select 0) select 1]"];
processEvent [car,"hitpart",true,[[0,"Nobody"]]]

Additional Information

See also: addEventHandler, Category VBS Event Handlers, setDanger
Multiplayer:
Problems:

Notes