Jump to content
Sign in to follow this  
kerozen

Add action menu help

Recommended Posts

Hello. I'm trying to create a Loadout Menu in a ammo crate. I tried searching for a way to do it but didn't find any information about that. What i pretend is something like this:

 

A - Loadouts

 

A1 - Woodland

a1.1 - Marksman

a1.2 - Medic

a1.3 - MachineGunner

a1.4 - Back

 

A2 - Desert

a2.1 - Marksman

a2.2 - Medic

a2.3 - MachineGunner

a2.4 - back

 

B - Back

 

Is is just simple addactions and removeactions? Should i use scripts or use the INIT? (its for a co-op mission)

Share this post


Link to post
Share on other sites

initPlayerLocal.sqf (Inside your mission root)

kerozen_ammobox addAction ["Loadout1","loadouts\loadout1.sqf"]; //kerozen_ammobox is the variable name of your ammo box

loadout1.sqf (Located in a folder called "loadouts" inside your mission folder

comment "Remove existing items";
removeAllWeapons player;
removeAllItems player;
removeAllAssignedItems player;
removeUniform player;
removeVest player;
removeBackpack player;
removeHeadgear player;
removeGoggles player;

comment "Add containers";
player forceAddUniform "U_B_T_Soldier_F";
for "_i" from 1 to 2 do {player addItemToUniform "FirstAidKit";};
for "_i" from 1 to 3 do {player addItemToUniform "9Rnd_45ACP_Mag";};
player addVest "V_PlateCarrier1_tna_F";
for "_i" from 1 to 2 do {player addItemToVest "FirstAidKit";};
for "_i" from 1 to 9 do {player addItemToVest "30Rnd_556x45_Stanag";};
player addBackpack "B_AssaultPack_tna_F";
for "_i" from 1 to 14 do {player addItemToBackpack "1Rnd_HE_Grenade_shell";};
player addHeadgear "H_Booniehat_tna_F";

comment "Add weapons";
player addWeapon "arifle_SPAR_01_GL_blk_F";
player addPrimaryWeaponItem "acc_flashlight";
player addPrimaryWeaponItem "optic_Holosight_smg_blk_F";
player addWeapon "hgun_ACPC2_F";
player addWeapon "Rangefinder";

comment "Add items";
player linkItem "ItemMap";
player linkItem "ItemCompass";
player linkItem "ItemWatch";
player linkItem "ItemRadio";
player linkItem "ItemGPS";

comment "Set identity";
player setFace "WhiteHead_06";
player setSpeaker "Male02ENG";

Do this for all the loadouts you want to have the player access to. You can export your loadouts via the Arsenal by pressing CTRL + C

 

 

Edit: I just realized you want to have some sort of a structure. That's going to be more complicated, but can be achieved with addAction. There is even an example here on this page https://community.bistudio.com/wiki/addAction

 

Additionally, awesome guy larrow has created a menu system here

  • Like 1

Share this post


Link to post
Share on other sites

Thank you very much.

 

Also is there a way to change the player's class in the same script? I'm using VTS and the revive script only allows Medics to fully heal someone. If a player selects the medic loadout i would like to also change the player to the B_medic_F class. Is it possible?

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  

×