Page MenuHomeFeedback Tracker

Extend "WeaponAssembled" to include UAV group and units
Closed, ResolvedPublic

Description

When you assemble previously disassembled vehicle that is not local to you, the vehicle passed into WeaponAssembled event handler doesn't have a group or crew in it yet, and its somewhat problematic to capture it by checking the vehicle on next frames as it depends on network latency of vehicle owner. The units are actually there in such case, just outside of the vehicle, and to get them you need to do a hack of iterating through all entities of UAV crew class and select ones that have assignedVehicle to EH-provided vehicle.

I suggest to extend WeaponAssembled event handler and provide created UAV AI units in it. Since the game is hardcoded to only create UAV driver and gunner, just have them one after another in the event handler or two nulls if no UAV units were created.

this addEventHandler ["WeaponAssembled", {
	params ["_unit", "_staticWeapon", "_uavDriver", "_uavGunner"];
}];

I can make a repro for this situation but I don't think its really needed, if both driver and gunner were provided by event handler, it would solve it.

Details

Severity
Feature
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

Repro to check event handler working:

  1. Start game with a player
  2. Execute this code:
player addBackpack "B_UAV_01_backpack_F";
if(isNil"testeh") then {
	testeh = player addEventHandler ["WeaponAssembled", {systemChat str _this}];
};
player action ["Assemble"];
  1. Observe EH arguments

Event Timeline

SaMatra created this task.Apr 2 2023, 1:55 PM

The problem here is that driver and gunner are added at much later stage, and are not available when WeaponAssembled fired. I will add UAVCrewCreated Mission EH which would fire after the crew is added so one can get the weappon, the units and group as soon as they are available

BIS_fnc_KK set Ref Ticket to AIII-55681.May 16 2023, 11:38 AM

Thanks, this will suffice.

Revision: 150630

BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.May 16 2023, 11:54 AM
BIS_fnc_KK changed the task status from New to Feedback.
BIS_fnc_KK added a subscriber: BIS_fnc_KK.

Can be closed as resolved.

Leopard20 closed this task as Resolved.Sep 11 2023, 1:47 PM