Jump to content
Sign in to follow this  
Cards525

Fill Vehicle with ammo?

Recommended Posts

I searched, no results. Sorry.

I'm looking for a script that will allow a vehicle to pull up to a Vehicle Service point, select an option such as "Fireteam Loadout", and then the vehicles gear will be filled with items from the pre-determined list. So basically a script that will fill a vehicle up with extra ammo, rifles, smoke grenades, that kinda thing.

Share this post


Link to post
Share on other sites

It's easy if you have a specific vehicle (cargo capacity is different depending on type) and the ammo you want can be added via addAction

http://community.bistudio.com/wiki/addAction

and a script containing:

http://community.bistudio.com/wiki/addMagazineCargoGlobal

http://community.bistudio.com/wiki/addWeaponCargoGlobal

http://community.bistudio.com/wiki/addBackpackCargoGlobal

I thought someone would have an example but couldn't find anything with a search. To clear the cargo before you add there are corresponding clear commands for the above.

edit:Remembered this from a few yrs back when I was last scripting regularly:

http://forums.bistudio.com/showthread.php?107661-Vehicle-Cargo-Capacity-Chart&highlight=cargo+capacity

http://forums.bistudio.com/showthread.php?134508-How-to-get-cargo-capacity-and-cost-weight-of-stuff-into-sqf&highlight=cargo+capacity

Edited by Mattar_Tharkari

Share this post


Link to post
Share on other sites
It's easy if you have a specific vehicle (cargo capacity is different depending on type) and the ammo you want can be added via addAction

http://community.bistudio.com/wiki/addAction

and a script containing:

http://community.bistudio.com/wiki/addMagazineCargoGlobal

http://community.bistudio.com/wiki/addWeaponCargoGlobal

http://community.bistudio.com/wiki/addBackpackCargoGlobal

I thought someone would have an example but couldn't find anything with a search. To clear the cargo before you add there are corresponding clear commands for the above.

edit:Remembered this from a few yrs back when I was last scripting regularly:

http://forums.bistudio.com/showthread.php?107661-Vehicle-Cargo-Capacity-Chart&highlight=cargo+capacity

http://forums.bistudio.com/showthread.php?134508-How-to-get-cargo-capacity-and-cost-weight-of-stuff-into-sqf&highlight=cargo+capacity

Riiiiight.

Because I've never used those before. :l

I asked for a script that would fill up the nearest vehicle to the container at the time of action with the desired loadout. Not how to use addmagazine.

Share this post


Link to post
Share on other sites

Well, without addMagazine, you will never be able to load any ammo or gear into a vehicle. The script you are looking for most likely doesn't exist, because it won't work for just any vehicle considering some vehicles do not have the ability to carry a lot of ammo/gear. You are better off asking for help creating such a script. The script would also need to be tailored for the specific vehicles used in your mission, otherwise it simply will not work. What happens when you drive into the service point on a motorcycle? Using actions is the poor mans way to go about offering different loadout choices. A user interface dialog would be my choice. Your odds are good that somebody might help you write the script, but finding somebody to help you create the user interface dialog, well, you might be better off teaching pigs to fly, so I guess the best route you could take would be to use "addAction".

In my missions, I have very specific gear added to every vehicle and the vehicles will also respawn with the same added gear. I first remove all the gear that is in the vehicle and then add my own assortment of gear, but I also leave a lot of empty weapon and magazine slots in each vehicle, otherwise you will wind up dropping a lot of gear on the ground when swapping weapons to and from the vehicle.

I wish you luck with your script.

Share this post


Link to post
Share on other sites

If you look at those last 2 links there is a script that checks the space in vehicles and adds items at the beginning of the mission - it's almost what you need?

That eggbeast bloke is just eggtastic:

http://forums.bistudio.com/showthread.php?134508-How-to-get-cargo-capacity-and-cost-weight-of-stuff-into-sqf&p=2261699&viewfull=1#post2261699

Share this post


Link to post
Share on other sites

I'm the one who wrote those scripts for the 15th.

Here is an example mission(this is my new version with a gui)

