Jump to content

Re-Worked WAI 0.173 - Supported System


Recommended Posts

i have a small question...  can i just change the  clean running missions setting to true for the vehicles to not save to the database?  I love the system but dont like running around everyday deleting these excess vehicles.   Just my personal preference for my server.  Thanks in advance for any help.

 

In my scripts I do not publish the vehicle to the database until the survivors win the mission.

 

So you create an armed vehicle:

//Armed Land Vehicle
_veh = createVehicle [_vehclass,[(_position select 0)+10,(_position select 1) + 10,0], [], 0, "CAN_COLLIDE"];
_vehdir = round(random 360);
_veh setDir _vehdir;
_veh setVariable ["ObjectID","1",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh];
diag_log format["WAI: Mission Armed Vehicle spawned a %1",_vehname];

Then when the mission is finished you'd call server_publishVeh on that vehicle. After restart, mission vehicles that are not published into the database will be gone

if (_playerPresent) then {
	[_veh,[_vehdir,_objPosition],_vehclass,true,"0"] call server_publishVeh;
	waitUntil
	{
Link to comment
Share on other sites

I also distinguish bots wearing different skins. For example, if you come to a Civil Chopper mission where a bunch of farmers are running around with guns, you are actually killing innocent people and so you will gain -50 humanity. For killing bots wearing a military uniform you gain +50 humanity.

This helps folks on my server maintain Hero/Bandit status without any PvP involved.

The check is added in WAI\compiled\ai_killed.sqf by checking on unit object _type (skin),

private ["_unit","_player","_humanity","_banditkills","_aiskin","_add_humanity_var","_goodskintest","_badskintest"];
_unit = _this select 0;
_player = _this select 1;
_type = _this select 2;

switch (_type) do {
	case "ground" : {ai_ground_units = (ai_ground_units -1);};
	case "air" : {ai_air_units = (ai_air_units -1);};
	case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
	case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};
};

_unit setVariable ["killedat", time];
_aiskin = typeOf _unit;

if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	_humanity = _player getVariable["humanity",0];
	_banditkills = _player getVariable["banditKills",0];
	if (ai_humanity_gain) then {
		if(_aiskin in ["RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","Functionary1_EP1_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","FR_OHara_DZ","Priest_DZ","FR_Rodriguez_DZ","Villager1","Doctor","gsc_scientist1"] ) then
		{
			diag_log format["WAI: Good Guy was killed, Humanity Lost %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity - ai_add_humanity),true];
		};
		if(_aiskin in ["Bandit1_DZ","BanditW1_DZ","BanditW2_DZ","Camo1_DZ","Sniper1_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_2_DZ","Ins_Soldier_GL_DZ","GUE_Commander_DZ","TK_INS_Warlord_EP1_DZ","TK_INS_Soldier_EP1_DZ","Soldier_Sniper_PMC_DZ","Soldier_TL_PMC_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","Bandit2_DZ","gsc_eco_stalker_mask_duty","gsc_military_helmet_wdl","gsc_military_helmet_grey_AT","gsc_military_head_grey","gsc_eco_stalker_head_fred","gsc_eco_stalker_head_camo1"] ) then
		{
			diag_log format["WAI: Bad Guy was Killed, Humanity Added %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity + ai_add_humanity),true];
		};
	};
	if (ai_banditkills_gain) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	if (ai_clear_body) then {
		{_unit removeMagazine _x;} forEach (magazines _unit);
		{_unit removeWeapon _x;} forEach (weapons _unit);
	};
	if (ai_ahare_info) then {
		{if (((position _x) distance (position _unit)) <= ai_share_distance) then {_x reveal [_player, 4.0];}} forEach allUnits;
	};
};
Link to comment
Share on other sites

 

I also distinguish bots wearing different skins. For example, if you come to a Civil Chopper mission where a bunch of farmers are running around with guns, you are actually killing innocent people and so you will gain -50 humanity. For killing bots wearing a military uniform you gain +50 humanity.

This helps folks on my server maintain Hero/Bandit status without any PvP involved.

The check is added in WAI\compiled\ai_killed.sqf by checking on unit object _type (skin),

private ["_unit","_player","_humanity","_banditkills","_aiskin","_add_humanity_var","_goodskintest","_badskintest"];
_unit = _this select 0;
_player = _this select 1;
_type = _this select 2;

switch (_type) do {
	case "ground" : {ai_ground_units = (ai_ground_units -1);};
	case "air" : {ai_air_units = (ai_air_units -1);};
	case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
	case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};
};

_unit setVariable ["killedat", time];
_aiskin = typeOf _unit;

if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	_humanity = _player getVariable["humanity",0];
	_banditkills = _player getVariable["banditKills",0];
	if (ai_humanity_gain) then {
		if(_aiskin in ["RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","Functionary1_EP1_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","FR_OHara_DZ","Priest_DZ","FR_Rodriguez_DZ","Villager1","Doctor","gsc_scientist1"] ) then
		{
			diag_log format["WAI: Good Guy was killed, Humanity Lost %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity - ai_add_humanity),true];
		};
		if(_aiskin in ["Bandit1_DZ","BanditW1_DZ","BanditW2_DZ","Camo1_DZ","Sniper1_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_2_DZ","Ins_Soldier_GL_DZ","GUE_Commander_DZ","TK_INS_Warlord_EP1_DZ","TK_INS_Soldier_EP1_DZ","Soldier_Sniper_PMC_DZ","Soldier_TL_PMC_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","Bandit2_DZ","gsc_eco_stalker_mask_duty","gsc_military_helmet_wdl","gsc_military_helmet_grey_AT","gsc_military_head_grey","gsc_eco_stalker_head_fred","gsc_eco_stalker_head_camo1"] ) then
		{
			diag_log format["WAI: Bad Guy was Killed, Humanity Added %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity + ai_add_humanity),true];
		};
	};
	if (ai_banditkills_gain) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	if (ai_clear_body) then {
		{_unit removeMagazine _x;} forEach (magazines _unit);
		{_unit removeWeapon _x;} forEach (weapons _unit);
	};
	if (ai_ahare_info) then {
		{if (((position _x) distance (position _unit)) <= ai_share_distance) then {_x reveal [_player, 4.0];}} forEach allUnits;
	};
};

 

how do i make it so that only 1 type of skin A.I spawns, so a civil heli mission wont have bandit skin a.i or a military heli wont have civil ai?

Link to comment
Share on other sites

how do i make it so that only 1 type of skin A.I spawns, so a civil heli mission wont have bandit skin a.i or a military heli wont have civil ai?

 

You specify that in the mission file when spawning the group. "Villager1" instead of "Random" gives you a group of "farmers"

[[_position select 0, _position select 1, 0],3,1,"Random",4,"","Villager1","Random",true] call spawn_group;
Link to comment
Share on other sites

 

You specify that in the mission file when spawning the group. "Villager1" instead of "Random" gives you a group of "farmers"

[[_position select 0, _position select 1, 0],3,1,"Random",4,"","Villager1","Random",true] call spawn_group;

but can i have different civilan clothes? or different bandit clothes in the same group? so its like "viilager1","villager2" and so on?

Link to comment
Share on other sites

are the random skins defined somewhere else? if so can i create another list called Bandits and then make a list of all the bandits? like what random does?

 

AIConfig.sqf defines an array called ai_skin

this array is used in WAI\compiled\SpawnGroup.sqf

	if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	} else {
		_aiskin = _skin
	};

I think you can easily define a new array called Bandits and send that into spawn_group (below). Just need to check for that value in the code above to pull from your custom array.

[[_position select 0, _position select 1, 0],3,1,"Random",4,"","Bandits","Random",true] call spawn_group;
Link to comment
Share on other sites

 

AIConfig.sqf defines an array called ai_skin

this array is used in WAI\compiled\SpawnGroup.sqf

	if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	} else {
		_aiskin = _skin
	};

