adios113 11 Posted May 16, 2015 (edited) Hello fellow Arma 3 players, scripters, mission makers. Im trying to understand the complex language bohemia created to make missions for my community on a dedicated server. From time, to time im experiencing some issues and with your help i've managed to overpass them. Currently im having a new issue which is: Custom Player Loadouts - I got 12 unique loadouts (12 .sqf files in a seperate folder) - some of the units are using the same loadouts (for example Squad Leader/Fire Team Leader) - I execute the loadouts by placing this command in the unit init field: {_x moveInCargo unit1} foreach units group this; nop = [this] execVM "loadouts\squad_leader.sqf"; -squad_leader.sqf : //////////////////////////////////////////////////////////////////// Function file for Armed Assault // Created by: [bW-INT] Adi ////////////////////////////////////////////////////////////////// _unit = _this select 0; if (!local _unit) exitWith {}; removeAllWeapons _unit; removeAllItems _unit; removeAllAssignedItems _unit; removeUniform _unit; removeVest _unit; removeBackpack _unit; removeHeadgear _unit; removeGoggles _unit; _unit forceAddUniform "U_mas_mar_B_CombatUniform_des"; _unit addItemToUniform "AGM_EarBuds"; _unit addVest "V_mas_mar_PlateCarrierGL_rgr_d"; _unit addItemToVest "AGM_MapTools"; for "_i" from 1 to 4 do {_unit addItemToVest "AGM_CableTie";}; _unit addItemToVest "AGM_IR_Strobe_Item"; _unit addItemToVest "B_IR_Grenade"; for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_m67";}; for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_m18_green";}; for "_i" from 1 to 2 do {_unit addItemToVest "SmokeShell";}; for "_i" from 1 to 2 do {_unit addItemToVest "Chemlight_green";}; for "_i" from 1 to 3 do {_unit addItemToVest "RH_15Rnd_9x19_M9";}; for "_i" from 1 to 10 do {_unit addItemToVest "1Rnd_HE_Grenade_shell";}; for "_i" from 1 to 2 do {_unit addItemToVest "1Rnd_Smoke_Grenade_shell";}; _unit addItemToVest "1Rnd_SmokeGreen_Grenade_shell"; _unit addItemToVest "1Rnd_SmokeRed_Grenade_shell"; for "_i" from 1 to 5 do {_unit addItemToVest "30Rnd_556x45_Stanag";}; for "_i" from 1 to 2 do {_unit addItemToVest "30Rnd_556x45_Stanag_Tracer_Red";}; _unit addBackpack "B_Kitbag_cbr"; for "_i" from 1 to 8 do {_unit addItemToBackpack "AGM_Bandage";}; for "_i" from 1 to 2 do {_unit addItemToBackpack "AGM_Morphine";}; for "_i" from 1 to 2 do {_unit addItemToBackpack "AGM_Epipen";}; _unit addItemToBackpack "RH_fa556_tg"; _unit addItemToBackpack "RH_peq15"; _unit addHeadgear "H_mas_mar_helmetd_us"; _unit addWeapon "RH_m4a1_ris_m203_des"; _unit addPrimaryWeaponItem "RH_compM2_tan"; _unit addWeapon "RH_m9"; _unit addWeapon "Rangefinder_mas_h"; _unit linkItem "ItemMap"; _unit linkItem "ItemCompass"; _unit linkItem "ItemWatch"; _unit linkItem "tf_anprc152_3"; _unit linkItem "ItemGPS"; _unit linkItem "NVGoggles_mas_h"; [_unit,"doyouevenlift"] call bis_fnc_setUnitInsignia; Everytime i test the mission on the dedicated server, there's always couple of units which spawn with default editor placed loadout, or only with a weapon and empty vest,uniform,backpack. I looked into dozens of threads over here, tried multiple ways but either it was not enough, or didnt work at all. If you can help me solve this issue, I will be grateful. Edited May 16, 2015 by adios113 Share this post Link to post Share on other sites
killzone_kid 1329 Posted May 16, 2015 All I can think of is that unit changes locality before your script is finished or even started Try [this] call compile preprocessFile "loadouts\squad_leader.sqf"; {_x moveInCargo unit1} foreach units group this; ---------- Post added at 14:36 ---------- Previous post was at 14:35 ---------- SP or MP? Player custom loadout on a dedicated server issue. ^^^^^^ Share this post Link to post Share on other sites
jshock 513 Posted May 16, 2015 Well I'm sure someone can play a singleplayer mission on a dedicated server.... If it is MP, another option is to use the initPlayerLocal.sqf and execute a switch statement based on the unit the player chose, then execute the desired loadout for that unit. Share this post Link to post Share on other sites
adios113 11 Posted May 16, 2015 All I can think of is that unit changes locality before your script is finished or even startedTry I LOVE YOU MAN! Thank You! It worked perfectly. Everything loads up properly now. Love your work in the arma scene and I learned a lot from your blog - keep it up! Thank you JShock aswel, your way would probably work aswel, but I dont have the knowledge yet to execute it. I have to say, the scripting in Arma is very complicated, additionaly it is a lot harder for me, since thats the first language im learning, but I like it and its very addictive. Share this post Link to post Share on other sites