Jump to content

Wicked AI/Mission system


Markk311

Recommended Posts

Hi guys,

Im getting the below since upgrade to Epoch 1.0.5.1 any ideas ?

11:23:44 "WAI: Mission Bandit Base Started At [8164.09,13798.8]"

11:23:44 Error in expression <,0], [], 0, "CAN_COLLIDE"];

[_box] call Best_box;

diag_log format["WAI: Mission>

11:23:44 Error position: <Best_box;

diag_log format["WAI: Mission>

11:23:44 Error Undefined variable in expression: best_box

Link to comment
Share on other sites

Hi all; 

Again me sorry...

 

i'm getting rpt error:

13:19:24 Error in expression < _aigear select 0;
_geartools = _aigear select 1;
if (_skin == "") then {
_aiski>
13:19:24   Error position: <select 1;
if (_skin == "") then {
_aiski>
13:19:24   Error Zero divisor
13:19:24 File z\addons\dayz_server\WAI\compile\SpawnGroup.sqf, line 66
13:19:25 Error in expression <_aipack;
{_unit addMagazine _x} forEach _gearmagazines;
{_unit addweapon _x} for>
13:19:25   Error position: <_gearmagazines;
{_unit addweapon _x} for>
13:19:25   Error Undefined variable in expression: _gearmagazines
13:19:25 File z\addons\dayz_server\WAI\compile\SpawnGroup.sqf, line 91
13:19:25 Error in expression < _aigear select 0;
_geartools = _aigear select 1;
if (_skin == "") then {
_aiski>
13:19:25   Error position: <select 1;
if (_skin == "") then {
_aiski>
13:19:25   Error Zero divisor
13:19:25 File z\addons\dayz_server\WAI\compile\SpawnGroup.sqf, line 66
13:19:25 Wrong text element 'null'
13:19:25 Wrong text element 'null'
13:19:25 Wrong text element 'null'
13:19:25 Wrong text element 'null'

This is my spawngroup.sqf:

private ["_mission","_aipack","_aicskill","_position","_unitnumber","_skill","_gun","_mags","_backpack","_skin","_gear","_aiweapon","_aigear","_aiskin","_skillarray","_unitGroup","_weapon","_magazine","_weaponandmag","_gearmagazines","_geartools","_unit"];
_position = _this select 0;
_unitnumber = _this select 1;
_skill = _this select 2;
_gun = _this select 3;
_mags = _this select 4;
_backpack = _this select 5;
_skin = _this select 6;
_gear = _this select 7;
if (count _this > 8) then {
	_mission = _this select 8;
} else {
	_mission = False;
};

_aiweapon = [];
_aigear = [];
_aiskin = "";
_aicskill = [];
_aipack = "";
_skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
_unitGroup = createGroup east;

if (!isServer) exitWith {};

for "_x" from 1 to _unitnumber do {
	switch (_gun) do {
		case 0 : {_aiweapon = ai_wep0;};
		case 1 : {_aiweapon = ai_wep1;};
		case 2 : {_aiweapon = ai_wep2;};
		case 3 : {_aiweapon = ai_wep3;};
		case 4 : {_aiweapon = ai_wep4;};
		case 5 : {_aiweapon = ai_wep5;};
		case 6 : {_aiweapon = ai_wep6;};
		case "Random" : {_aiweapon = ai_wep_random call BIS_fnc_selectRandom;};
	};
	_weaponandmag = _aiweapon call BIS_fnc_selectRandom;
	_weapon = _weaponandmag select 0;
	_magazine = _weaponandmag select 1;
		switch (_gear) do {
		case 0 : {_aigear = ai_gear0;};
		case 1 : {_aigear = ai_gear1;};
		case 2 : {_aigear = ai_gear2;};
		case 3 : {_aigear = ai_gear3;};
		case 4 : {_aigear = ai_gear4;};
		case 5 : {_aigear = ai_gear5;};
		case 6 : {_aigear = ai_gear6;};
		case 7 : {_aigear = ai_gear7;};
		case 8 : {_aigear = ai_gear8;};
		case 9 : {_aigear = ai_gear9;};
		case 10 : {_aigear = ai_gear10;};
		case 11 : {_aigear = ai_gear11;};
		case 12 : {_aigear = ai_gear12;};
		case 13 : {_aigear = ai_gear13;};
		case 14 : {_aigear = ai_gear14;};
		case 15 : {_aigear = ai_gear15;};
		case 16 : {_aigear = ai_gear16;};
		case 17 : {_aigear = ai_gear17;};
		case 18 : {_aigear = ai_gear18;};
		case 19 : {_aigear = ai_gear19;};
		case 20 : {_aigear = ai_gear20;};
		case 21 : {_aigear = ai_gear21;};
		case "Random" : {_aigear = ai_gear_random call BIS_fnc_selectRandom;};
	};
	_gearmagazines = _aigear select 0;
	_geartools = _aigear select 1;
	if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	} else {
		_aiskin = _skin
	};
	_unit = _unitGroup createUnit [_aiskin, [(_position select 0),(_position select 1),(_position select 2)], [], 10, "PRIVATE"];
	[_unit] joinSilent _unitGroup;
	if (_backpack == "") then {
		_aipack = ai_packs call BIS_fnc_selectRandom;
	} else {
		_aipack = _backpack
	};
	_unit enableAI "TARGET";
	_unit enableAI "AUTOTARGET";
	_unit enableAI "MOVE";
	_unit enableAI "ANIM";
	_unit enableAI "FSM";
	_unit setCombatMode ai_combatmode;
	_unit setBehaviour ai_behaviour;
	removeAllWeapons _unit;
	removeAllItems _unit;
	_unit addweapon _weapon;
	for "_i" from 1 to _mags do {_unit addMagazine _magazine;};
	_unit addBackpack _aipack;
	{_unit addMagazine _x} forEach _gearmagazines;
	{_unit addweapon _x} forEach _geartools;
	if (ai_custom_skills) then {
		switch (_skill) do {
		case 0 : {_aicskill = ai_custom_array1;};
		case 1 : {_aicskill = ai_custom_array2;};
		case 2 : {_aicskill= ai_custom_array3;};
		case "Random" : {_aicskill = ai_skill_random call BIS_fnc_selectRandom;};
	};
		{_unit setSkill [(_x select 0),(_x select 1)]} forEach _aicskill;
	} else {
		{_unit setSkill [_x,_skill]} forEach _skillarray;
	};
	ai_ground_units = (ai_ground_units + 1);
	_unit addEventHandler ["Killed",{[_this select 0, _this select 1, "ground"] call on_kill;}];
	if (_mission) then {
		_unit setVariable ["missionclean", "ground"];
	};
};
_unitGroup selectLeader ((units _unitGroup) select 0);
[_unitGroup, _position, _mission] call group_waypoints;

diag_log format ["WAI: Spawned a group of %1 Bandits at %2",_unitnumber,_position];

Any clue how to fix it? ( because then those Ai doesnt spawn and let some mission without any Ai)

Link to comment
Share on other sites

Good evening good folks, Ive installed this on my Pathera server, the server runs beta 11255.

The missions spawn but the loot crates doesn't.

 

Does anyone know a solution for this ?

 

My server is running 112555 & Epoch 1.0.5.1

 

The missions spawn, but there are not loot crates….

Link to comment
Share on other sites

Do you use infistar anti hack ? If so have you updated all you battleye files that came with the latest update ?

 

Yes I do - Updated it today 

 

But honestly I havet though that might be the reason, :huh: So I have not checked if the problem have been solved after the update of InfiStar - I will do that  :lol:

Link to comment
Share on other sites

Hi just installed this on my Tavi server. Seems like the missions work but roaming ai don't. No paradrops either. 

 

Sorry but im extremely new to adding ai because for a long time i was against it. 

 

Would someone be willing to help me get it set up please. 

 

Thanks in advance

 

the Monkee

Link to comment
Share on other sites

Is there a way to randomize the equipment of the AI??

create an array with the possible equipment (I'd suggest to use one array for main weapon, one for sideweapon) ..and then just do a call BIS_fnc_selectRandom on that array~   pretty simple if you just take a look on the available scripts (even the one 5 posts above with a rpt bug..)

Link to comment
Share on other sites

create an array with the possible equipment (I'd suggest to use one array for main weapon, one for sideweapon) ..and then just do a call BIS_fnc_selectRandom on that array~   pretty simple if you just take a look on the available scripts (even the one 5 posts above with a rpt bug..)

I wish I had the knowledge to write something like that. I have just basic scripting knowledge. I can install the great scripts that are shared on here and some minor debugging.

Link to comment
Share on other sites

Nope just added it and it worked, Only problem I've had is that it won't pull Overwatch weapons from that list. So I've had to add the weapons manually to the AIs gear and mission boxes.

Would you mind sharing your mission box list? I have added weapons to the boxes and to the Ai. The AI have overwatch weapons but I can not get the boxes to spawn any overwatch weapons. Not sure if I'm doing it wrong, missing something or what but I have been working on it for several days now with no luck & it's driving me crazy :wacko:

Link to comment
Share on other sites

Anyone ever noticed the static heli spawn to be shooting players, like with the helicopter itself, not the parachute AIs?

Im using this script for quite a while now on different servers and test servers .. never happend ...

 

Just my problem or is it the same for you guys?

Link to comment
Share on other sites

Hello Mark, i am completley new to scirpting and was hoping to make use of the Ai file you linked, i am using gaming deluxe servers, have epoch latest version, can you please walk me through the process of installing the file please, when you copy the file to the server directory, do you mean the main Missions folder in the Server Control Panel, or in the Arma 2 add on folder on my hard drive where it is installed? thanks in advance,

 

Drako

Link to comment
Share on other sites

Have this running on my server 1.63 122555 Epoch 1.0.5.1 and everything works great. I did break mine a few times because I tried adding new classes for the skill and weapons. The boxes would not spawn at that time, but when I got rid of the extra classes and went back to the standard classes it started spawning in the boxes again. I have three bandit outpost and Bandit city on the napf map and they will light you up. My problem is getting the traders to work with the gear after the last epoch /or Arma update. It broke all the buying and selling.

 

Thanks

FrenzyFire000

website: bravo-zulu-gaming.enjin.com

Link to comment
Share on other sites

Somewhere up this thread a kind soul posted a version of compile/SpawnGroup.sqf giving the AI a RPG7V (deleted on death, so not lootable):

private ["_RPG","_mission","_aipack","_aicskill","_position","_unitnumber","_skill","_gun","_mags","_backpack","_skin","_gear","_aiweapon","_aigear","_aiskin","_skillarray","_unitGroup","_weapon","_magazine","_weaponandmag","_gearmagazines","_geartools","_unit"];
_position = _this select 0;
_unitnumber = _this select 1;
_skill = _this select 2;
_gun = _this select 3;
_mags = _this select 4;
_backpack = _this select 5;
_skin = _this select 6;
_gear = _this select 7;
if (count _this > 8) then {
	_mission = _this select 8;
} else {
	_mission = False;
};
_RPG = 1;

_aiweapon = [];
_aigear = [];
_aiskin = "";
_aicskill = [];
_aipack = "";
_skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
_unitGroup = createGroup east;

if (!isServer) exitWith {};

for "_x" from 1 to _unitnumber do {
	switch (_gun) do {
		case 0 : {_aiweapon = ai_wep0;};
		case 1 : {_aiweapon = ai_wep1;};
		case 2 : {_aiweapon = ai_wep2;};
		case 3 : {_aiweapon = ai_wep3;};
		case 4 : {_aiweapon = ai_wep4;};
		case "Random" : {_aiweapon = ai_wep_random call BIS_fnc_selectRandom;};
	};
	_weaponandmag = _aiweapon call BIS_fnc_selectRandom;
	_weapon = _weaponandmag select 0;
	_magazine = _weaponandmag select 1;
		switch (_gear) do {
		case 0 : {_aigear = ai_gear0;};
		case 1 : {_aigear = ai_gear1;};
		case 2 : {_aigear = ai_gear2;};
		case 3 : {_aigear = ai_gear3;};
		case 4 : {_aigear = ai_gear4;};
		case "Random" : {_aigear = ai_gear_random call BIS_fnc_selectRandom;};
	};
	_gearmagazines = _aigear select 0;
	_geartools = _aigear select 1;
	if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	} else {
		_aiskin = _skin
	};
	_unit = _unitGroup createUnit [_aiskin, [(_position select 0),(_position select 1),(_position select 2)], [], 10, "PRIVATE"];
	[_unit] joinSilent _unitGroup;
	if (_backpack == "") then {
		_aipack = ai_packs call BIS_fnc_selectRandom;
	} else {
		_aipack = _backpack
	};
	_unit enableAI "TARGET";
	_unit enableAI "AUTOTARGET";
	_unit enableAI "MOVE";
	_unit enableAI "ANIM";
	_unit enableAI "FSM";
	_unit setCombatMode ai_combatmode;
	_unit setBehaviour ai_behaviour;
	removeAllWeapons _unit;
	removeAllItems _unit;
	_unit addweapon _weapon;
	for "_i" from 1 to _mags do {_unit addMagazine _magazine;};
	if ((_x == 1) && (_RPG > 0)) then {
	  _unit addweapon "RPG7V"; 
	  _unit addmagazine "PG7VR"; 
	  _unit addmagazine "PG7VR";
	} else {
	  _unit addBackpack _aipack;	
	};
	{_unit addMagazine _x} forEach _gearmagazines;
	{_unit addweapon _x} forEach _geartools;
	if (ai_custom_skills) then {
		switch (_skill) do {
		case 0 : {_aicskill = ai_custom_array1;};
		case 1 : {_aicskill = ai_custom_array2;};
		case 2 : {_aicskill= ai_custom_array3;};
		case "Random" : {_aicskill = ai_skill_random call BIS_fnc_selectRandom;};
	};
		{_unit setSkill [(_x select 0),(_x select 1)]} forEach _aicskill;
	} else {
		{_unit setSkill [_x,_skill]} forEach _skillarray;
	};
	ai_ground_units = (ai_ground_units + 1);
	_unit addEventHandler ["Killed",{[_this select 0, _this select 1, "ground"] call on_kill;}];
	if (_mission) then {
		_unit setVariable ["missionclean", "ground"];
	};
};
_unitGroup selectLeader ((units _unitGroup) select 0);
[_unitGroup, _position, _mission] call group_waypoints;

diag_log format ["WAI: Spawned a group of %1 Bandits at %2",_unitnumber,_position];

 

Edit: Thanks to Cen for pointing out that I had been hasty.

 

To remove the RPGs on AI death you have to edit compile/ai_killed.sqf, adding the remove commands in line 5-7:

private ["_unit","_player","_humanity","_banditkills"];
_unit = _this select 0;
_player = _this select 1;
_type = _this select 2;
_unit removeWeapon "RPG7V";
_unit removeMagazine "PG7VR";
_unit removeMagazine "PG7VR";

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];
if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	_humanity = _player getVariable["humanity",0];
	_banditkills = _player getVariable["banditKills",0];
	if (ai_humanity_gain) then {
		_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

my rpt is getting this spammed all of a sudden

 

_position = [18497.92445.22,0.001];
diag_log format["WAI: outpos>
 7:57:51   Error position: <.22,0.001];
diag_log format["WAI: outpos>
 7:57:51   Error Missing ]
 7:57:51 File z\addons\dayz_server\WAI\missions\missions\cdccamp.sqf, line 4
 7:57:51 Error in expression <","_rndnum"];
 
 
edit........
somehow the , turned into a . I beleive is the problem
18497.92445.22,0.001
Link to comment
Share on other sites

new error  I cannot see the problem

 

Could anyone help ????

 

"WAI: AI Config File Loaded"
 9:04:57 Error in expression <01],[18493.1,2439.28,0.001],[11998.15254.5,0.001],[10013.6,16392.5,0.001],[6428.>
 9:04:57   Error position: <.5,0.001],[10013.6,16392.5,0.001],[6428.>
 9:04:57   Error Missing ]
 9:04:57 File z\addons\dayz_server\WAI\customSpawns.sqf, line 107

 

 

[[[15552.3,14103,0.001],[14599.9,13801,0.001],[13927.9,14126.6,0.001],[9220.51,15705.6,0.001],[6482.93,10349.5,0.001],[8880.25,1620.59,0.001],[5957.93,13641.3,0.001],[18493.1,2439.28,0.001],[11998.15254.5,0.001],[10013.6,16392.5,0.001],[6428.2,9591.42,0.001]], //position(s) (can be multiple).
"M2StaticMG",             //Classname of turret
0.4,  //Skill level 0-1. Has no effect if using custom skills
"Bandit2_DZ",  //Skin "" for random or classname here.
1,  //Primary gun set number. "Random" for random weapon set. (not needed if ai_static_useweapon = False)
2,  //Number of magazines. (not needed if ai_static_useweapon = False)
"",  //Backpack "" for random or classname here. (not needed if ai_static_useweapon = False)
"Random"  //Gearset number. "Random" for random gear set. (not needed if ai_static_useweapon = False)
] call spawn_static;
Link to comment
Share on other sites

Somewhere up this thread a kind soul posted a version of compile/SpawnGroup.sqf giving the AI a RPG7V (deleted on death, so not lootable):

private ["_RPG","_mission","_aipack","_aicskill","_position","_unitnumber","_skill","_gun","_mags","_backpack","_skin","_gear","_aiweapon","_aigear","_aiskin","_skillarray","_unitGroup","_weapon","_magazine","_weaponandmag","_gearmagazines","_geartools","_unit"];
_position = _this select 0;
_unitnumber = _this select 1;
_skill = _this select 2;
_gun = _this select 3;
_mags = _this select 4;
_backpack = _this select 5;
_skin = _this select 6;
_gear = _this select 7;
if (count _this > 8) then {
	_mission = _this select 8;
} else {
	_mission = False;
};
_RPG = 1;

_aiweapon = [];
_aigear = [];
_aiskin = "";
_aicskill = [];
_aipack = "";
_skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
_unitGroup = createGroup east;

if (!isServer) exitWith {};

for "_x" from 1 to _unitnumber do {
	switch (_gun) do {
		case 0 : {_aiweapon = ai_wep0;};
		case 1 : {_aiweapon = ai_wep1;};
		case 2 : {_aiweapon = ai_wep2;};
		case 3 : {_aiweapon = ai_wep3;};
		case 4 : {_aiweapon = ai_wep4;};
		case "Random" : {_aiweapon = ai_wep_random call BIS_fnc_selectRandom;};
	};
	_weaponandmag = _aiweapon call BIS_fnc_selectRandom;
	_weapon = _weaponandmag select 0;
	_magazine = _weaponandmag select 1;
		switch (_gear) do {
		case 0 : {_aigear = ai_gear0;};
		case 1 : {_aigear = ai_gear1;};
		case 2 : {_aigear = ai_gear2;};
		case 3 : {_aigear = ai_gear3;};
		case 4 : {_aigear = ai_gear4;};
		case "Random" : {_aigear = ai_gear_random call BIS_fnc_selectRandom;};
	};
	_gearmagazines = _aigear select 0;
	_geartools = _aigear select 1;
	if (_skin == "") then {
		_aiskin = ai_skin call BIS_fnc_selectRandom;
	} else {
		_aiskin = _skin
	};
	_unit = _unitGroup createUnit [_aiskin, [(_position select 0),(_position select 1),(_position select 2)], [], 10, "PRIVATE"];
	[_unit] joinSilent _unitGroup;
	if (_backpack == "") then {
		_aipack = ai_packs call BIS_fnc_selectRandom;
	} else {
		_aipack = _backpack
	};
	_unit enableAI "TARGET";
	_unit enableAI "AUTOTARGET";
	_unit enableAI "MOVE";
	_unit enableAI "ANIM";
	_unit enableAI "FSM";
	_unit setCombatMode ai_combatmode;
	_unit setBehaviour ai_behaviour;
	removeAllWeapons _unit;
	removeAllItems _unit;
	_unit addweapon _weapon;
	for "_i" from 1 to _mags do {_unit addMagazine _magazine;};
	if ((_x == 1) && (_RPG > 0)) then {
	  _unit addweapon "RPG7V"; 
	  _unit addmagazine "PG7VR"; 
	  _unit addmagazine "PG7VR";
	} else {
	  _unit addBackpack _aipack;	
	};
	{_unit addMagazine _x} forEach _gearmagazines;
	{_unit addweapon _x} forEach _geartools;
	if (ai_custom_skills) then {
		switch (_skill) do {
		case 0 : {_aicskill = ai_custom_array1;};
		case 1 : {_aicskill = ai_custom_array2;};
		case 2 : {_aicskill= ai_custom_array3;};
		case "Random" : {_aicskill = ai_skill_random call BIS_fnc_selectRandom;};
	};
		{_unit setSkill [(_x select 0),(_x select 1)]} forEach _aicskill;
	} else {
		{_unit setSkill [_x,_skill]} forEach _skillarray;
	};
	ai_ground_units = (ai_ground_units + 1);
	_unit addEventHandler ["Killed",{[_this select 0, _this select 1, "ground"] call on_kill;}];
	if (_mission) then {
		_unit setVariable ["missionclean", "ground"];
	};
};
_unitGroup selectLeader ((units _unitGroup) select 0);
[_unitGroup, _position, _mission] call group_waypoints;

diag_log format ["WAI: Spawned a group of %1 Bandits at %2",_unitnumber,_position];

 

You can loot the RPG off the AI with this change.

Link to comment
Share on other sites

could someone explain how to set the staticM2 position height ?

I can place em on the ground just fine but when I try to place em on say a rooftop they spawn way higher in the air

 

my admin tools says my position is  [16482.6,18331.7,46.9706]

 

so I use that but the AI spawns in the air  and not on the roof. Im afraid if I use 0.002 it would be on the ground floor of the building and not the roof

Link to comment
Share on other sites

It might be including the bounding box of the building in the calculations to determine zero height. Depending on what that height is exactly, you might have to start with zero and try different values. I've used numbers like .002 to place one on a small balcony before but its been a while.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



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