Simple function to return the index of a unit in a vehicles cargo slots.
Description
Details
- Legacy ID
- 2645574950
- Severity
- None
- Resolution
- Fixed
- Reproducibility
- N/A
- Category
- Feature Request
This functionality is available in the engine and used in multiple places internally, it just needs to be exposed via an SQF function. It would literally take 5 minutes to add.
Event Timeline
This could also be returned in assignedVehicleRole, though adding a new function would most likely be the best option due to the possibility of people checking the return length of assignedVehicleRole.
Assignedvehiclerole has very little to do with actualnunits in cargo, even more so with cargo index of a unit
That is actually incorrect.
assignedVehicleRole is used to determine turret locations for units that have been assigned (and then occupied if done correctly by a scripter or the unit moved in through the normal game interface). It is used to return vehicle positions in indeterminable slot roles already. It returning the cargo index for cargo assigned roles would be a somewhat natural extension of that functionality.
unit can have assigned role but not be inside a vehicle
player assignAsCargo heli;
hint str [assignedVehicleRole player, vehicle player != player]; //[["Cargo"], false];
^^^ not in vehicle yet assigned as Cargo. Same goes for assignedCargo
Except that is generally considered bad practice, in that you assign a vehicle role, move the unit in, and then remove their role when they leave because the assigned vehicle role is not dependent on a specific vehicle type.
So in good, proper practice, yes, it is associated to where they are in the vehicle.
Yes, YOU can do it incorrectly, BUT further countering your argument you can assign a cargo index right now to a unit outside of the vehicle as well.
It is a moot point either way because like I said, adding it to that function might possibly break previous scripts that check the length of assigned vehicle role.
I'm not sure I understood your last comment. Length of "assigned vehicle role". It is always 1 unless it is a turret, then it has path so it is 2. What exactly did you mean by that?
If someone is being lazy and checking length of assignedVehicleRole instead of the values to determine if it is a turret position or not.
Mass-closing all resolved issues not updated in the last month.
Please PM me in BI Forums (http://forums.bistudio.com/member.php?55374-Fireball) if you feel your bug was closed in error.