These have a few dependency's, like ACE and GLT. but these can easily be taken out.

https://sites.google.com/site/armatutorials/home/videos/New_veh_Loadouts_ver_2.Takistan.7z?attredirects=0&d=1

Here is the old ones with just the addactions:

https://sites.google.com/site/armatutorials/home/videos/truckloadouts.Takistan.zip?attredirects=0&d=1

Here is the nuts and bolts of it: (there is a lot of other code that sets all this up in the mission.)

// Multi Load-out script for Vehicles.
// Made for the 15th MEU(SOC) by Oliver.
// Activate from trigger provided in example mission.


//  _truk addMagazineCargoGlobal["ACE_TOW_CSWDM",5]; // Used for adding Tow magazine, if needed by unit in the future.


private ["_loader","_loadouttype","_truk","_truk_type"];


_loader = player;


//if (vehicle _loader == player) exitWith{hint "Your not in a Vehicle!";};


_loadouttype = (lbCurSel 1564) + 1;


_truk = vehicle _loader;


_truk_type = typeof _truk;


closeDialog 0;




// Gambler 1 Loadout
If (_loadouttype == 1) then
{
   _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type];
   sleep 3;
   _truk addWeaponCargoGlobal["ACE_M136_CSRS",1];
   _truk addMagazineCargoGlobal["30rnd_556x45_stanag",16];
   _truk addMagazineCargoGlobal["200rnd_556x45_m249",4];
   _truk addMagazineCargoGlobal["HandGrenade_West",6];
   _truk addMagazineCargoGlobal["ACE_Flashbang",12];
   _truk addMagazineCargoGlobal["smokeshell",6];
   _truk addMagazineCargoGlobal["smokeshellgreen",6];
   _truk addMagazineCargoGlobal["smokeshellred",6];
   _truk addMagazineCargoGlobal["1Rnd_HE_M203",6];
   _truk addMagazineCargoGlobal["1rnd_smokered_m203",6];
   _truk addMagazineCargoGlobal["ACE_MK19_CSWDM",4];
   _truk addMagazineCargoGlobal["ACE_M2_CSWDM",4];
   _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",4];
   _truk addWeaponCargoGlobal["ACE_WireCutter",1];

   _truk vehicleChat format ["Loading Complete %1..", _truk_type];


   hint "Gambler 1 Gear Loaded";
};


// Gambler 4 Mortar Team
If (_loadouttype == 2) then
{
   _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type];
   sleep 3;
   _truk addWeaponCargoGlobal["laserdesignator",1];
   _truk addMagazineCargoGlobal["30rnd_556x45_stanag",30];
   _truk addMagazineCargoGlobal["ACE_M224HE_CSWDM",100];
   _truk addMagazineCargoGlobal["ACE_M224WP_CSWDM",100];
   _truk addMagazineCargoGlobal["ACE_M224IL_CSWDM",100];
   _truk addMagazineCargoGlobal["smokeshell",6];
   _truk addMagazineCargoGlobal["smokeshellgreen",6];
   _truk addMagazineCargoGlobal["smokeshellred",6];
   _truk addMagazineCargoGlobal["ACE_Claymore_M",2];
   _truk addMagazineCargoGlobal["laserbatteries",1];
   _truk addMagazineCargoGlobal["ACE_Battery_Rangefinder",12];
   _truk addWeaponCargoGlobal["binocular",1];
   _truk addWeaponCargoGlobal["ACE_DAGR",1];
   _truk addWeaponCargoGlobal["ACE_Rangefinder_OD",1];
   _truk addWeaponCargoGlobal["ACE_WireCutter",1];
   _truk addMagazineCargoGlobal["ACE_Bandage",10];
   _truk addMagazineCargoGlobal["ACE_Morphine",5];
   _truk addMagazineCargoGlobal["ACE_Epinephrine",5];
   _truk addMagazineCargoGlobal["ACE_Medkit",5];
   _truk addWeaponCargoGlobal["ACE_MX2A",1];
   _truk addWeaponCargoGlobal["Laserdesignator",1];
   _truk addMagazineCargoGlobal["Laserbatteries",1];
   _truk addWeaponCargoGlobal["ace_arty_rangeTable_m224_legacy",2];
   _truk addWeaponCargoGlobal["ACE_M224TripodProxy",1];
   _truk addWeaponCargoGlobal["ACE_M224Proxy",1];

   _truk vehicleChat format ["Loading Complete %1..", _truk_type];


   hint "Gambler 4 Mortar Team Gear Loaded";
};


