Jump to content
kdk11

Making AI Opfor all spawn with certain gear

Recommended Posts

Is it possible to make all Opfor AI in my mission spawn with certain loadouts? I know all about the virtual arsenal and how to use that, my problem is I use scripts to spawn in my AI so there is no physical unit on the map in the editor to edit. So I was just wondering if there is a script that will make every opfor that is spawned in/spawns in to my mission, have certain loadouts?

Share this post


Link to post
Share on other sites

Why you do not use your spawn unit script to define the unit gear?
 
for eg:

private ["_unit", "_chief"];
_chief = _this select 1;
if (_chief != (leader group _chief)) exitWith {
hint "Only team leader can recruit team members!";
};
hint "Recruiting Medic";
_unit = group _chief createUnit ["B_medic_F", getPos _chief, [], 5, "PRIVATE"];
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
_unit forceAddUniform "rhs_uniform_cu_ucp";
for "_i" from 1 to 10 do {_unit addItemToUniform "ACE_fieldDressing";};
for "_i" from 1 to 3 do {_unit addItemToUniform "ACE_morphine";};
for "_i" from 1 to 3 do {_unit addItemToUniform "ACE_epinephrine";};
_unit addItemToUniform "ACE_NVG_Gen4";
_unit addVest "rhsusf_iotv_ucp_Medic";
for "_i" from 1 to 15 do {_unit addItemToVest "ACE_quikclot";};
for "_i" from 1 to 2 do {_unit addItemToVest "ACE_CableTie";};
_unit addItemToVest "rhsusf_acc_nt4_black";
for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_an_m8hc";};
for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_m18_red";};
for "_i" from 1 to 2 do {_unit addItemToVest "rhs_mag_m18_green";};
for "_i" from 1 to 8 do {_unit addItemToVest "rhs_mag_30Rnd_556x45_Mk318_Stanag";};
_unit addItemToVest "rhs_mag_m67";
_unit addBackpack "B_Carryall_mcamo";
for "_i" from 1 to 50 do {_unit addItemToBackpack "ACE_fieldDressing";};
for "_i" from 1 to 25 do {_unit addItemToBackpack "ACE_morphine";};
for "_i" from 1 to 25 do {_unit addItemToBackpack "ACE_epinephrine";};
for "_i" from 1 to 15 do {_unit addItemToBackpack "ACE_bloodIV";};
for "_i" from 1 to 15 do {_unit addItemToBackpack "ACE_quikclot";};
for "_i" from 1 to 2 do {_unit addItemToBackpack "ACE_bodyBag";};
_unit addItemToBackpack "ACE_personalAidKit";
_unit addHeadgear "rhsusf_ach_helmet_headset_ucp";
_unit addGoggles "G_Combat";
_unit addWeapon "rhs_weap_m16a4_carryhandle_grip_pmag";
_unit addPrimaryWeaponItem "rhsusf_acc_anpeq15A";
_unit addPrimaryWeaponItem "optic_Nightstalker";
_unit addPrimaryWeaponItem "bipod_01_F_blk";
_unit addWeapon "Laserdesignator";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ACE_Altimeter";
_unit linkItem "tf_anprc152_3";
_unit linkItem "ItemGPS";
_unit enableFatigue false;
hint "Medic joined your team";

You can use class config for each units as well:

class O_Soldier_SL_F {

		class EventHandlers {
			gear = "_this call gear.sqf";
		};
};

 

Share this post


Link to post
Share on other sites

I am using this - http://lostvar.com/AISSP/documentation.html

But I don't want every Opfor Soldier to be the same, I want them to have different clothing, weapons etc.

Also I don't see how the code you posted would help with what I want to do? I am not good with coding but looking at what you posted it seems thats to add a Medic and change his gear?.

Share this post


Link to post
Share on other sites

Yes it does. Anyway If you are  using the militarize script then it is easy because the code allow you to use custom init inside the array passed to the script.

nul = [target, side, radius, spawn men, spawn vehicles, still, men ratio, vehicle ratio, 
							skills, group, CUSTOM INIT, ID] execVM "LV\militarize.sqf";

Share this post


Link to post
Share on other sites
custom init =     "init commands" (if you want something in init field of units, put it here)

