Weapon helper - Global-Conflicts-ArmA/Olsen-Framework-Arma-3 GitHub Wiki
Description
The Weapon helper module allows mission makers to create a string of weapons, ammo, and attachments in their loadout file so the class/role will spawn with a random weapon in the string with the chosen amount of random mags and attachments.
Usage
- Weapon helper module is turned on by default so you don't need to edit the modules.sqf files.
- Go to modules>weapon_helper>settings.sqf
In the settings.sqf file, you have the ability to change the chance of a client spawning with one of the applicable attachments in the weapon string you'll create momentarily.
The number is a flat 0-100% from 0 to 1.
GVAR(opticChance_west) = 1;
GVAR(muzzleChance_west) = 1;
GVAR(pointerChance_west) = 1;
GVAR(bipodChance_west) = 1;
To make your client spawn with the random weapon, you must now add the following to your package/role/class in your .sqf loadout file you created.
[_unit, ["rhs_weap_ak74mr","rhs_weap_ak74m_zenitco01","rhs_acc_1p63","rhs_acc_perst3","rhs_acc_dtk3","rhs_acc_grip_rk6","rhs_30Rnd_545x39_7N22_AK"], "vest", 8] call EFUNC(WEPHELP,addWeapon);
This line of code will contains 2x AK74s at the start, followed by various attachments (of which the % of spawning on the weapon is determined in the settings.sqf file), with 30rnd 5.45x39 mags at the end, it is also defined to spawn in the vest by "vest"
(choose between uniform
,vest
,backpack
), and finally the number is the quantity of mags to spawn.
So in theory, my rifleman (RF) class below in the image will spawn with either one of the two AKs, 1 of each type of attachment if the dice land on the roll based on the % chance, and 8 magazines in their vest.