Page MenuHomeFeedback Tracker

[Feature Request] New Scripting Command: execEventHandler
Closed, ResolvedPublic

Description

Description: Triggers a particular event handler on a unit, generating a custom return value in the event handler; all unspecified array values in a return shall be type 'nil'

Syntax:
_unit execEventHandler ["EventHandlerName", _eventHandlerReturnsAsArray];

Examples:
_unit execEventHandler ["Fired", [_unit, currentWeapon _unit, currentMuzzle _unit, currentMode _unit, getText (configFile >> "CfgMagazines" >> _currentMagazine _unit >> "ammo"), currentMagazine _unit, _projectile, _unit]];
_unit execEventHandler ["IncomingMissile", [_unit, getText (configFile >> "CfgMagazines" >> _currentMagazine _enemy >> "ammo"), vehicle _enemy, _enemy]];

Reasoning:
There exists no way to trigger certain eventHandlers in game for things like manual setting of missile targets ('setMissileTarget/Pos') and triggering appropriate reactions, i.e. 'IncomingMissile' event handlers. Further utility for triggering certain event handlers for more streamlined testing of particular event handler scripts, or for purposes not conceived by this ticket author.

Details

Severity
None
Resolution
Won't Fix
Reproducibility
N/A
Operating System
Windows 7
Category
Scripting

Event Timeline

LLukeL created this task.Jun 21 2020, 12:10 PM

Event handler is just a code you add that is executed upon an event. If you wrap your code in a function you can call this function separately from event. However if you are asking that execEventHandler will generate an event, this is not possible.

BIS_fnc_KK closed this task as Resolved.Jun 22 2020, 1:17 AM
BIS_fnc_KK changed Resolution from Open to Won't Fix.