nul = [target, side, patrol, patrol type, spawn rate, radius, skills, group,
                                    custom init, ID] execVM "LV\fillHouse.sqf";

Then you need a script adding custom gear to each unit and called from the array

nul = [comp1,2,true,2,[10,0],10,"default",nil,"nul = [this] execVM 'opfor_custom_gear.sqf'",nil] execVM "LV\fillHouse.sqf";

opfor_custom_gear.sqf

if ((typeOf (_this select 0)) == "O_Soldier_SL_F") then  {

	code ...

	};

if ((typeOf (_this select 0)) == "O_Soldier_GL_F") then  {

	code ...

	};...

Share this post


Link to post
Share on other sites
comment "Exported from Arsenal by KDK";

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_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";

comment "Add weapons";
this addWeapon "caf_AK47";

comment "Add items";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";

comment "Set identity";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";
comment "Exported from Arsenal by KDK";

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_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";

comment "Add weapons";
this addWeapon "caf_ak74gl";

comment "Add items";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";

comment "Set identity";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

So how would I put this code into the "opfor_custom_gear.sqf"?. As it is our would I need to change it for it to work via a script?.

if ((typeOf this) == "O_Soldier_SL_F") then  {

comment "Exported from Arsenal by KDK";

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_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";

comment "Add weapons";
this addWeapon "caf_ak74gl";

comment "Add items";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";

comment "Set identity";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";
};

Share this post


Link to post
Share on other sites

You say you spawn soldiers.  I have a different solution.

 

Place the soldier on the edge of the island somewhere out of the way. Give him the uniform and the load out you wish.  Gove each soldier a name.

 

Place triggers on the map. When the trigger fires the soldier (or soldiers)  as (are)  moved to another place - ready to fight.

 

red1  setpos (getpos box1)

 

.

 

 

 

 

.

Share this post


Link to post
Share on other sites

So I have done what I think you told me to do.

This is my calling lines

 

nul = [comp1,2,false,2,[25,0],150,"default",nil,"nul = [this] execVM 'opfor_custom_gear.sqf'",nil] execVM "LV\fillHouse.sqf";

and then this is my 'opfor_custom_gear.sqf'

if ((typeOf this) == "O_Soldier_SL_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_Soldier_GL_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_Soldier_A_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AR_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_medic_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_engineer_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_exp_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_M_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AA_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AT_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_officer_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_repair_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_Soldier_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_LAT_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_Soldier_lite_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_Soldier_TL_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AAR_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AAA_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AAT_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_recon_exp_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_recon_JTAC_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_recon_M_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_recon_medic_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_recon_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_recon_LAT_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AAR_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AAA_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03a";
for "_i" from 1 to 2 do {this addItemToUniform "CAF_30Rnd_762x39_AK";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_762x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "HandGrenade";};
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_AK47";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

if ((typeOf this) == "O_soldier_AAT_F") then  {

removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
this forceAddUniform "U_CAF_AG_ME_ROBES_03d";
this addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {this addItemToUniform "1Rnd_HE_Grenade_shell";};
this addVest "V_BandollierB_blk";
this addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {this addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {this addItemToVest "SmokeShell";};
this addItemToVest "HandGrenade";
this addHeadgear "H_caf_ag_turban";
this addWeapon "caf_ak74gl";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
this setFace "PersianHead_A3_02";
this setSpeaker "ACE_NoVoice";

};

But for some reason it does not change the uniform they are wearing, I looked in the AI spawn script pack scripts and took all the classnames for soldiers used in the script to make sure I covered them all. Am I doing something wrong?.

Share this post


Link to post
Share on other sites

Sorry i can t test it the LV script is not working for me. Do you have a working one version?

19:56:03 Error in expression <
_menArray = _greenMenArray;
}; 
};

