Introduce "getUnitsCargoFull" command
Closed, ResolvedPublic

Description

*Syntax*

ARRAY = getUnitsCargoFull OBJECT

Returns an array with all the units currently occupying cargo space of a vehicle.
Units are arranged by their respective cargo index while empty seats contain objNull.

Example: getUnitsCargoFull heli; //[ai1,ai2,<obj-null>,player1,player2,<obj-null>,<obj-null>,<obj-null>]

*Benefits*

Find out if vehicle can carry cargo and howmany

hint str (count getUnitsCargoFull veh);

find out if what cargo index player is sitting at

hint str ((getUnitsCargoFull veh) find player); //-1 not in cargo

get into first available cargo seat starting from 0

player moveInCargo [veh, (getUnitsCargoFull veh) find objNull];

*Current Problems*

There are about 3 commands in SQF to place unit into cargo position by Index and not 1 to get the cargo position index of the unit.
There are awkward workarounds, using assignAsCargoIndex command but assignedCargo can return units which are not even in the vehicle.
Returning array the length of all possible seats is very flexible solution to a bunch of cargo problems.

Details

Legacy ID
2728077166
Severity
None
Resolution
Fixed
Reproducibility
Always
Operating System
Windows 7
Category
Scripting
Steps To Reproduce

N/A

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Scripting.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 2728077166.May 7 2016, 6:51 PM
Bohemia added a subscriber: AD2001.Jul 1 2014, 12:01 AM

Done awhile ago with modifier to fullCrew command

razazel closed this task as "Resolved".Apr 20 2017, 2:00 PM
razazel edited the task description. (Show Details)
razazel changed Resolution from Open to Fixed.
razazel edited Additional Information. (Show Details)
razazel set Operating System to Windows 7.

Add Comment