// Gambler 4 MG Team
If (_loadouttype == 3) then
{
   _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type];
   sleep 3;
   _truk addWeaponCargoGlobal["ACE_M136_CSRS",2];
   _truk addMagazineCargoGlobal["30rnd_556x45_stanag",50];
   _truk addMagazineCargoGlobal["100Rnd_762x51_M240",25];
   _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",4];
   _truk addMagazineCargoGlobal["HandGrenade_West",12];
   _truk addMagazineCargoGlobal["smokeshell",12];
   _truk addMagazineCargoGlobal["smokeshellgreen",6];
   _truk addMagazineCargoGlobal["smokeshellred",6];
   _truk addMagazineCargoGlobal["1Rnd_HE_M203",12];
   _truk addMagazineCargoGlobal["1rnd_smokered_m203",6];
   _truk addMagazineCargoGlobal["1rnd_smokegreen_m203",6];
   _truk addMagazineCargoGlobal["1Rnd_SmokeYellow_M203",6];
   _truk addMagazineCargoGlobal["ACE_M2_CSWDM",12];
   _truk addWeaponCargoGlobal["m240_scoped_ep1",1];
   _truk addWeaponCargoGlobal["m240",1];
   _truk addWeaponCargoGlobal["m16a2",4];
   _truk addMagazineCargoGlobal["ACE_Claymore_M",4];
   _truk addWeaponCargoGlobal["ACE_WireCutter",1];
   _truk addMagazineCargoGlobal["ACE_Bandage",8];
   _truk addMagazineCargoGlobal["ACE_Morphine",2];
   _truk addMagazineCargoGlobal["ACE_Epinephrine",2];
   _truk addMagazineCargoGlobal["ACE_Medkit",2];
   _truk addWeaponCargoGlobal["ACE_MX2A",1];
   _truk addWeaponCargoGlobal["Laserdesignator",1];
   _truk addMagazineCargoGlobal["Laserbatteries",1];

   _truk vehicleChat format ["Loading Complete %1..", _truk_type];


   hint "Gambler 4 MG Team Gear Loaded";
};


// Gambler 4 Assault Team
If (_loadouttype == 4) then
{
   _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type];
   sleep 3;
   _truk addMagazineCargoGlobal["30rnd_556x45_stanag",50];
   _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",4];
   _truk addMagazineCargoGlobal["HandGrenade_West",12];
   _truk addMagazineCargoGlobal["smokeshell",12];
   _truk addMagazineCargoGlobal["smokeshellgreen",6];
   _truk addMagazineCargoGlobal["smokeshellred",6];
   _truk addMagazineCargoGlobal["ACE_MK19_CSWDM",12];
   _truk addWeaponCargoGlobal["m16a2",4];
   _truk addMagazineCargoGlobal["ACE_Claymore_M",4];
   _truk addMagazineCargoGlobal["ACE_C4_M",4];
   _truk addWeaponCargoGlobal["ACE_WireCutter",1];
   _truk addMagazineCargoGlobal["ACE_Bandage",8];
   _truk addMagazineCargoGlobal["ACE_Morphine",2];
   _truk addMagazineCargoGlobal["ACE_Epinephrine",2];
   _truk addMagazineCargoGlobal["ACE_Medkit",2];
   _truk addWeaponCargoGlobal["smaw",1];
   _truk addMagazineCargoGlobal["smaw_heaa",20];
   _truk addMagazineCargoGlobal["smaw_hedp",20];
   _truk addMagazineCargoGlobal["ACE_SMAW_NE",20];
   _truk addMagazineCargoGlobal["ACE_SMAW_Spotting",60];
   _truk addWeaponCargoGlobal["ACE_MX2A",1];
   _truk addWeaponCargoGlobal["Laserdesignator",1];
   _truk addMagazineCargoGlobal["Laserbatteries",1];

   _truk vehicleChat format ["Loading Complete %1..", _truk_type];


   hint "Gambler 4 Assault Team Gear Loaded";
};


