Jump to content
geezer

Custom loadout grenades acting wierd

Recommended Posts

So im using custom loadouts in the init lines of each individual soldier (i know its not ideal).

 

when i run the mission in multiplayer everything is fine except for the 2 hand grenades... they show in my inventory but are not selectable or throwable (they dont show in my hud) same for all my squad.

 

Now if i take 1 grenade from a crate i suddenly have 3  grenades, they show in my hud, are throwable and strangely my whole squad now has 3 grenades.

 

Any ideas as to whats going on here?

 

Thanks, Geezer

Share this post


Link to post
Share on other sites

(group this) setGroupId ["Assault squad Alpha"]; this setVariable ["NOAI",1,false]; removeallweapons unit1;  removeallassigneditems unit1;  removeBackpack unit1;  removeVest unit1;  removeUniform unit1;  removeGoggles unit1;    unit1 addWeapon "ItemMap";  unit1 addWeapon "ItemWatch";  unit1 addWeapon "ItemCompass";  unit1 addWeapon "ItemGPS";  unit1 addWeapon "NVGoggles_INDEP";  unit1 addWeapon "Binocular";    unit1 addBackpack "B_TacticalPack_blk";  (backpackContainer unit1) addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag_Tracer",1];  (backpackContainer unit1) addmagazinecargoGlobal ["3Rnd_HE_Grenade_shell",1];  unit1 addWeapon "arifle_MX_GL_F";  removeBackpack unit1;    unit1 addPrimaryWeaponItem "acc_pointer_IR";  unit1 addPrimaryWeaponItem "muzzle_snds_H";  unit1 addPrimaryWeaponItem "optic_Hamr";    unit1 addBackpack "B_TacticalPack_blk";    removeBackpack unit1;    unit1 addBackpack "B_TacticalPack_blk";  (backpackContainer unit1) addmagazinecargoGlobal ["16Rnd_9x21_Mag",2];  unit1 addWeapon "hgun_P07_snds_F";  removeBackpack unit1;    unit1 addBackpack "B_AssaultPack_rgr";  clearItemCargoGlobal (backpackContainer unit1);  clearMagazineCargoGlobal (backpackContainer unit1);  clearWeaponCargoGlobal (backpackContainer unit1);    unit1 addVest "V_PlateCarrierGL_rgr";  clearItemCargoGlobal (vestContainer unit1);  clearMagazineCargoGlobal (vestContainer unit1);  clearWeaponCargoGlobal (vestContainer unit1);    (vestContainer unit1) addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag",5];  (vestContainer unit1) addmagazinecargoGlobal ["1Rnd_SmokeGreen_Grenade_shell",1];  (vestContainer unit1) addmagazinecargoGlobal ["16Rnd_9x21_Mag",2];  (vestContainer unit1) addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag_Tracer",4];  (vestContainer unit1) addmagazinecargoGlobal ["1Rnd_SmokeRed_Grenade_shell",1];  (vestContainer unit1) addmagazinecargoGlobal ["3Rnd_HE_Grenade_shell",2];    unit1 forceAddUniform "U_B_CombatUniform_mcam_tshirt";  clearItemCargoGlobal (uniformContainer unit1);  clearMagazineCargoGlobal (uniformContainer unit1);  clearWeaponCargoGlobal (uniformContainer unit1);    (uniformContainer unit1) additemcargoGlobal ["FirstAidKit",1];  unit1 addItemToUniform "HandGrenade";  unit1 addItemToUniform "HandGrenade";  unit1 addItemToUniform "Chemlight_green";  unit1 addItemToUniform "Chemlight_green";  unit1 addItemToUniform "SmokeShell";  unit1 addItemToUniform "SmokeShell";  unit1 addWeapon "ItemRadio";  unit1 selectWeapon (primaryWeapon unit1); (backpackContainer unit1) addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag_Tracer",0];  (backpackContainer unit1) additemcargoGlobal ["FirstAidKit",0];

Share this post