if(_center in allMapMarkers)then{
_center0 >
19:56:03   Error position: <_center in allMapMarkers)then{
_center0 >
19:56:03   Error Undefined Variable in Expression: _center
19:56:03 File LV\fillHouse.sqf, line 84

Anyway try to change "this" to (_this select 0) everywhere

Share this post


Link to post
Share on other sites

The script download actually comes with some working missions, however mine would mean you would need to download like 7 mods lol and I am sure you dont want to do that.
 

if ((typeOf _this select 0) == "O_soldier_AAT_F") then  {

removeAllWeapons _this select 0;
removeAllItems _this select 0;
removeAllAssignedItems _this select 0;
removeUniform _this select 0;
removeVest _this select 0;
removeBackpack _this select 0;
removeHeadgear _this select 0;
removeGoggles _this select 0;
_this select 0 forceAddUniform "U_CAF_AG_ME_ROBES_03d";
_this select 0 addItemToUniform "CAF_30Rnd_545x39_AK";
for "_i" from 1 to 2 do {_this select 0 addItemToUniform "1Rnd_HE_Grenade_shell";};
_this select 0 addVest "V_BandollierB_blk";
_this select 0 addItemToVest "ACE_Banana";
for "_i" from 1 to 5 do {_this select 0 addItemToVest "CAF_30Rnd_545x39_AK";};
for "_i" from 1 to 2 do {_this select 0 addItemToVest "SmokeShell";};
_this select 0 addItemToVest "HandGrenade";
_this select 0 addHeadgear "H_caf_ag_turban";
_this select 0 addWeapon "caf_ak74gl";
_this select 0 linkItem "ItemMap";
_this select 0 linkItem "ItemCompass";
_this select 0 linkItem "ItemWatch";
_this select 0 linkItem "ItemRadio";
_this select 0 setFace "PersianHead_A3_02";
_this select 0 setSpeaker "ACE_NoVoice";

};

Like so?
 

if ((typeOf this) == "O_soldier_AAT_F") then  {
if ((typeOf _this select 0) == "O_soldier_AAT_F") then  {

Tried with no luck. I seen this post on the actual thread for the scripts
 

Corporal

  • photo-759407.jpg?_r=0
  • Members
  • 71 posts

Posted 30 September 2013 - 04:51

@DoRo,
I'm using dev build so I didnt get that mission open in editor, but looked in sqm and spotted
""nul = [this] execVM 'RPKsoldier.sqf'""as custom init in first fillHouse calling line. I think here's extra " " on it (but it might be just becouse I'm looking at it in text editor) and semicolon missing, so try:
"nul = [this] execVM 'RPKsoldier.sqf';"Otherwise it looks ok to me. :)

Edited by spunFIN, 30 September 2013 - 05:01.

#38 icon_share.png DoRo

Staff Sergeant

  • 92334f7bedfba1b8404ace3429a69044?s=100&d
  • Members
  • 240 posts

Posted 30 September 2013 - 05:12

spunFIN said

@DoRo,
I'm using dev build so I didnt get that mission open in editor, but looked in sqm and spotted

""nul = [this] execVM 'RPKsoldier.sqf'""as custom init in first fillHouse calling line. I think here's extra " " on it (but it might be just becouse I'm looking at it in text editor) and semicolon missing, so try:
"nul = [this] execVM 'RPKsoldier.sqf';"Otherwise it looks ok to me. :)

I'm also on DEV Build

But I made that change and now its working perfectly!

Thanks a ton for the tool!

But when I try and delete it out of my SQM it just comes back everytime I load the mission.

Share this post


Link to post
Share on other sites

I wrote (_this select 0) not _this select 0

 

ps:i have tons of mods.

 

give me a clue with mods and the server ip than we figure this out

Share this post


Link to post
Share on other sites

Oh ok my bad haha I shall try that now.

Mods used:

 

ACE 3 - http://www.armaholic.com/page.php?id=28557
Kunduz Afghanistan - http://www.armaholic.com/page.php?id=27882
British Army mod - http://www.armaholic.com/page.php?id=27917
CBA - http://www.armaholic.com/page.php?id=18767
CAF Aggressors - http://www.armaholic.com/page.php?id=24441
Ambient Battle sounds mod - http://www.armaholic.com/page.php?id=27976( I dont actually use this mod but for some reason I have to have it enabled otherwise it will not let me edit my mission)

There is no server IP though, I usually just host it from my machine. However I can send you the mission if you want to look at it :)


IT WORKS!!!!!!!!!! :D :D  Thank you my friend!!

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

×