I think you can easily define a new array called Bandits and send that into spawn_group (below). Just need to check for that value in the code above to pull from your custom array.

[[_position select 0, _position select 1, 0],3,1,"Random",4,"","Bandits","Random",true] call spawn_group;

can you help me with this? i dont have much experience in scripting.

Link to comment
Share on other sites

can you help me with this? i dont have much experience in scripting.

 

First, add these two arrays at the bottom of your AIconfig.sqf

/// Skins used when "Bandit"  ///
bandit_skin = [
"Bandit1_DZ",
"BanditW1_DZ",
"BanditW2_DZ",
"Camo1_DZ",
"Sniper1_DZ",
"CZ_Soldier_Sniper_EP1_DZ",
"Graves_Light_DZ",
"Bandit2_DZ"
];

/// Skins used when "GoodGuy" ///
goodguy_skin = [
"RU_Policeman_DZ",
"Pilot_EP1_DZ",
"Haris_Press_EP1_DZ",
"Functionary1_EP1_DZ",
"Rocker1_DZ",
"Rocker2_DZ",
"Rocker3_DZ",
"Rocker4_DZ",
"FR_OHara_DZ",
"FR_Rodriguez_DZ",
"Villager1",
"Villager2"
];

in WAI\compiled\SpawnGroup.sqf find this section

