Jump to content
FenixDK

addItem stopped working after the last update

Recommended Posts

Hi guys,

 

Does anyone else experience an issue after the last update where addItem, addItemToUniform, and addItemToVest stopped working?

 

I have a fairly simle script to replace the standard gear of AI units that are spawned prior and during the mission, and it suddenly stopped adding items to uniform and vests. The uniform, vests, and helmets items are being replaced, but no items are added in the vests and uniform themselves.

 

So the description.ext is:

class Extended_InitPost_EventHandlers {
    class rhs_msv_emr_aa {
                     class Gear_init_eh {
                                          init = "_this call (compile preprocessFileLineNumbers 'scripts\opfor_cloth_rifleman.sqf')";
                                         };
                    };
};

and the opfor_cloth_rifleman.sqf is:

params ["_unit"];

_unit addVest selectrandom ["rhs_6b5","rhs_6b23_digi_6sh92","rhs_6b23_6sh116","rhs_6b3"];
_unit forceAddUniform selectrandom ["rhs_uniform_gorka_1_a","rhs_uniform_vkpo","rhs_uniform_vkpo_alt","rhs_uniform_vkpo_gloves","rhs_uniform_vkpo_gloves_alt","rhs_uniform_gorka_r_y","rhs_uniform_gorka_r_y_gloves",
"rhs_uniform_gorka_r_g","rhs_uniform_gorka_r_g_gloves","rhs_uniform_emr_patchless","rhs_uniform_vdv_emr"];
_unit addHeadgear selectrandom ["rhs_beanie_green","rhs_ssh68_2","rhs_ssh60","rhs_stsh81","rhs_fieldcap_digi","rhs_6b7_1m_ess_bala","rhs_6b7_1m_ess","rhs_6b7_1m_emr_ess_bala","rhs_6b7_1m_emr_ess",
"rhs_6b7_1m_bala1_olive","rhs_6b7_1m_bala2_olive","rhs_6b7_1m_olive","rhs_6b7_1m_bala2","rhs_6b7_1m_bala1","rhs_6b7_1m_bala2_emr","rhs_6b7_1m_bala1_emr","rhs_6b7_1m_emr","rhs_6b7_1m",
"rhs_6b47_ess_bala","rhs_6b47_ess","rhs_6b47_6B50","rhs_6b47_emr_1","rhs_6b47_emr","rhs_6b47_emr_2","rhs_6b47_bala","rhs_6b47_6m2","rhs_6b47_6m2_1","rhs_6b47","rhs_6b47_bare","rhs_6b28_ess_bala",
"rhs_6b28_ess","rhs_6b28_bala","rhs_6b28","rhs_6b28_green_ess_bala","rhs_6b28_green_ess","rhs_6b28_green_bala","rhs_6b28_green","rhs_6b27m_digi_ess_bala","rhs_6b27m_digi_ess","rhs_6b27m_digi_bala",
"rhs_6b27m_digi","rhs_6b27m_green_ess_bala","rhs_6b27m_green_ess","rhs_6b27m_green_bala","rhs_6b27m_green","rhs_6b26_digi_ess_bala","rhs_6b26_digi_ess","rhs_6b26_digi_bala","rhs_6b26_digi",
"rhs_6b26_ess_bala_green","rhs_6b26_ess_green","rhs_6b26_bala_green","rhs_6b26_green"];

for "_i" from 1 to 2 do {_unit addItemToUniform "rhs_mag_rdg2_white";};
for "_i" from 1 to 1 do {_unit addItemToUniform "rhs_30Rnd_545x39_7N10_AK";};
for "_i" from 1 to selectrandom [1,2] do {_unit addItemToVest "greenmag_ammo_545x39_basic_30Rnd";};
for "_i" from 1 to 6 do {_unit addItemToVest "rhs_30Rnd_545x39_7N10_AK";};
for "_i" from 1 to selectrandom [1,2] do {_unit addItemToVest "rhs_mag_rgd5";};
for "_i" from 1 to selectrandom [0,0,0,1] do {_unit addItemToUniform "MCC_firstAidKit";};
removeAllAssignedItems _unit;
for "_i" from 1 to 1 do {_unit removeItem "rhs_1PN138";};
for "_i" from 1 to 1 do {_unit removeItem "ACRE_PRC343";};

Everything was working fine before the last update, nothing was changed in the mission itself. Anyone else has the same issue, or maybe have ideas what is wrong?

Share this post


Link to post
Share on other sites

Solved by adding

params ["_unit"];

if (!local _unit) exitWith {};

to the opfor_cloth_rifleman.sqf

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

×