randomCrateLoadOut
  • Offline soulkobk
  • First Blood
  • ***
  • Posts: 99
  • soulkobk.blogspot.com.au

randomCrateLoadOut

« posted: Oct 09, 2016, 02:39 PM »
My script/function replaces the standard 'fn_refillbox' function within mission scripts for crates that spawn at mission completion. *100% random loot within! Lots of gear? Bugger all gear? Luck of the draw! :D

You can see/grab it on the link below...

https://github.com/soulkobk/ArmA_Scripts/blob/master/randomCrateLoadOut/randomCrateLoadOut.sqf

PLEASE READ THE HEADER OF THE SCRIPT FOR INSTALL/CONFIGURATION INFORMATION

The crate load out is 100% random each and every time... see the header of the file on how to set it up for you mission.

Search all your mission files for 'fn_refillbox' and replace that line.

Example,

Change...
Code: [Select]
[_box1, "mission_USSpecial"] call fn_refillbox;
...To...
Code: [Select]
_box1 call randomCrateLoadOut;
...Within your mission sqf code structure.

The configuration of the script is fully editable within the top part of the script. You are able to add and remove items with ease (class list was pulled from the configuration of APEX), as well as adjust the minimum and maximum number of each class/item.

Any questions, let me know.

P.S. See this cross post should you need further explanation.

-soul.
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 588
  • Https://Fractured-Gaming.com

Re: randomCrateLoadOut

« Reply #1 posted: Oct 09, 2016, 03:08 PM »
Earlier, I tried doing the exact same thing and it just kept saying I was missing expressions... I just replaced fn_refillBox; with randomCrateLoadOut; and it worked...

On multiple missions it broke....
https://github.com/Fractured-Gaming-Official/Frac_v1.3.Stratis/blob/afbab4f4a36a935ed3057f24084b5032c01ad427/server/missions/moneyMissions/mission_altisPatrol.sqf#L168-L177
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!
  • Offline soulkobk
  • First Blood
  • ***
  • Posts: 99
  • soulkobk.blogspot.com.au

Re: randomCrateLoadOut

« Reply #2 posted: Oct 10, 2016, 07:05 AM »
@Mokey, you're still getting errors? As the code "_box1 call randomCrateLoadOut;" etc, is correct.

-soul.
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 588
  • Https://Fractured-Gaming.com

Re: randomCrateLoadOut

« Reply #3 posted: Oct 10, 2016, 09:15 AM »
Sorry I have had a bit of some personal issues. Will test later tonight to ensure.
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!

Re: randomCrateLoadOut

« Reply #4 posted: Jan 11, 2018, 04:15 PM »
My script/function replaces the standard 'fn_refillbox' function within mission scripts for crates that spawn at mission completion. *100% random loot within! Lots of gear? Bugger all gear? Luck of the draw! :D

You can see/grab it on the link below...

https://github.com/soulkobk/ArmA_Scripts/blob/master/randomCrateLoadOut/randomCrateLoadOut.sqf

PLEASE READ THE HEADER OF THE SCRIPT FOR INSTALL/CONFIGURATION INFORMATION

The crate load out is 100% random each and every time... see the header of the file on how to set it up for you mission.

Search all your mission files for 'fn_refillbox' and replace that line.

Example,

Change...
Code: [Select]
[_box1, "mission_USSpecial"] call fn_refillbox;
...To...
Code: [Select]
_box1 call randomCrateLoadOut;
...Within your mission sqf code structure.

The configuration of the script is fully editable within the top part of the script. You are able to add and remove items with ease (class list was pulled from the configuration of APEX), as well as adjust the minimum and maximum number of each class/item.

Any questions, let me know.

P.S. See this cross post should you need further explanation.

-soul.



I want to understand this configuration
have box coming 10 titan

Can you help me understand?

_overallLoopAmount = floor (round (random 8) + 2); // minimum 2, maximum 10

_backPackAmount = floor (round (random 3) + 3); // minimum 3, maximum 6
_binocularAmount = floor (round (random 5) + 2); // minimum 3, maximum 7
_bipodAmount = floor (round (random 3) + 2); // minimum 2, maximum 5
_headGearAmount = floor (round (random 3) + 5); // minimum 5, maximum 8
_itemAmount = floor (round (random 3) + 5); // minimum 5, maximum 8
_launcherAmount = floor (round (random 1) + 1); // minimum 1, maximum 1
_magazineAmount = floor (round (random 2) + 3); // minimum 2, maximum 5
_throwableAmount = floor (round (random 3) + 3); // minimum 3, maximum 6
_muzzleAmount = floor (round (random 2) + 2); // minimum 2, maximum 4
_opticAmount = floor (round (random 4) + 5); // minimum 5, maximum 9
_primaryWeaponAmount = floor (round (random 3) + 5); // minimum 5, maximum 8
_secondaryWeaponAmount = floor (round (random 1) + 2); // minimum 2, maximum 3
_uniformAmount = floor (round (random 3) + 4); // minimum 3, maximum 7
_vestAmount = floor (round (random 3) + 4); // minimum 3, maximum 7
_weaponAccessoryAmount = floor (round (random 2) + 3); // minimum 2, maximum 5
_minesAmount = floor (round (random 2) + 2); // minimum 2, maximum 4
_goggleAmount = floor (round (random 2) + 2); // minimum 2, maximum 4