// Medical Team
If (_loadouttype == 5) then
{
   _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type];
   sleep 3;
   _truk addMagazineCargoGlobal["30rnd_556x45_stanag",10];
   _truk addMagazineCargoGlobal["smokeshell",10];
   _truk addMagazineCargoGlobal["smokeshellgreen",10];
   _truk addMagazineCargoGlobal["ACE_Bandage",100];
   _truk addMagazineCargoGlobal["ACE_Morphine",100];
   _truk addMagazineCargoGlobal["ACE_Epinephrine",100];
   _truk addMagazineCargoGlobal["ACE_Medkit",100];
   _truk addMagazineCargoGlobal["ACE_Bodybag",100];
   _truk addMagazineCargoGlobal["ACE_Stretcher",4];  



   _truk vehicleChat format ["Loading Complete %1..", _truk_type];


   hint "Medical Team Gear Loaded";
};


// CLB Team
If (_loadouttype == 6) then
{
   _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type];
   sleep 3;
   _truk addWeaponCargoGlobal["ACE_M136_CSRS",1];
   _truk addMagazineCargoGlobal["30rnd_556x45_stanag",16];
   _truk addMagazineCargoGlobal["200rnd_556x45_m249",4];
   _truk addMagazineCargoGlobal["HandGrenade_West",6];
   _truk addMagazineCargoGlobal["ACE_Flashbang",6];
   _truk addMagazineCargoGlobal["smokeshell",6];
   _truk addMagazineCargoGlobal["smokeshellgreen",6];
   _truk addMagazineCargoGlobal["smokeshellred",6];
   _truk addMagazineCargoGlobal["ACE_MK19_CSWDM",4];
   _truk addMagazineCargoGlobal["ACE_M2_CSWDM",4];
   _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",4];
   _truk addWeaponCargoGlobal["ACE_WireCutter",1];
   _truk addMagazineCargoGlobal["PipeBomb",10];
   _truk addMagazineCargoGlobal["ACE_C4_M",6];
   _truk addMagazineCargoGlobal["ACE_ANM14",4];
   _truk addMagazineCargoGlobal["ACE_M2SLAM_M",5]; 



   _truk vehicleChat format ["Loading Complete %1..", _truk_type];


   hint "Broadsword Gear Loaded";
};


// Charlie
If (_loadouttype == 7) then
{
   _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type];
   sleep 3;
   _truk addWeaponCargoGlobal["ACE_M136_CSRS",1];
   _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",5];
   _truk addMagazineCargoGlobal["LASERBATTERIES",2];
   _truk addMagazineCargoGlobal["30rnd_556x45_stanag",20];
   _truk addMagazineCargoGlobal["200rnd_556x45_m249",5];
   _truk addMagazineCargoGlobal["HandGrenade_West",12];
   _truk addMagazineCargoGlobal["ACE_Flashbang",12];
   _truk addMagazineCargoGlobal["smokeshell",6];
   _truk addMagazineCargoGlobal["smokeshellgreen",6];
   _truk addMagazineCargoGlobal["smokeshellred",6];
   _truk addMagazineCargoGlobal["1Rnd_HE_M203",6];
   _truk addMagazineCargoGlobal["1rnd_smokered_m203",6];
   _truk addMagazineCargoGlobal["ACE_Battery_Rangefinder",2];
   _truk addMagazineCargoGlobal["ACE_Bandage",10];
   _truk addMagazineCargoGlobal["ACE_Morphine",5];
   _truk addMagazineCargoGlobal["ACE_Epinephrine",5];
   _truk addMagazineCargoGlobal["ACE_Medkit",5];

   _truk vehicleChat format ["Loading Complete %1..", _truk_type];




   hint "Highlander Gear Loaded";
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×