BlackbirdSD 15 Posted November 9, 2020 Is it possible to have a Bergen backpack with randomized ammo? If so how? Thanks Share this post Link to post Share on other sites
gc8 977 Posted November 12, 2020 Wrote this little script that does that, it adds the backpack full of magazines of types listed, to player _unit = player; clearAllItemsFromBackpack _unit; _magTypes = ["30Rnd_65x39_caseless_mag","Chemlight_green"]; while { true } do { _mag = selectRandom _magTypes; if(!(_unit canAddItemToBackpack _mag)) exitWith {}; _unit addItemToBackpack _mag; }; Just put the magazines you want in the _magTypes array. There's currently only one mag type and chemlight 🙂 and replace player with any unit you want Share this post Link to post Share on other sites
Joe98 91 Posted November 12, 2020 Create 10 Bergen pack packs each with different types of ammo Arrange a random event so that 9 of them are destroyed as soon as the mission starts Walk around a wall. When you arrive, there is one back pack. From the player's point of view, every time you start the mission, you get one of 10 back packs at random. Share this post Link to post Share on other sites
Joe98 91 Posted November 12, 2020 Create 10 AI soldiers. Each has a Bergen back pack with a different load of ammo. Create a trigger that makes all 10 come to you to provide ammo. Create a trigger so that 9 are deleted at random and one survives. From the player's point of view, every time you play the mission, an ammo carrier will arrive. he will have one of 10 back packs at random. Share this post Link to post Share on other sites
BlackbirdSD 15 Posted November 14, 2020 Thanks to both of you. I will give it a try i think the one gc8 suggested might be more what im looking for. Share this post Link to post Share on other sites
BlackbirdSD 15 Posted November 14, 2020 On 11/12/2020 at 10:45 AM, gc8 said: Wrote this little script that does that, it adds the backpack full of magazines of types listed, to player _unit = player; clearAllItemsFromBackpack _unit; _magTypes = ["30Rnd_65x39_caseless_mag","Chemlight_green"]; while { true } do { _mag = selectRandom _magTypes; if(!(_unit canAddItemToBackpack _mag)) exitWith {}; _unit addItemToBackpack _mag; }; Just put the magazines you want in the _magTypes array. There's currently only one mag type and chemlight 🙂 and replace player with any unit you want Where does the script go and how do you adjust quantity of each mag? Can that be random too? Share this post Link to post Share on other sites
gc8 977 Posted November 14, 2020 6 hours ago, BlackbirdSD said: Where does the script go and how do you adjust quantity of each mag? Can that be random too? The script can go to init.sqf it depends entirely which backpacks you want to fill. Do you mean you want more mags of certain type than others? Share this post Link to post Share on other sites
BlackbirdSD 15 Posted November 14, 2020 9 hours ago, gc8 said: The script can go to init.sqf it depends entirely which backpacks you want to fill. Do you mean you want more mags of certain type than others? to have a random quantity of the random mags. Share this post Link to post Share on other sites
gc8 977 Posted November 15, 2020 Well there's the selectRandomWeighted command so I modified the script to this: _unit = player; clearAllItemsFromBackpack _unit; _magTypes = ["30Rnd_65x39_caseless_mag",random 1,"Chemlight_green",random 1]; while { true } do { _mag = selectRandomWeighted _magTypes; if(!(_unit canAddItemToBackpack _mag)) exitWith {}; _unit addItemToBackpack _mag; }; Share this post Link to post Share on other sites
BlackbirdSD 15 Posted November 19, 2020 On 11/15/2020 at 4:47 AM, gc8 said: Well there's the selectRandomWeighted command so I modified the script to this: _unit = player; clearAllItemsFromBackpack _unit; _magTypes = ["30Rnd_65x39_caseless_mag",random 1,"Chemlight_green",random 1]; while { true } do { _mag = selectRandomWeighted _magTypes; if(!(_unit canAddItemToBackpack _mag)) exitWith {}; _unit addItemToBackpack _mag; }; Thanks. Ill try Share this post Link to post Share on other sites