Ka-52 fullCrew command returns wrong array
Closed, InvalidPublic


RPT output with diag_log:

[[B Alpha 1-2:1 (Sarogahtyp),"driver",-1,[],false],[B Alpha 1-5:1,"gunner",-1,[0],false],[<NULL-object>,"commander",-1,[1],false]]

existing seats: 1 driver. 1 gunner

result: BUG - array is NOT matching

description: Ka-52 has 2 seats the driver and the gunner. fullCrew is returning a commander seat which does not exist on this vehicle.


Affected classnames
Reproducable without other mods?
Chairborne closed this task as Invalid.Apr 4 2019, 12:01 AM
Chairborne claimed this task.
Chairborne added a subscriber: Chairborne.

there's an additional seat for the gunner to use the autocannon. it works in the way the gunner switches between two seats, whenever one is in use the other is disabled and hidden and viceversa.

Sarogahtyp added a comment.EditedApr 4 2019, 12:23 AM

I don't understand this.
The fullCrew command is intended to use for determining the seats and their roles in a vehicle. If your project returns wrong seats for some vehicles (as it does) then this is a bug because I've no reliable way to detect all seats as I need.
Also the Blackfoot has a autocanon as well and returns this:

1:18:20 "AH-99 Blackfoot"
1:18:20 "B_Heli_Attack_01_dynamicLoadout_F"
1:18:20 [[B Alpha 1-2:1 (Sarogahtyp),"driver",-1,[],false],[<NULL-object>,"gunner",-1,[0],false]]

Could you explain please why this is not a valid bug for you?

Cyruz added a subscriber: Cyruz.Apr 4 2019, 10:10 AM

Ka-52 uses a scripted solution by dynamically locking unlocking a hidden seat so players will only ever see 2 seats at a time. This does break fullCrew as it will return 3 seats, unfortunately you cannot create/remove a seat at run time and this is the only solution that works reliably.

I'd advise scripting around this when adding AI to the helo.

Apollo added a subscriber: Apollo.Apr 4 2019, 10:28 AM

I dont remember the KA-52 in A2 requiring all this rigmarole to function. Also if i think really hard about it this unit used to be set up very differently in CUP and used to function well with AI till it had its gun system scripted in its current state, now you need a player in the gunner seat to switch to the 30mm as AI cannot switch the gun to 30mm or use it.

Well now it's not useless as the ATGMs have a much bigger attack radius without forcing the helo to look directly at targets. The way it was before was definitely NOT ok, and it's not going to change.

As for the scripting error, it's a byproduct of the current scripted solution. I know it's not right, but there's also nothing for me to do to fix it, unfortunately.

Sarogahtyp added a comment.EditedApr 4 2019, 12:22 PM

@Chairborne thx for clarifying

I did not understand. How do you advise to script around this problem? Currently I'm spawning all AI, move em into the vehicle (Ka-52 here) and then detect if they are part of the crew and delete em if not. I for myself think this is a very dirty way to get around this. Do you suggest a cleaner solution?

check if the turret is locked or not?

Cyruz added a comment.EditedApr 4 2019, 2:03 PM

Something like this (not tested)

private _availableSeats = [];
    if (heli lockedTurret (_x select 3) == false) then {_availableSeats pushBack _x};
} forEach fullCrew heli;

@Chairborne @Cyruz thx. I'll try something like that. I just thought the seat is locked only when the other seat is in use but Ill test that.

workaround with lockedTurret command works petty good. thx again