if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	} else {
		_aiskin = _skin
	};

and replace it with 

	_aiskin = _skin;
	if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	};
	if (_skin == "Bandits") then {
		_aiskin = bandit_skin call BIS_fnc_selectRandom;
	};
	if (_skin == "GoodGuys") then {
		_aiskin = goodguy_skin call BIS_fnc_selectRandom;
	};

Now when you spawn a group you can specify Bandits, GoodGuys or "" for random

Link to comment
Share on other sites

First, add these two arrays at the bottom of your AIconfig.sqf

/// Skins used when "Bandit"  ///
bandit_skin = [
"Bandit1_DZ",
"BanditW1_DZ",
"BanditW2_DZ",
"Camo1_DZ",
"Sniper1_DZ",
"CZ_Soldier_Sniper_EP1_DZ",
"Graves_Light_DZ",
"Bandit2_DZ"
];

/// Skins used when "GoodGuy" ///
goodguy_skin = [
"RU_Policeman_DZ",
"Pilot_EP1_DZ",
"Haris_Press_EP1_DZ",
"Functionary1_EP1_DZ",
"Rocker1_DZ",
"Rocker2_DZ",
"Rocker3_DZ",
"Rocker4_DZ",
"FR_OHara_DZ",
"FR_Rodriguez_DZ",
"Villager1",
"Villager2"
];

in WAI\compiled\SpawnGroup.sqf find this section

if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	} else {
		_aiskin = _skin
	};

and replace it with 

	_aiskin = _skin;
	if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	};
	if (_skin == "Bandits") then {
		_aiskin = bandit_skin call BIS_fnc_selectRandom;
	};
	if (_skin == "GoodGuys") then {
		_aiskin = goodguy_skin call BIS_fnc_selectRandom;
	};

Now when you spawn a group you can specify Bandits, GoodGuys or "" for random

then i can use your script below. so the skins that i added for bandit class will give players + humanity while the goodguy ones will give them - ?

private ["_unit","_player","_humanity","_banditkills","_aiskin","_add_humanity_var","_goodskintest","_badskintest"];
_unit = _this select 0;
_player = _this select 1;
_type = _this select 2;

switch (_type) do {
	case "ground" : {ai_ground_units = (ai_ground_units -1);};
	case "air" : {ai_air_units = (ai_air_units -1);};
	case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
	case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};
};

_unit setVariable ["killedat", time];
_aiskin = typeOf _unit;

