Search the Community
Showing results for tags 'setUnitLoadout'.
Found 2 results
FUNCTIONS FOR GETTING / SETTING VEHICLE LOADOUT Hi all, Here is a script for getting the loadout of any vehicle or crate (any container in fact) then transfer it on another vehicle or crate. This works in SP or MP. This functions work also for virtual arsenal, edited, or scripted with addAction command. If any uniform, vest or backpack with their own custom loadout inside it, you'll recover the exact loadout for each one. (I didn't push to keep the same ammo count on each mag...) So, it's compatible and consistent with some automatic loaded backpacks, which will be loaded as you let them instead of their auto-default loadout. NB1: The loadout of the receiving container will be replaced by the loadout you get. NB2: see also the respawn vehicle script for integration of these two functions on respawning vehicles. (script to be issued soon). parameters: one objet <vehicle or crate, preferable> applying to getVehicleLoadout, two objects <new vehicle or crate, old vehicle or crate> applying to getVehicleLoadout Limitations: The object you picked the loadout with getVehicleLoadout must not be deleted before you apply the setVehicleLoadout on another object. Not tested, crates and vehicles overall load limitations, if any. I didn't see any of them so far. Examples: car1 call MGI_fnc_getVehicleLoadout; // you pick the current loadout of a vehicle; cursorTarget call MGI_fnc_getVehicleLoadout; // if you're pointing at a backpack on ground, you pick its loadout (must stay on cursorTarget for transferring the whole backpack in a named vehicle/crate); [car2,crate1] call MGI_fnc_setVehicleLoadout; // you call the loadout of crate1, previously recorded with MGI_fnc_getVehicleLoadout; The two objects must be present, not applicable on player or infantry units (see BI commands getUnitLoadout / setUnitLoadout) you apply the loadout of crate1 on car2, these two objects have now the same loadout. [car2,cursorTarget] call MGI_fnc_setVehicleLoadout; // see above. If you are still on same cursorTarget, you pass the container to the new object (so,new vehicle must be named for debug console usage). Codes to be run anywhere you need it, locally, preferably on server. MGI_fnc_getVehicleLoadout MGI_fnc_setVehicleLoadout
Hi, Posting here coz cant get in new feedback tracker :( VERSION: Public (non-dev) 1.62.137494 DESCRIPTION: I noticed following problem when using setUnitLoadout command. When more than 1 magazine have same number of bullets (but less than maximum magazine capacity), this command will not set given bullet count, instead added mags will be fully loaded to its maximum capacity. REPRODUCTION Try execute following player setUnitLoadout [,,,,["V_Chestrig_rgr",[["30Rnd_556x45_Stanag",15,3]]],,"","",,["","","","","",""]] This command should give 3 mags with 15 bullets each. It will give 3 full mags instead. HOWEVER!!!!!! Adding one magazine will work fine. player setUnitLoadout [,,,,["V_Chestrig_rgr",[["30Rnd_556x45_Stanag",15,1]]],,"","",,["","","","","",""]] ALSO: There is also a nasty workaround player setUnitLoadout [,,,,["V_Chestrig_rgr",[["30Rnd_556x45_Stanag",15,1],["30Rnd_556x45_Stanag",15,1]]],,"","",,["","","","","",""]] This will give two semi-filled magazines. But this is not very usable, because getUnitLoadout will combine similar mags with same ammo count. Hopefully this command will be fixed, as it is THE VERY BEST item handling command ever!!! I personally love, how this command handles wrong input and empty arrays, so much more flexible from addMagazine, addItem and others. Great work BIS! :)