Link to post
Share on other sites
(group this) setGroupId ["Assault squad Alpha"];
this setVariable ["NOAI",1,false];
removeallweapons unit1;
removeallassigneditems unit1;
removeBackpack unit1;
removeVest unit1;
removeUniform unit1;
removeGoggles unit1;
unit1 addWeapon "ItemMap";
unit1 addWeapon "ItemWatch";
unit1 addWeapon "ItemCompass";
unit1 addWeapon "ItemGPS";
unit1 addWeapon "NVGoggles_INDEP";
unit1 addWeapon "Binocular";
unit1 addBackpack "B_TacticalPack_blk";
(backpackContainer unit1) addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag_Tracer",1];
(backpackContainer unit1) addmagazinecargoGlobal ["3Rnd_HE_Grenade_shell",1];
unit1 addWeapon "arifle_MX_GL_F";
removeBackpack unit1;
unit1 addPrimaryWeaponItem "acc_pointer_IR";
unit1 addPrimaryWeaponItem "muzzle_snds_H";
unit1 addPrimaryWeaponItem "optic_Hamr";
unit1 addBackpack "B_TacticalPack_blk";
removeBackpack unit1;
unit1 addBackpack "B_TacticalPack_blk";
(backpackContainer unit1) addmagazinecargoGlobal ["16Rnd_9x21_Mag",2];
unit1 addWeapon "hgun_P07_snds_F";
removeBackpack unit1;
unit1 addBackpack "B_AssaultPack_rgr";
clearItemCargoGlobal (backpackContainer unit1);
clearMagazineCargoGlobal (backpackContainer unit1);
clearWeaponCargoGlobal (backpackContainer unit1);
unit1 addVest "V_PlateCarrierGL_rgr";
clearItemCargoGlobal (vestContainer unit1);
clearMagazineCargoGlobal (vestContainer unit1);
clearWeaponCargoGlobal (vestContainer unit1);
(vestContainer unit1) addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag",5];
(vestContainer unit1) addmagazinecargoGlobal ["1Rnd_SmokeGreen_Grenade_shell",1];
(vestContainer unit1) addmagazinecargoGlobal ["16Rnd_9x21_Mag",2];
(vestContainer unit1) addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag_Tracer",4];
(vestContainer unit1) addmagazinecargoGlobal ["1Rnd_SmokeRed_Grenade_shell",1];
(vestContainer unit1) addmagazinecargoGlobal ["3Rnd_HE_Grenade_shell",2];
unit1 forceAddUniform "U_B_CombatUniform_mcam_tshirt";
clearItemCargoGlobal (uniformContainer unit1);
clearMagazineCargoGlobal (uniformContainer unit1);
clearWeaponCargoGlobal (uniformContainer unit1);
(uniformContainer unit1) additemcargoGlobal ["FirstAidKit",1];
unit1 addItemToUniform "HandGrenade";
unit1 addItemToUniform "HandGrenade";
unit1 addItemToUniform "Chemlight_green";
unit1 addItemToUniform "Chemlight_green";
unit1 addItemToUniform "SmokeShell";
unit1 addItemToUniform "SmokeShell";
unit1 addWeapon "ItemRadio";
unit1 selectWeapon (primaryWeapon unit1);
(backpackContainer unit1) addmagazinecargoGlobal ["30Rnd_65x39_caseless_mag_Tracer",0];
(backpackContainer unit1) additemcargoGlobal ["FirstAidKit",0];

And this is code from unit init field?.

Share this post


Link to post
Share on other sites

Dont use init field in MP, especially for complicated gear loadouts, it is not not ideal, it is not recommended, period.

Share this post


Link to post
Share on other sites

yeah im kinda new to all this... i guess i should script it?

 

Yes thats my unit Init :unsure:

Share this post


Link to post
Share on other sites

If you gonna use init for MP, start it with:

if (!local this) exitWith {};

Then change every command that has xxxxGlobal variant, to that global variant, like for example, addWeapon has addWeaponGlobal, so use that. BIKI is your friend https://community.bistudio.com/wiki/Category:Scripting_Commands Of course this is really really bad hack, but it is better that nothing. Otherwise read up on locality and how to use CfgFunctions or various init scripts.

Share this post


Link to post
Share on other sites

Davidoss how did you get my init post to format like that?

Share this post


Link to post
Share on other sites

So for anyone interested i finally found this bit of code you can drop in to your group leaders ini

blue1 = group this; {[blue1, (_x select 1)] setWaypointVisible false; } foreach waypoints blue1;

It will cause  no waypoints will show up in SP or MP.

 

repeat for each group changing the group name eg blue2, blue3 etc

 

Thanks to all for your help :)

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

×