if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	_humanity = _player getVariable["humanity",0];
	_banditkills = _player getVariable["banditKills",0];
	if (ai_humanity_gain) then {
		if(_aiskin in ["RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","Functionary1_EP1_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","FR_OHara_DZ","Priest_DZ","FR_Rodriguez_DZ","Villager1","Doctor","gsc_scientist1"] ) then
		{
			diag_log format["WAI: Good Guy was killed, Humanity Lost %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity - ai_add_humanity),true];
		};
		if(_aiskin in ["Bandit1_DZ","BanditW1_DZ","BanditW2_DZ","Camo1_DZ","Sniper1_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_2_DZ","Ins_Soldier_GL_DZ","GUE_Commander_DZ","TK_INS_Warlord_EP1_DZ","TK_INS_Soldier_EP1_DZ","Soldier_Sniper_PMC_DZ","Soldier_TL_PMC_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","Bandit2_DZ","gsc_eco_stalker_mask_duty","gsc_military_helmet_wdl","gsc_military_helmet_grey_AT","gsc_military_head_grey","gsc_eco_stalker_head_fred","gsc_eco_stalker_head_camo1"] ) then
		{
			diag_log format["WAI: Bad Guy was Killed, Humanity Added %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity + ai_add_humanity),true];
		};
	};
	if (ai_banditkills_gain) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	if (ai_clear_body) then {
		{_unit removeMagazine _x;} forEach (magazines _unit);
		{_unit removeWeapon _x;} forEach (weapons _unit);
	};
	if (ai_ahare_info) then {
		{if (((position _x) distance (position _unit)) <= ai_share_distance) then {_x reveal [_player, 4.0];}} forEach allUnits;
	};
};
Link to comment
Share on other sites

 

then i can use your script below. so the skins that i added for bandit class will give players + humanity while the goodguy ones will give them - ?

private ["_unit","_player","_humanity","_banditkills","_aiskin","_add_humanity_var","_goodskintest","_badskintest"];
_unit = _this select 0;
_player = _this select 1;
_type = _this select 2;

switch (_type) do {
	case "ground" : {ai_ground_units = (ai_ground_units -1);};
	case "air" : {ai_air_units = (ai_air_units -1);};
	case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
	case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};
};

_unit setVariable ["killedat", time];
_aiskin = typeOf _unit;

if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	_humanity = _player getVariable["humanity",0];
	_banditkills = _player getVariable["banditKills",0];
	if (ai_humanity_gain) then {
		if(_aiskin in ["RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","Functionary1_EP1_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","FR_OHara_DZ","Priest_DZ","FR_Rodriguez_DZ","Villager1","Doctor","gsc_scientist1"] ) then
		{
			diag_log format["WAI: Good Guy was killed, Humanity Lost %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity - ai_add_humanity),true];
		};
		if(_aiskin in ["Bandit1_DZ","BanditW1_DZ","BanditW2_DZ","Camo1_DZ","Sniper1_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_2_DZ","Ins_Soldier_GL_DZ","GUE_Commander_DZ","TK_INS_Warlord_EP1_DZ","TK_INS_Soldier_EP1_DZ","Soldier_Sniper_PMC_DZ","Soldier_TL_PMC_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","Bandit2_DZ","gsc_eco_stalker_mask_duty","gsc_military_helmet_wdl","gsc_military_helmet_grey_AT","gsc_military_head_grey","gsc_eco_stalker_head_fred","gsc_eco_stalker_head_camo1"] ) then
		{
			diag_log format["WAI: Bad Guy was Killed, Humanity Added %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity + ai_add_humanity),true];
		};
	};
	if (ai_banditkills_gain) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	if (ai_clear_body) then {
		{_unit removeMagazine _x;} forEach (magazines _unit);
		{_unit removeWeapon _x;} forEach (weapons _unit);
	};
	if (ai_ahare_info) then {
		{if (((position _x) distance (position _unit)) <= ai_share_distance) then {_x reveal [_player, 4.0];}} forEach allUnits;
	};
};

 

that's correct. you will notice that in my code I have all kinds of skins. many more then I added into the arrays for you. the ones I added in the arrays for you are legit Epoch skins. the other ones like "gsc_eco_stalker_head_fred" are from addons that we run on our server. It doesn't matter though. Because as long as your GoodGuys always wear one of these: "RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","Functionary1_EP1_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","FR_OHara_DZ","Priest_DZ","FR_Rodriguez_DZ","Villager1","Doctor","gsc_scientist1"

a kill will deduct 50 humanity from the player

Link to comment
Share on other sites

 

I also distinguish bots wearing different skins. For example, if you come to a Civil Chopper mission where a bunch of farmers are running around with guns, you are actually killing innocent people and so you will gain -50 humanity. For killing bots wearing a military uniform you gain +50 humanity.

This helps folks on my server maintain Hero/Bandit status without any PvP involved.

The check is added in WAI\compiled\ai_killed.sqf by checking on unit object _type (skin),

private ["_unit","_player","_humanity","_banditkills","_aiskin","_add_humanity_var","_goodskintest","_badskintest"];
_unit = _this select 0;
_player = _this select 1;
_type = _this select 2;

switch (_type) do {
	case "ground" : {ai_ground_units = (ai_ground_units -1);};
	case "air" : {ai_air_units = (ai_air_units -1);};
	case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
	case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};
};

