Christenson, Viktor 0 Posted May 4, 2017 Hi all! I have been trying to set a script where you select an "Addaction" in a sign, then you recive a loadout. This is what I have so far. (it is not working) I have a sign with this init: this addAction ["Loadout 1", "Loadout1.sqf"]; Then I have an SQF in my mission file called Loadout1. and in that file, I have the loadout export from the "Armory" I have no idea if this is right Thanks in advance -Victor Share this post Link to post Share on other sites
Midnighters 152 Posted May 4, 2017 you mean the virtual arsenal? press ctrl + c to copy the loadout setup. It'll be formatted in commands. make sure to pass the player variable to the action this addAction["Loadout 1","Loadout1.sqf",[(_this select 1)]; then in the pasted script from the VA you'll notice it all just says "this" instead of your player, so make sure you're selecting the player instead of the box. 1 Share this post Link to post Share on other sites
Christenson, Viktor 0 Posted May 4, 2017 Thanks for your reply Midnighters. this addAction["Loadout 1","Loadout1.sqf",[(_this select 1)]; It didn't work :( Here is some screenshots of what i got so far The sign i need to give the loadout https://gyazo.com/3d9fb955dec03988c3b00adcac415794 The error i get when i punch in the code you wrote https://gyazo.com/63eaebba6a5b8c4c614df21b2cad3756 The Loadout1.SQF https://gyazo.com/2f400a4d6b78f6056a37ab0acf5bff3a -Viktor Share this post Link to post Share on other sites
Midnighters 152 Posted May 4, 2017 47 minutes ago, Christenson, Viktor said: Thanks for your reply Midnighters. this addAction["Loadout 1","Loadout1.sqf",[(_this select 1)]; It didn't work :( Here is some screenshots of what i got so far The sign i need to give the loadout https://gyazo.com/3d9fb955dec03988c3b00adcac415794 The error i get when i punch in the code you wrote https://gyazo.com/63eaebba6a5b8c4c614df21b2cad3756 The Loadout1.SQF https://gyazo.com/2f400a4d6b78f6056a37ab0acf5bff3a -Viktor Yep you need to add a ending bracket, didnt look that one over very well. Make sure to replace "this" with (_this select 0) in the script Share this post Link to post Share on other sites
Christenson, Viktor 0 Posted May 7, 2017 On 4/5/2017 at 10:48 PM, Midnighters said: Yep you need to add a ending bracket, didnt look that one over very well. Make sure to replace "this" with (_this select 0) in the script 3 Still not working :( (_this select 0) addAction["Loadout 1","Loadout1.sqf"]; [(_this select 1)]; It gives me a message saying: Init: Local variable in global spacer @Midnighters Share this post Link to post Share on other sites
beno_83au 1369 Posted May 7, 2017 I think what he meant was to replace this with _this select 0 within your loadout1.sqf, so your addAction code should still look like this addAction [.......]; Share this post Link to post Share on other sites
pierremgi 4889 Posted May 7, 2017 this addAction ["Loadout 1", {(_this select 1) execVM "Loadout1.sqf"},nil,10,false,true,"", "_this distanceSqr _target < 9"]; in your loadout.sqf, you need to: - replace all this but _this; - make some commands global. I don't know why BI makes an arsenal consistent in MP, but fails to export something working in MP... addWeaponGlobal, addBackpackGlobal, remoteExec setSpeaker and setFace. Here is my example: Spoiler comment "Exported from Arsenal by Kobayashi Maru"; comment "Remove existing items"; removeAllWeapons _this; removeAllItems _this; removeAllAssignedItems _this; removeUniform _this; removeVest _this; removeBackpack _this; removeHeadgear _this; removeGoggles _this; comment "Add containers"; _this forceAddUniform "U_B_CTRG_3"; _this addItemToUniform "FirstAidKit"; for "_i" from 1 to 4 do {_this addItemToUniform "11Rnd_45ACP_Mag";}; _this addItemToUniform "SmokeShellBlue"; _this addVest "V_TacVestIR_blk"; for "_i" from 1 to 3 do {_this addItemToVest "FirstAidKit";}; _this addItemToVest "optic_Arco"; for "_i" from 1 to 3 do {_this addItemToVest "HandGrenade";}; for "_i" from 1 to 2 do {_this addItemToVest "11Rnd_45ACP_Mag";}; for "_i" from 1 to 6 do {_this addItemToVest "1Rnd_HE_Grenade_shell";}; _this addBackpackGlobal "B_Carryall_oucamo"; for "_i" from 1 to 2 do {_this addItemToBackpack "ClaymoreDirectionalMine_Remote_Mag";}; for "_i" from 1 to 2 do {_this addItemToBackpack "DemoCharge_Remote_Mag";}; for "_i" from 1 to 5 do {_this addItemToBackpack "30Rnd_65x39_caseless_green";}; _this addItemToBackpack "Titan_AT"; _this addItemToBackpack "Titan_AP"; _this addHeadgear "H_Cap_usblack"; _this addGoggles "G_Tactical_Black"; comment "Add weapons"; _this addWeaponGlobal "arifle_Katiba_GL_F"; _this addPrimaryWeaponItem "optic_tws"; _this addWeaponGlobal "launch_I_Titan_short_F"; _this addWeaponGlobal "hgun_Pistol_heavy_01_F"; _this addHandgunItem "muzzle_snds_acp"; _this addHandgunItem "optic_MRD"; _this addWeaponGlobal "Laserdesignator"; comment "Add items"; _this linkItem "ItemMap"; _this linkItem "ItemCompass"; _this linkItem "ItemWatch"; _this linkItem "ItemRadio"; _this linkItem "NVGoggles"; comment "Set identity"; [_this, "WhiteHead_01"] remoteExec ["setFace"]; [_this, "male11eng"] remoteExec ["setSpeaker"]; 1 Share this post Link to post Share on other sites