crew – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
(count crew _vehicle)
(count crew _vehicle)


You still need to use
Gunner _vehicle
Driver _vehicle
Commander _vehicle
to return the actual crew positions correctly


What may be more useful would be to have the crew return an array that does not resize
What may be more useful would be to have the crew return an array that does not resize
Line 23: Line 29:


For example "CrewCount"
For example "CrewCount"
--[[User:Terox|Terox]] 23:25, 6 February 2013 (CET)

Revision as of 00:25, 7 February 2013

Unfortunately the returned crew array will not always be in the format

[driver,gunner,commander,turrets,cargo].

It will automatically resize, meaning for example if there was no Commander, the array would resize to 4 elements. if there was no crew at all, it would resize to an empty array

In its present form this can only really be used for counting the total crew in a vehicle (count crew _vehicle)

You still need to use Gunner _vehicle Driver _vehicle Commander _vehicle

to return the actual crew positions correctly

What may be more useful would be to have the crew return an array that does not resize So for example, if there was no driver, no commander, no turrets and only 1 unit in cargo

hint format [ "%1",crew _vehicle];

would return something like

[objnull , B 1-1-C:1 , objnull , [],[B 1-1-C:3] ]


and then have a new command for returning the number of crew in a vehicle

For example "CrewCount" --Terox 23:25, 6 February 2013 (CET)