Page MenuHomeFeedback Tracker

[Feature] PylonChanged Event
Feedback, NormalPublic

Description

Title, event fires on any change to pylons

vehicle player addEventHandler ["PylonChanged",{
   params ["_vehicle","_pylonIndex","_oldMagazine","_newMagazine","_oldAmmo","_newAmmo"];
   systemChat "hello i changed my pylon";
   // Would have to stop pylon commands from working within here to prevent recursion
}];

vehicle player setPylonLoadout [1, "PylonWeapon_300Rnd_20mm_shells", true];

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline

WillKMJ created this task.Thu, Apr 10, 7:13 PM
dedmen added a subscriber: dedmen.Fri, Apr 11, 11:39 AM

// Would have to stop pylon commands from working within here to prevent recursion

We don't, because vehicle events are postponed, they don't trigger immediately, they trigger after the simulation is done.

vehicle player addEventHandler ["PylonChanged",{
   params ["_vehicle","_pylonIndex","_oldMagazine","_newMagazine"];
}];

It generally triggers twice for a swap, first unload then load.
[veh, 1, "mag", ""]
[veh, 1, "", "mag"]

dedmen changed the task status from New to Feedback.Fri, Apr 11, 12:00 PM