_unit setVariable ["killedat", time];
_aiskin = typeOf _unit;

if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	_humanity = _player getVariable["humanity",0];
	_banditkills = _player getVariable["banditKills",0];
	if (ai_humanity_gain) then {
		if(_aiskin in ["RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","Functionary1_EP1_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","FR_OHara_DZ","Priest_DZ","FR_Rodriguez_DZ","Villager1","Doctor","gsc_scientist1"] ) then
		{
			diag_log format["WAI: Good Guy was killed, Humanity Lost %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity - ai_add_humanity),true];
		};
		if(_aiskin in ["Bandit1_DZ","BanditW1_DZ","BanditW2_DZ","Camo1_DZ","Sniper1_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_2_DZ","Ins_Soldier_GL_DZ","GUE_Commander_DZ","TK_INS_Warlord_EP1_DZ","TK_INS_Soldier_EP1_DZ","Soldier_Sniper_PMC_DZ","Soldier_TL_PMC_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","Bandit2_DZ","gsc_eco_stalker_mask_duty","gsc_military_helmet_wdl","gsc_military_helmet_grey_AT","gsc_military_head_grey","gsc_eco_stalker_head_fred","gsc_eco_stalker_head_camo1"] ) then
		{
			diag_log format["WAI: Bad Guy was Killed, Humanity Added %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity + ai_add_humanity),true];
		};
	};
	if (ai_banditkills_gain) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	if (ai_clear_body) then {
		{_unit removeMagazine _x;} forEach (magazines _unit);
		{_unit removeWeapon _x;} forEach (weapons _unit);
	};
	if (ai_ahare_info) then {
		{if (((position _x) distance (position _unit)) <= ai_share_distance) then {_x reveal [_player, 4.0];}} forEach allUnits;
	};
};

hey man, how do i make it so that, when people kill a.i in survivor uniforms they will count as murders or survivor kills on the debug monitor?

edit something like this?

if (ai_banditkills_gain) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
Link to comment
Share on other sites

Hello, 

 

any way to say mission completition on local channel near the player whos run into it?

I would like to decrease the chance bandits notice missions completed, and run to kill the looting players.

[nil,nil,rTitleText,"Survivors have secured the building supplies!", "PLAIN",10] call RE;
Link to comment
Share on other sites

The skill settings in AIConfig don't seem to do anything when I reduce them from 1.0 through 0.80 and on down the line.  The whole thing is setup to use the custom skill settings, so that part is right.  But changes to those skill values don't seem to be changing the intensity of the units.  Any ideas?

Link to comment
Share on other sites

 

I also distinguish bots wearing different skins. For example, if you come to a Civil Chopper mission where a bunch of farmers are running around with guns, you are actually killing innocent people and so you will gain -50 humanity. For killing bots wearing a military uniform you gain +50 humanity.

This helps folks on my server maintain Hero/Bandit status without any PvP involved.

The check is added in WAI\compiled\ai_killed.sqf by checking on unit object _type (skin)

 

Thank you shurix, this Idea is very good! I like it so mutch. Yesterday I did implement on my server, a bit modified way. I have 3 different skin type, Bandit, Hero, Soldiers, Bandits give + humanity, Heroes decreases humanity, Soldiers are neutral, if the player stand in positive give humanity, else decrease it. 

 

AIconfig.sqf

waiSkinType = [ "B","H","S","S"];

/// Skins used when "Bandit"  ///
bandit_skin = [
"Bandit1_DZ","Bandit2_DZ","BanditW1_DZ","BanditW2_DZ","GUE_Soldier_MG_DZ ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ"
];
/// Skins used when "GoodGuy" ///
goodguy_skin = [
"RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ",
"Functionary1_EP1_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ",
"Rocker4_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Soldier_Sniper_PMC_DZ",
"Villager1","Villager2","SurvivorW2_DZ","SurvivorW3_DZ",
"SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ",
"SurvivorWpink_DZ","gsc_scientist1","Assistant"
];
/// Skins used when "Soldiers" ///
soldiers_skin = [
"Rocket_DZ","Soldier1_DZ",
"Sniper1_DZ","CZ_Soldier_Sniper_EP1_DZ",
"Camo1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ",
"Graves_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ"
];

SpawnGroup.sqf,SpawnStatic.sqf, heli_para.sqf: 

	_aiskin = _skin;
	if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	};
	if (_skin == "B") then {
		_aiskin = bandit_skin call BIS_fnc_selectRandom;
	};
	if (_skin == "H") then {
		_aiskin = goodguy_skin call BIS_fnc_selectRandom;
	};
	if (_skin == "S") then {
		_aiskin = soldiers_skin call BIS_fnc_selectRandom;
	};

ai_killed.sqf:

	if (ai_humanity_gain) then {
		if (_aiskin in ["RU_Policeman_DZ","Pilot_EP1_DZ","Haris_Press_EP1_DZ","Functionary1_EP1_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Soldier_Bodyguard_AA12_PMC_DZ",
						"Soldier_Sniper_PMC_DZ","Villager1","Villager2","SurvivorW2_DZ","SurvivorW3_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ","SurvivorWpink_DZ","gsc_scientist1","Assistant"] ) then
		{
			diag_log format["WAI: Good Guy was killed, Humanity Lost %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity - ai_add_humanity),true];
		};
		if (_aiskin in ["Bandit1_DZ","Bandit2_DZ","BanditW1_DZ","BanditW2_DZ","GUE_Soldier_MG_DZ ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ",
						"GUE_Commander_DZ","Ins_Soldier_GL_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ"] ) then
		{
			diag_log format["WAI: Bad Guy was Killed, Humanity Added %1",ai_add_humanity];
			_player setVariable ["humanity",(_humanity + ai_add_humanity),true];
		};
		if (_aiskin in ["Rocket_DZ","Soldier1_DZ","Sniper1_DZ","CZ_Soldier_Sniper_EP1_DZ","Camo1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","Graves_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ"] ) then
		{
			if (_humanity > 0) then {
				diag_log format["WAI: Soldier was Killed by GoodGuy, Humanity Added %1",ai_add_humanity];
				_player setVariable ["humanity",(_humanity + ai_add_humanity),true]; 
			} else {
				diag_log format["WAI: Soldier was Killed by BadGuy, Humanity Lost %1",ai_add_humanity];
				_player setVariable ["humanity",(_humanity - ai_add_humanity),true]; 
			};
		};		
	};

Also have modified the missions like ( convoy.sqf)

_WAImissionType = waiSkinType call BIS_fnc_selectRandom;

//Troops
_rndnum = round (random 5) + 4;
[[(_position select 0) + 5,(_position select 1)  - 5,0],_rndnum,1,"Random",4,"",_WAImissionType,"Random",true] call spawn_group;
_rndnum = round (random 5) + 4;
[[(_position select 0) + 10,(_position select 1) - 10,0],_rndnum,1,"Random",4,"",_WAImissionType,"Random",true] call spawn_group;

//Turrets
[[[(_position select 0) + 5, (_position select 1) + 10, 0]],"M2StaticMG",0.8,_WAImissionType,1,2,"","Random",true] call spawn_static;
[[[(_position select 0) - 5, (_position select 1) - 10, 0]],"M2StaticMG",0.8,_WAImissionType,1,2,"","Random",true] call spawn_static;
[[[(_position select 0) - 5, (_position select 1) + 15, 0]],"SPG9_TK_INS_EP1",0.8,_WAImissionType,1,2,"","Random",true] call spawn_static;

_missionMarkerName = "[" + _WAImissionType + "] Disabled Convoy ";
[_position,_missionMarkerName] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
switch (_WAImissionType) do {
		case "B" : { [nil,nil,rTitleText,"An Ikea delivery has been hijacked by bandits, take over the convoy and the building supplies are yours!", "PLAIN",10] call RE; };
		case "H" : { [nil,nil,rTitleText,"An Ikea delivery has been secured by heroes, take over the convoy and the building supplies are yours!", "PLAIN",10] call RE; };
		case "S" : { [nil,nil,rTitleText,"An Ikea delivery has been escorted by soldiers, take over the convoy and the building supplies are yours!", "PLAIN",10] call RE; };
};

In this way the mission name on map has a sign , [H],  Bandit, Hero, Soldier mission.  

Again thank you so mutch you sharing your code, 

Link to comment
Share on other sites

 

I actually came here to ask the same thing. Is it possible to move

 

/// Sets radius for AI patrols (call spawn_group)

ai_patrol_radius = 300; 

 

this to be a function of spawn group? In fact, ill let yu know :P

 

Edit (note, you can also do this with the waypoints variable, i havent tested yet what it does with too many waypoints in a small area):

 

in SpawnGroup.sqf find:

if (count _this > 8) then {
	_mission = _this select 8;
} else {
	_mission = False;
};

after, add:

if (count _this > 9) then {
	_patrolrange = _this select 9;
} else {
	_patrolrange = ai_patrol_radius;;
};

in spawnGroup.sqf (again), find:

[_unitGroup, _position, _mission] call group_waypoints;

replace with:

[_unitGroup, _position, _mission, _patrolrange] call group_waypoints;

In patrol.sqf find:

_radius = ai_patrol_radius;

replace with:

_radius = _this select 3;

Note: Make sure to use false as 9th variable as it might bug on the _mission part otherwise.

 

Still working with this?  I added it to try and keep my ai somewhat localized.  I added the changes but unfortunately don't know what the options mean (_radius = _this select 3;?) etc.  My ai still will not stay inside buildings....bit frustrating.  Oh...btw, this script change you posted doesn't mention the fact that the variable (_patrolrange) needs to be added to the list at the top of the file with other variables.  Took me a minute to figure out that that was why my ai stopped loading in.

Link to comment
Share on other sites

Hello everyone,

 

Hoping someone can help, we have used the scripts from the OP and we keep getting the error "Waiting for server to start authentication". Anyone have any idea what the problem may be and how we could solve it? Thanks.

 

Had that for a little while.  You have to check your installation and make sure you did it all correctly.  Also look at your rpt file and see where it's hanging up.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...