Jump to content

Roaming AI in Towns Release


MisterT

Recommended Posts

Why not simply set the spawn chance of atagonist to a higher value. 25% at Loot and Thrash and you have always anything arround in the towns without the needs to spawn serverside AI 

Mine's already increased to 60% for trash and 30% for loot. But those require someone to actually loot to spawn them in, I wanted a constant persistent threat just like the zombie presented in DayZ, you can't just sit there AFK in a house without any risk of AI coming along, you will be found and engaged.

Link to comment
Share on other sites

Is this works if i add cords to my custom city, not server side buildings.  House_F work if they are made by me?

 

Testing today, after i change House_F to Land_TTowerBig_2_F and use my cordinates to spawn Ai

	DCLaltistownpositions = [[23811,19080],[23901,19262],[23732,93300],[23481,19298],[23417,19205],[23594,19230],[23424,19078],[23482,18938],[23433,18813],[23702,18871],[23868,18940],[23680,19120],[23654,18952]];

rpt give me this:

 

4:38:33 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:33   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:33   Error Неопределенная переменная в выражении: _position
 4:38:33 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:33   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:33   Error Неопределенная переменная в выражении: _position
 4:38:33 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:33   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:33   Error Неопределенная переменная в выражении: _position
 4:38:33 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:33   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:33   Error Неопределенная переменная в выражении: _position
 4:38:33 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error 0 установлено элементов, 3 ожидалось
 4:38:33 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error 0 установлено элементов, 3 ожидалось
 4:38:33 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error 0 установлено элементов, 3 ожидалось
 4:38:33 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error 0 установлено элементов, 3 ожидалось
 4:38:33 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:33   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:33   Error Неопределенная переменная в выражении: _position
 4:38:33 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:33   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:33   Error Неопределенная переменная в выражении: _position
 4:38:33 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:33   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:33   Error Неопределенная переменная в выражении: _position
 4:38:33 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:33   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:33   Error Неопределенная переменная в выражении: _position
 4:38:33 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:33   Error 0 установлено элементов, 3 ожидалось
 4:38:34 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error 0 установлено элементов, 3 ожидалось
 4:38:34 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error 0 установлено элементов, 3 ожидалось
 4:38:34 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error 0 установлено элементов, 3 ожидалось
 4:38:34 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:34   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:34   Error Неопределенная переменная в выражении: _position
 4:38:34 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:34   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:34   Error Неопределенная переменная в выражении: _position
 4:38:34 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:34   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:34   Error Неопределенная переменная в выражении: _position
 4:38:34 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error 0 установлено элементов, 3 ожидалось
 4:38:34 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error 0 установлено элементов, 3 ожидалось
 4:38:34 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:34   Error 0 установлено элементов, 3 ожидалось
 4:38:35 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:35   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:35   Error Неопределенная переменная в выражении: _position
 4:38:35 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:35   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:35   Error Неопределенная переменная в выражении: _position
 4:38:35 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:35   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:35   Error Неопределенная переменная в выражении: _position
 4:38:35 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:35   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:35   Error Неопределенная переменная в выражении: _position
 4:38:35 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:35   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:35   Error 0 установлено элементов, 3 ожидалось
 4:38:35 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:35   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:35   Error 0 установлено элементов, 3 ожидалось
 4:38:36 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:36   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:36   Error 0 установлено элементов, 3 ожидалось
 4:38:36 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:36   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:36   Error 0 установлено элементов, 3 ожидалось
 4:38:37 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:37   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:37   Error Неопределенная переменная в выражении: _position
 4:38:37 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:37   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:37   Error Неопределенная переменная в выражении: _position
 4:38:37 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:37   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:37   Error Неопределенная переменная в выражении: _position
 4:38:37 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
 4:38:37   Error position: <_position, _civilrole]];

};

while { tr>
 4:38:37   Error Неопределенная переменная в выражении: _position
 4:38:37 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:37   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:37   Error 0 установлено элементов, 3 ожидалось
 4:38:37 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:37   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:37   Error 0 установлено элементов, 3 ожидалось
 4:38:37 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:37   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:37   Error 0 установлено элементов, 3 ожидалось
 4:38:37 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
 4:38:37   Error position: <createUnit [_civiltype, (_x select 1), [>
 4:38:37   Error 0 установлено элементов, 3 ожидалось

 

Cant figure out, why... any help? /

Edited by SadBoy1981
Link to comment
Share on other sites

I didn't even think to look at that, pretty stupid way to do it if that's how it works, It should be based around a single coord for each town then variations off that coord, such as [(_pos select 0 + 50, _pos select 1 + 50,0)];

 

That's what I thought. I set mine up this way for a constant (yet lower) threat in the sense that it is about 2-5ish AI by city size (am assuming it uses buildings to produce them). We are very low pop so I'm trying not to kill everyone off before they escape their skivvies, Lol.

 

generate_zone.sqf

 

if(!(isserver) and !(DCLusehclient)) exitwith {};
if(!(!hasInterface && !isServer && name player == DCLhclientname) and DCLusehclient) exitwith {};

private [
"_allunits",
"_back",
"_buildings",
"_civil",
"_civiltype",
"_civilrole",
"_index",
"_group",
"_number",
"_position",
"_positions",
"_start",
"_trigger"
];

_position = _this select 0;

if (isnil "_position") exitwith { hint "DCL: empty position";};
if (count _position < 1) exitwith { hint "DCL: required a position ARRAY";};
if (surfaceiswater _position) exitwith { hint "DCL: position is in the water";};

_allunits = [];
_back = [];
_positions = [];
_start = true;

DCLcountplayer = {
private ["_array", "_count"];
_array = _this select 0;
_count = 0;
if (isnil "_array") exitwith {_count = 0; _count;};
{
if(isplayer _x) then {
_count = _count + 1;
};
sleep 0.0001;
}foreach _array;
_count;
};

// List all units in Zone
_trigger = createTrigger["EmptyDetector", _position];
_trigger setTriggerArea[DCLdistancepop, DCLdistancepop, 0, false];
_trigger setTriggerActivation["ANY", "PRESENT", TRUE];
_trigger setTriggerStatements["", "", ""];

while { ([(list _trigger)] call DCLcountplayer == 0) } do { sleep (random 5); };

_buildings = nearestObjects[_position,["House_F"], 150];
sleep 1;
{
_index = 0;
while { format ["%1", _x buildingPos _index] != "[0,0,0]" } do {
_positions = _positions + [(_x buildingPos _index)];
_index = _index + 1;
};
}foreach _buildings;

_number = 1 + round (random DCLgroupsize);
_group = creategroup DCLcivilianside;
for "_x" from 0 to _number do {
_civiltype = civilclass call BIS_fnc_selectRandom;
_position = _positions call BIS_fnc_selectRandom;
_civilrole = "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { true } do {
// restore civils
if ((([(list _trigger)] call DCLcountplayer == 0) or _start) and random (1) > 0.39) then {
_start = false;
{
if(alive _x) then {
_civilrole = _x getvariable "civilrole";
_back = _back + [[typeof _x, position _x, _civilrole]];
_x removeAllEventHandlers "Killed";
_x setdammage 1;
deletevehicle _x;
};
sleep 0.1;
}foreach (units _group);
deletegroup _group;
while { ([(list _trigger)] call DCLcountplayer == 0) } do { sleep (random 5); };
_group = creategroup DCLcivilianside;
{
_civiltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [], 0, "FORM"];
_position = _positions call BIS_fnc_selectRandom;
_civil setvariable ["civilrole", (_x select 2), true];
_civil setvariable ["destination", _position, false];
_civil setvariable ["wcprotected", true, false];
sleep 0.1;
}foreach _back;
wcgarbage = [_group] spawn walk;
_back = [];
};
sleep 5;
}; 

 

 

walk.sqf

	private [
		"_allunits",
		"_buildings",
		"_civil",
		"_index",
		"_group",
		"_position",
		"_positions"
	];

	_allunits = [];
	_positions = [];

	_group = _this select 0;

	_group setcombatmode "RED";
	_group allowfleeing 0;
	_group setspeedmode "FULL";

	{
		_x setbehaviour "COMBAT";
		_x allowFleeing 0;
		_x setvariable ["lastpos", position _x, false];
		_x setvariable ["destination", position _x, false];
		_x setvariable ["moveretry", 0, false];
		_x setunitpos "UP";
	} foreach (units _group);
	
	_position = position (leader _group);
	_buildings = nearestObjects[_position,["House_F"], DCLdistancemove];
	sleep 1;

	{
		_index = 0;
		while { format ["%1", _x buildingPos _index] != "[0,0,0]" } do {
			_position = _x buildingPos _index;
			_positions = _positions + [_position];
			_index = _index + 1;
		};
	}foreach _buildings;

	while { count (units _group) > 0 } do {
		if(count _allunits == 0) then {
			_allunits = units _group;
		};

		_civil = _allunits select 0;
		_allunits = _allunits - [_civil];
		
			if(format["%1", _civil getvariable "lastpos"] == format["%1", position _civil]) then {
				_civil setvariable ["moveretry", (_civil getvariable "moveretry") + 1, false];
			};
		
			_civil setvariable ["lastpos", position _civil, false];
		
			if(_civil getvariable "moveretry" > 3) then {
				_position = _positions call BIS_fnc_selectRandom;
				_civil stop false;
				_civil setvariable ["destination", _position, false];
				_civil domove _position;
				_civil setvariable ["moveretry", 0, false];
			};
			sleep 5;
		}; 

 

and in init.sqf

if (isServer) then {

	generate_zone	= compile preprocessFile "aoa\DCL\generate_zone.sqf";
	walk		= compile preprocessFile "aoa\DCL\walk.sqf";

	civilclass = ["I_Soldier_EPOCH","I_Soldier_EPOCH"];
	DCLaltistownpositions = [[25702,21352],[27001,23188],[20963,16969],[21353,16375],[18803,16621],[18097,15226],[16811,12700],[19405,13247],[20235,11654],[20538,8896],[20787,6731],[21697,7595],[16614,16087],[16283,17265],[14511,17614],[14065,18674],[10327,19068],[8632,18272],[7147,16417],[9316,15817],[12456,14361],[11032,13395],[10670,12258],[4148,11739],[3611,12965],[3851,13726],[5096,11249]];

	// civilian pop when players are at x meters
	DCLdistancepop = 200;

	// Civilians are in a group when they pop
	// Number max random of civilians in the group are x numbers
	DCLgroupsize = 3;

	// civilian can move in houses around x meters
	// of theirs initial position
	DCLdistancemove = 100;

	// civilian side
	DCLcivilianside = resistance;

	// HC client
	DCLusehclient = false;

	// HC client name
	DCLhclientname = "HC";

	{
		garbage = [_x] spawn generate_zone;
		sleep 0.01;
	}foreach DCLaltistownpositions;
	};

Link to comment
Share on other sites

ok so i have follow what to do. but dunno what to put the aoa so i pbo it and put it in rpochhive addons then added [] execVM "aoa\DCL\init.sqf"; to mpmissions/epoch.altis.pbo init

 

load server up all good but when i join it says could not find aoa/dlc/init 

You can make your own folder, lets say u call it AI_in_Towns

Put all 3 sqf files into it, and inside your init sqf add  [] execVM "AI_in_Towns\init.sqf";

 

And also u must to change init.sqf inside folder AI_in_Towns

	generate_zone	= compile preprocessFile "AI_in_Towns\generate_zone.sqf";
	walk		= compile preprocessFile "AI_in_Towns\walk.sqf";

Must work! =)

Link to comment
Share on other sites

Thanks for the script. We made the ai spawns from 2 different factions and as you approach town it is like entering a war zone they fight each other and you. KOOL

I will share info if needed.

Do the 2 different factions of AI spawn together at the same spawn coordinate?

Link to comment
Share on other sites

 

Im getting Script restriction #98

 

Can any1 help me with what i need to add on that line?

 

Line #98 is AssignAs 

 

 

Line 98 from line 0 is your AllowDamage line, so on 99 add !="SEM_AIsniperDamageDistance)then[{

if(!isPlayer _x)then{_x allowDamage false};
},{
if(!isPlayer _x)then{_x allowDamage true};
}];" 
 
(Could probably make it shorter but that's basic jist ^^ )
Link to comment
Share on other sites

 

Line 98 from line 0 is your AllowDamage line, so on 99 add !="SEM_AIsniperDamageDistance)then[{

if(!isPlayer _x)then{_x allowDamage false};
},{
if(!isPlayer _x)then{_x allowDamage true};
}];" 
 
(Could probably make it shorter but that's basic jist ^^ )

 

So i add all that behind which line?:p

Link to comment
Share on other sites

Give this a shot

7 "BIS_fnc_" !"initDisplay" !"getCfgSubClasses" !"animalBehaviour" !"guiEffectTiles_coef" !"GUImessage" !"guiEffectTiles" !"param" !"setIDCStreamFriendly" !"overviewauthor" !"diagAARrecord" !"diagKey" !"feedbackMain" !"missionHandlers" !"getServerVariable" !"missionFlow" !"initParams" !"initRespawn" !"missionTasksLocal" !"missionConversationsLocal" !"missionCon" !"preload" !"logFormat" !"recompile" !"moduleInit" !"feedback_allowPP" !"feedback_allowDeathScreen" !"feedbackInit" !"initMultiplayer" !"MP" !"displayMission" !"feedback_fatiguePP" !"respawnBase" !"dirTo" !"secondsToString" !"guiMessage_status" !"selectRespawnTemplate" !"guiMessage_defaultPositions" !"startLoadingScreen_ids" !"damageChanged" !"incapacitatedEffect" !"invRemove" !"relpos" !"inString" !"findSafePos" !"isPosBlacklisted" !"timeToString" !"distance2D" !"effectKilled" !"dynamictext" !"inAngleSector" !="_this call (uinamespace getvariable 'BIS_fnc_effectFired');"
7 "BIS_fnc_dynamictext" !", 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext;" !", 0, 0.4, 5, 2, 0, 2] spawn bis_fnc_dynamictext;" !"snil '_fnc_scriptName') then {_fnc_scriptName}"
7 forceRespawn
7 moveIn !="\"A3\functions_f\Misc\fn_moveIn.sqf\"" !="\"A3\functions_f\arrays\fn_removeIndex.sqf\"" !="player moveInAny _vehicle;\nEPOCH_antiWallCount = EPOCH_antiWallCount + 1;" !="[\"I_UAV_AI\", position _unit, [], 0, \"CAN_COLLIDE\"];\n_driver moveInAny _unit;"
7 attachTo !"EP_light attachTo [player];" !"_bomb attachTo [_unit, [0,0,0],\"Pelvis\"];" !"_dogHolder attachTo [_dog, [-0.2,1.2,0.7]];" !"EPOCH_staticTarget attachTo[player];" !"EPOCH_target attachTo[player];"
7 enableCollisionWith
7 hideObject !="_dogHolder hideobject true;" !="_dogHolder hideobject false;"
7 setFriend
7 setAmmo
7 setvelocity !="_bolt setPosATL _pos;\n_bolt setVelocity [0, 0, -10];" !="EPOCH_target setvelocitytransformation" !="_currentTarget setVelocity [0,0,-0.01];" !="_head setVelocity [random 2,random 2,10];" !="_vel = velocity this; _dir = getDir player; this setVelocity[(_vel select 0)+(sin _dir * 2),(_vel select 1)+(cos _dir * 2),(_vel select 2)];"
7 RscDebugConsole_watch
7 enableFatigue
7 setUnitRecoilCoefficient
7 setWeaponReloadingTime
7 allMissionObjects
7 callExtension
7 showCommandingMenu
7 assignAs
7 allUnits !="allUnits-playableUnits;};if" !="{_x allowFleeing 0} forEach allUnits;" !="EPOCH_ESPMAP_TARGETS = allUnits + vehicles;"
7 allowDamage !="if(!isPlayer _x)then{_x allowDamage" !="player allowDamage true;vehicle player allowDamage true;"
7 exec !="execVM \"semClient.sqf\"" !="<execute expression=" !"RscDebugConsole_execute" !"execFSM" !"_executeStackedEventHandler" !"fn_execVM" !"fn_moduleExecute" !"fn_execRemote" !"fn_MPexec" !"bis_fnc_moduleExecute_activate" !"fn_tridentExecute" !"randomize_civ1" !"executed from" !"EPOCH_DebugGUI_exec" !"_handle = [_display] execVM _script;" !"execVM \"\A3\Structures_F\scripts" !="execVM \"\A3\Structures_F_EPC\Civ\PlayGround\scripts\Carousel_spin.sqf\""
7 addWeaponCargo
7 onMapSingleClick !="onMapSingleClick '';"
7 addMagazine !="_this select 0 addMagazines [_this select 5, 1];" !"addMagazineCargo" !="player addMagazine _craftItem;" !="player addMagazine \"jerrycanE_epoch\";" !="player addMagazine \"emptyjar_epoch\";" !="player addMagazine \"jerrycan_epoch\";" !="player addMagazine \"Hatchet_swing\";" !="player addMagazine [(_x select 0),(_x select 1)]" !="player addMagazine _x;"
7 addMagazineCargo !"_dogHolder addMagazineCargo [\"RabbitCarcass_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"Pelt_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"Venom_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"SnakeCarcass_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"ChickenCarcass_EPOCH\", 1]"
7 addItem !="player addItem _craftItem;" !="player addItem _x;"
7 addBackPack
7 removeAllWeapons !"removeAllWeapons _this;"
7 removeAllItems !"removeAllItemsWithMagazines  _ai5;" !"removeAllItems _this;"
7 removeBackpack !="removeBackpackGlobal _unit;" !"removeBackpackGlobal _ai5;" !"removeBackpackGlobal _this;"
7 removeAllActions
7 setTerrainGrid !="setTerrainGrid 25;"
7 setViewDistance !"setViewDistance 1600"
7 createGroup !="_grp = createGroup RESISTANCE;" !="if (isserver) then {\n_group = creategroup sidelogic;"
7 createVehicleCrew
7 createVehicleLocal !"\"#particlesource\" createVehicleLocal" !"\"#lightpoint\" createVehicleLocal" !"\"BloodSplat\" createVehicleLocal" !"[\"lightning1_F\", \"lightning2_F\"] call BIS_fnc_selectRandom;\n_lighting = _class createVehicleLocal"
7 createUnit !="_unit = _grp createUnit[(_arrUnits select _i), _pos, [], 0, \"FORM\"];" !="_driver = _grp createUnit[\"I_UAV_AI\", position _unit, [], 0, \"CAN_COLLIDE\"];"
7 createAgent !="_unit = createAgent[_unitClass, _targetPos, [], 256, \"FORM\"];" !="_unit = createAgent [_unitClass, _targetPos, [], 120, \"FORM\"];" !="_animal = createAgent[_randomAIClass, _animalPos, [], 5, \"NONE\"];" !="_unit = createAgent [\"Epoch_Cloak_F\", _pos, [], 0, \"CAN_COLLIDE\"];"
7 createTeam
7 createDialog !"createDialog "R3F_LOG_dlg_contenu_vehicule";" !="createDialog \"InteractBank\";" !="createdialog \"SelectGender\";" !="_handled = createdialog _dialog;" !="if (!dialog) then {createDialog 'Skaronator_AdminMenu'};" !"createdialog 'AdminMenu';[] call fnc_addMenuMapHandler;" !"RscDisplayLocWeaponInfo" !"RscFunctionsViewer" !="if !(createdialog \"InteractItem\") exitWith {};" !="createDialog \"TapOut\";" !="if !(createdialog \"Trade\") exitWith {};" !="_ok = createdialog \"Interact\";" !="_ok = createdialog \"TradeNPCMenu\";" !="createDialog \"Epoch_myGroup\";" !="createDialog (if ((Epoch_my_GroupUID == \"\") && (Epoch_my_Group isEqualTo [])) then {\"EPOCH_createGrp\"} else {\"Epoch_myGroup\"});" !="createDialog \"GroupRequests\";"
7 deleteMarker !="deleteMarkerLocal \"MissionMarker\"" !"Marker = createMarker ["MainMarker", Ccoords];" !"_MainMarker setMarkerColor "ColorWhite";" !"_MainMarker setMarkerShape "ELLIPSE";" !"_MainMarker setMarkerBrush "Grid";" !"_MainMarker setMarkerSize [175,175];" !"createMarker" !"_MainMarker = createMarker ["MainMarker2", C2coords];" !"_MainMarker75 = createMarker["MainMarker75", MCoords];" !"_MainMarker75 = createMarker["MainMarker752", M2Coords];" !"_MainMarker = createMarker ["MainMarker", _this];"
7 setMarker !="Local"
7 createMarker !="createMarkerLocal [\"MissionMarker\", _markerPos]" !"Marker = createMarker ["MainMarker", Ccoords];" !"_MainMarker setMarkerColor "ColorWhite";" !"_MainMarker setMarkerShape "ELLIPSE";" !"_MainMarker setMarkerBrush "Grid";" !"_MainMarker setMarkerSize [175,175];" !"createMarker" !"_MainMarker = createMarker ["MainMarker2", C2coords];" !"_MainMarker75 = createMarker["MainMarker75", MCoords];" !"_MainMarker75 = createMarker["MainMarker752", M2Coords];" !"_MainMarker = createMarker ["MainMarker", _this];"
7 assignItem
7 forceAddUniform
7 removeAllMPEventHandlers
7 setDamage !"_ai5 setDamage 1;" !="([4654.62,9593.63,0] nearestObject 145259) setDamage 1" !="([4654.62,9593.63,0] nearestObject 145260) setDamage 1" !="_sapper setDamage 1;\n_sBomb setDamage 1;" !"_lockedTarget setDamage" !"player setDamage 1;" !"_timer = 10;"
7 setDammage
7 displaySetEventHandler
7 ctrlSetEventHandler !"BIS_fnc_guiMessage_status"
7 addMPEventHandler
7 addEventHandler !"displayAddEventHandler" !"ctrlAddEventHandler" !"FiredNear" !"EpeContactStart" !"InventoryClosed" !"GetOut" !"InventoryOpened" !"local" !"Respawn" !"Put" !"Take" !"Fired" !"Killed" !" [\"PostReset\",{BIS_EnginePPReset = true;} ];" !"_logic addeventhandler [\n\"local\""
7 displayAddEventHandler !"[_display] call _fnc_animate;" !"tVersion select 4) == \"Development\") then" !"_display displayaddeventhandler\n[\n\"mousemoving\"," !"(findDisplay 46) displayAddEventHandler [\"KeyDown\",\"true\"];" !"(findDisplay 46) displayAddEventHandler [\"KeyDown\",\"_this call EPOCH_KeyDown\"];" !"_display displayaddeventhandler [\"unload\",\"uinamespace setvariable ['BIS_fnc_guiMess" !="findDisplay -1337 displayAddEventHandler ['Unload'"
7 ctrlAddEventHandler !"rCfg >> \"refreshDelay\");" !" [\n\"draw\"," !" [\"buttonclick\"," !="(uiNamespace getVariable 'ESP_map') ctrlAddEventHandler['Draw', '_esp_targets = EPOCH_ESPMAP_TARGETS;"
7 removeAllEventHandlers !="ctrlRemoveAllEventHandlers" !="_vehicle removeAllEventHandlers \"GetOut\";"
7 removeAllMissionEventHandlers
7 ctrlRemoveAllEventHandlers !="(uiNamespace getVariable 'ESP_map') ctrlRemoveAllEventHandlers 'Draw';"
7 removeEventHandler !="displayRemoveEventHandler" !="player removeEventHandler ['Fired', 0];" !"_currentTarget removeEventHandler[\"EpeContactStart\", _onContactEH]" !" [_adminVar,objnull];\npublicvariable _adminVar;\nplayer removeeventhandler [\"respawn\",_respawn];"
7 displayRemoveEventHandler !"BIS_fnc_guiMessage_status"
7 switchCamera
7 remoteControl !"fn_moduleRemoteControl.sqf"
7 drawIcon3D !="drawIcon3D[\"\x\addons\a3_epoch_code\Data\Member.paa\",_color,_pos,1,1,0,_text,1,0.025,\"PuristaMedium\"];\n}forEach EPOCH_ESP_TARGETS;" !"drawIcon3D[format[\"\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa\",_stability],_color,(getPosATL EPOCH_stabilityTarget),5,5,0,\"\",1,0.05,\"PuristaMedium\"];" !"drawIcon3D[format[\"\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa\",_num],_color,_pos,4,4,0,\"\",1,0.05,\"PuristaMedium\"];" !"EPOCH_drawIcon3dStability" !"EPOCH_drawIcon3d" !"if (_condition) then {\ndrawIcon3D [_icon, _color, _position, _sizeX, _sizeY, _angle, _text,"
7 drawLine3D !"{\nfor [{_i = 1}, {_i < count _x}, {_i = _i + 1}] do {\ndrawLine3D [_x select (_i - 1), _x select _i, ((BIS_tracedShooter getVari"
7 ctrlCreate
7 ctrlDelete
7 ctrlClassName
7 ctrlModel
7 ctrlModelDirection
7 ctrlModelSide
7 ctrlModelUp
7 ctrlSetDirection
7 ctrlSetModel
7 deleteVehicleCrew !="[\"A3\functions_f\MP\fn_deleteVehicleCrew.sqf\",\".sqf\",0,false,false,false,\"A3\",\"MP\",\"deleteVehicleCrew\"]"
7 loadFile
7 selectPlayer !="selectPlayer _playerObject;"
7 setGroupIconsVisible
7 setGroupIconsSelectable
7 setGroupIconParams
7 addGroupIcon
7 EPOCH_whitelist
7 EPOCH_defaultVars_SEPXVar
7 EPOCH_group_upgrade_lvl_SVar
7 EPOCH_GROUP_Delete_PVS !="EPOCH_GROUP_Delete_PVS = [player,Epoch_personalToken];"
7 Dayz_GUI_R
7 dayz_originalPlayer
7 zZombie_Base
7 infiSTAR
7 GodMode
7 shazbot
7 _typeofHookMonky
7 _allocMemory
7 _d3d9multipliervariable
7 _runASM
7 _addGFX_hookD3D9eventhandler
7 _BEhookBYPASSBOB
7 JJMMEE_INIT_MENU
7 showCommandingMenu
7 assignAs
7 playableunits !"{getplayeruid _x == _ownerVar} count playableunits" !="lbSetData[21500, _index, netId _x];\n} forEach(playableUnits - [player]); !="FPS: %1 | PLAYERS: %2 | DAMAGE: %3 | KRYPTO: %4 | HUNGER: %5 | THIRST: %6 | SOILED: %7 | GRIDREF: %8", round diag_fps, count playableUnits, damage player, EPOCH_playerCrypto, EPOCH_playerHunger, EPOCH_playerThirst, EPOCH_playerSoiled, mapGridPosition player, _counter""
7 allowDamage !="player allowDamage true;vehicle player allowDamage true;" !"SEM_AIsniperDamageDistance"
7 exec !="<execute expression=" !"RscDebugConsole_execute" !"execFSM" !"_executeStackedEventHandler" !"fn_execVM" !"fn_moduleExecute" !"fn_execRemote" !"fn_MPexec" !"bis_fnc_moduleExecute_activate" !"fn_tridentExecute" !"randomize_civ1" !"executed from" !"EPOCH_DebugGUI_exec" !"_handle = [_display] execVM _script;" !"execVM \"\A3\Structures_F\scripts" !="execVM \"\A3\Structures_F_EPC\Civ\PlayGround\scripts\Carousel_spin.sqf\" !="execVM \"\MPMissions\epoch.altis\scripts\fn_statusBar.sqf\""

Link to comment
Share on other sites

I've also found a better way of getting this script in that makes it easier to install along side other mods, ah's, admin-tools, and whatnot. I'm going to share what I've done here, and it might become standard operating practice, as it makes it a lot easier, but it does add a little size to the Client Side receiving file. Currently with all the stuff I've added I'm at around 287k for my mission file, but it still loads really quickly. When I originally tried installing this script I saw a lot of the errors that everyone else was seeing, so I decided to re-work it in this manner:

 

1. I made a folder inside my epoch.Altis.pbo named custom. Inside that folder I made another called Roamers. I then copied and pasted all of the files into that folder.

 

2. I've taken away root level access to the script. It was easier for me to pack the whole thing in epoch.Altis.pbo for reasons of calling the file, and making it work right out of the box with the other mods/tools I'm using. I changed the file init.sqf by altering the file paths: 

generate_zone = compile preprocessFile "custom\Roamers\Generate_Zone.sqf"; 
walk = compile preprocessFile "custom\Roamers\walk.sqf";
3. I used the randomized chance script, and dropped the percentage and amount of spawns per city to make it more realistic (like if my server was constantly running at capacity, so as to mimic a full server's amount of action). I won't post that here because it's still a long list of coordinates.

 

4. If you don't already have an init.sqf inside your MPmissions epoch.Altis.pbo, you'll need to make one. inside that file add the following code: 

if (isServer) then {
	execVM "custom\Roamers\init.sqf";
};
MisterT - thank you for the awesome script, and I hope my explanation & changes help rather than hinder. If you like the changes, feel free to use them in release, and just maybe if it makes supporting it a little easier, we might get a few cooler AI than guys running around with glorified pistols?!? lol, thanks again.

I'm attaching my files (Sorry for the outside link, but it's the best I can do) so you can look at what I've done, or just repackage it as a download, whatever :-)

 

-Helios

 

https://drive.google.com/open?id=0B-nSuqkXy8NzZ3d4VC05SHhkQlk&authuser=0

 

Hey!

 

I tried what you are saying here but i cant say im finding any AI's.

 

 

-I made a folder in my Epoch.Altis folder and called it custom, then i made a new folder within that folder and called it Roamers. Inside that folder i pasted the walk.sqf, init.sqf and generate_zone.sqf

 

- init.sqf within the Roamers folder looks like this.

if!(isserver) exitwith {};

 

generate_zone = compile preprocessFile "custom\Roamers\Generate_Zone.sqf"; 

walk = compile preprocessFile "custom\Roamers\walk.sqf";

 

civilclass = ["I_Soldier_EPOCH","I_Soldier_EPOCH","I_Soldier_EPOCH","I_Soldier_EPOCH","I_Soldier_EPOCH","Epoch_Sapper_F"];

DCLaltistownpositions = [[20875,6575],[20775,6675],[20875,6675],[20775,6775],[20875,6775],[21675,7575],[21775,7575],[20475,8875],[20575,8875],[3775,11075],[3875,11075],[5175,11075],[3875,11175],[5075,11175],[5175,11175],[5075,11275],[5175,11275],[4975,11375],[5075,11375],[9475,11575],[20175,11575],[4175,11675],[20175,11675],[20275,11675],[4075,11775],[4175,11775],[20175,11775],[20275,11775],[9075,11875],[9175,11875],[9275,11875],[9375,11875],[8975,11975],[9075,11975],[9175,11975],[8875,12075],[8975,12075],[9075,12075],[10675,12175],[10575,12275],[10675,12275],[16575,12475],[16675,12475],[16775,12475],[16775,12575],[16875,12575],[16975,12575],[3475,12675],[16775,12675],[16875,12675],[16975,12675],[3475,12775],[3575,12775],[3775,12775],[3875,12775],[16775,12775],[16875,12775],[3475,12875],[3575,12875],[3675,12875],[16775,12875],[16875,12875],[3275,12975],[3375,12975],[3475,12975],[3575,12975],[3675,12975],[3375,13075],[3475,13075],[3575,13075],[3675,13075],[3275,13175],[3375,13175],[3475,13175],[3575,13175],[17375,13175],[17475,13175],[3475,13275],[3575,13275],[3675,13275],[3775,13275],[19375,13275],[19475,13275],[3575,13375],[10975,13375],[11075,13375],[3675,13475],[3775,13475],[3575,13575],[3675,13575],[3775,13575],[3875,13575],[3775,13675],[3875,13675],[3975,13675],[11675,13675],[3675,13775],[3775,13775],[3875,13775],[3975,13775],[11775,13775],[3875,13875],[3575,13975],[12375,14175],[3375,14275],[12275,14275],[12375,14275],[12575,14275],[12675,14275],[12475,14375],[12575,14375],[12675,14375],[3575,14475],[12475,14475],[11075,14575],[11175,14575],[4275,15075],[9575,15075],[12875,15075],[12975,15075],[17975,15175],[18075,15175],[18175,15175],[17975,15275],[18075,15275],[18175,15275],[18275,15275],[7375,15375],[18175,15375],[12375,15575],[12475,15575],[20575,15675],[9075,15775],[9275,15775],[20775,15775],[9175,15875],[9275,15875],[9375,15875],[9375,15975],[9475,15975],[9575,15975],[9575,16075],[16675,16075],[4775,16175],[4875,16175],[15575,16175],[16675,16175],[6275,16275],[14175,16275],[15275,16275],[15975,16275],[21275,16375],[21375,16375],[21475,16375],[21575,16375],[7175,16475],[18775,16575],[18875,16575],[18775,16675],[18675,16775],[20875,16875],[20975,16875],[20875,16975],[20975,16975],[21075,16975],[15975,17075],[20875,17075],[20975,17075],[16475,17175],[20975,17175],[10475,17275],[16175,17275],[16275,17275],[16375,17275],[16475,17275],[14475,17575],[14575,17575],[14475,17675],[8575,18275],[8675,18275],[13975,18575],[14075,18575],[13875,18675],[13975,18675],[14075,18675],[13875,18775],[13975,18775],[14075,18775],[10275,19075],[10375,19075],[20975,19175],[9375,20275],[9475,20275],[25575,21275],[25675,21275],[25775,21275],[4575,21375],[25575,21375],[25675,21375],[25775,21375],[25775,21475],[26875,23175],[26975,23275],[27075,23275]];

 

// civilian pop when players are at x meters

DCLdistancepop = 100;

 

// Civilians are in a group when they pop

// Number max random of civilians in the group are x numbers

DCLgroupsize = 6;

 

// civilian can move in houses around x meters

// of theirs initial position

DCLdistancemove = 250;

 

// civilian side

DCLcivilianside = resistance;

 

// HC client

DCLusehclient = false;

 

// HC client name

DCLhclientname = "HC";

 

{

garbage = [_x] spawn generate_zone;

sleep 0.01;

}foreach DCLaltistownpositions;

 

- generate_zone.sqf looks like  this:

if(!(isserver) and !(DCLusehclient)) exitwith {};

if(!(!hasInterface && !isServer && name player == DCLhclientname) and DCLusehclient) exitwith {};

 

private [

"_allunits",

"_back",

"_buildings",

"_civil",

"_civiltype",

"_civilrole",

"_index",

"_group",

"_number",

"_position",

"_positions",

"_start",

"_trigger"

];

 

_position = _this select 0;

 

if (isnil "_position") exitwith { hint "DCL: empty position";};

if (count _position < 1) exitwith { hint "DCL: required a position ARRAY";};

if (surfaceiswater _position) exitwith { hint "DCL: position is in the water";};

 

_allunits = [];

_back = [];

_positions = [];

_start = true;

 

DCLcountplayer = {

private ["_array", "_count"];

_array = _this select 0;

_count = 0;

if (isnil "_array") exitwith {_count = 0; _count;};

{

if(isplayer _x) then {

_count = _count + 1;

};

sleep 0.0001;

}foreach _array;

_count;

};

 

// List all units in Zone

_trigger = createTrigger["EmptyDetector", _position];

_trigger setTriggerArea[DCLdistancepop, DCLdistancepop, 0, false];

_trigger setTriggerActivation["ANY", "PRESENT", TRUE];

_trigger setTriggerStatements["", "", ""];

 

while { ([(list _trigger)] call DCLcountplayer == 0) } do { sleep (random 5); };

 

_buildings = nearestObjects[_position,["House_F"], 150];

sleep 1;

{

_index = 0;

while { format ["%1", _x buildingPos _index] != "[0,0,0]" } do {

_positions = _positions + [(_x buildingPos _index)];

_index = _index + 1;

};

}foreach _buildings;

 

_number = 1 + round (random DCLgroupsize);

_group = creategroup DCLcivilianside;

for "_x" from 0 to _number do {

_civiltype = civilclass call BIS_fnc_selectRandom;

_position = _positions call BIS_fnc_selectRandom;

_civilrole = "civil";

_back = _back + [[_civiltype, _position, _civilrole]];

 

};

 

while { true } do {

// restore civils

if(([(list _trigger)] call DCLcountplayer == 0) or _start) then {

_start = false;

{

if(alive _x) then {

_civilrole = _x getvariable "civilrole";

_back = _back + [[typeof _x, position _x, _civilrole]];

_x removeAllEventHandlers "Killed";

_x setdammage 1;

deletevehicle _x;

};

sleep 0.1;

}foreach (units _group);

deletegroup _group;

while { ([(list _trigger)] call DCLcountplayer == 0) } do { sleep (random 5); };

_group = creategroup DCLcivilianside;

{

_civiltype = _x select 0;

_civil = _group createUnit [_civiltype, (_x select 1), [], 0, "FORM"];

_position = _positions call BIS_fnc_selectRandom;

_civil setvariable ["civilrole", (_x select 2), true];

_civil setvariable ["destination", _position, false];

_civil setvariable ["wcprotected", true, false];

sleep 0.1;

}foreach _back;

wcgarbage = [_group] spawn walk;

_back = [];

};

sleep 5;

};

 

- walk.sqf looks like this:

private [

"_allunits",

"_buildings",

"_civil",

"_index",

"_group",

"_position",

"_positions"

];

 

_allunits = [];

_positions = [];

 

_group = _this select 0;

 

_group setcombatmode "RED";

_group allowfleeing 0;

_group setspeedmode "FULL";

 

{

_x setbehaviour "COMBAT";

_x allowFleeing 0;

_x setvariable ["lastpos", position _x, false];

_x setvariable ["destination", position _x, false];

_x setvariable ["moveretry", 0, false];

_x setunitpos "UP";

} foreach (units _group);

 

_position = position (leader _group);

_buildings = nearestObjects[_position,["House_F"], DCLdistancemove];

sleep 1;

 

{

_index = 0;

while { format ["%1", _x buildingPos _index] != "[0,0,0]" } do {

_position = _x buildingPos _index;

_positions = _positions + [_position];

_index = _index + 1;

};

}foreach _buildings;

 

while { count (units _group) > 0 } do {

if(count _allunits == 0) then {

_allunits = units _group;

};

 

_civil = _allunits select 0;

_allunits = _allunits - [_civil];

 

if(format["%1", _civil getvariable "lastpos"] == format["%1", position _civil]) then {

_civil setvariable ["moveretry", (_civil getvariable "moveretry") + 1, false];

};

 

_civil setvariable ["lastpos", position _civil, false];

 

if(_civil getvariable "moveretry" > 3) then {

_position = _positions call BIS_fnc_selectRandom;

_civil stop false;

_civil setvariable ["destination", _position, false];

_civil domove _position;

_civil setvariable ["moveretry", 0, false];

};

sleep 5;

};

 

-After that i added this to my init.sqf located in my epoch.Altis folder:

 

 

if (isServer) then {

execVM "custom\Roamers\init.sqf";

};

 

-Backed out of the epoch.Altis folder and packed it to epoch.Altis.pbo.

 

-Then i deleted my old epoch.Altis.pbo inside my MPMissions folder and uploaded the new one.

 

What am i missing? =/

 

GOD I HOPE MY SPOILERS WORK xD

Link to comment
Share on other sites

Hi, we are all script noobz, so we still have to face basic mistakes. Our server won't start, always getting the message: Warning Message: Script aoa\DCL\init.sqf not found

Seem's as we have done something terribly wrong. we would be very glad for any urgent help, which can be understood by us noobs. Sry for my English, I'm not UK US

Link to comment
Share on other sites

Hi, we are all script noobz, so we still have to face basic mistakes. Our server won't start, always getting the message: Warning Message: Script aoa\DCL\init.sqf not found

Seem's as we have done something terribly wrong. we would be very glad for any urgent help, which can be understood by us noobs. Sry for my English, I'm not UK US

By reading that error it doesnt seem like you put the init.sqf that came with this mod into the aoa folder you created. You need both init.sqf with the mod command line in your epoch.WORLD.pbo + the init.sqf file in the aoa/DCL folder

Link to comment
Share on other sites

 

Thank you!

Still get error tho.

 

Line 99 is playableunits

 

and the error is:

 

"SEM_AIsniperDamageDistance)then[{
if(!isPlayer _x)then{_x allowDamage false};
},{
if(!isPlayer _x)then{_x allowDamage true};
}];"
 
HELP! =( this has been bugging me for 12 hours now, i cant figure it out =(
 
----------------------------------------------------
 
Need to get a grip on the BE filter so you don't have to ask for help!
 
Facts using a example line of (7 ctrlSetEventHandler !"BIS_fnc_guiMessage_status" )
 
1.  Scripts.txt is a text file that is instructions for battleye.
2.  Each line starts with a number like 7 for example means log and kick the player running the script
3.  The first line in the script file is considered line 0 so if its a #24 you actually find line 25 in your file
4.  After the first number is a script command that battleye is NOT going to let run (per the example ctrlSetEventHandler)
5.  Thereafter that command is your exceptions to the rule of not running that command (per our example !"BIS_fnc_guiMessage_status").  That means your ok with a script using ctrlSetEventHandler IF the "BIS_fnc_guiMessage_status" is somewhere near the command.
6.  !"fun time" means that anytime a exception is found with that command and has "fun time" in it we will let it go through, so "fun times" would work and "fun times2" would work
7.   !="fun times" means that anytime a exception is found with that command and has EXACTLY "fun times" we will let it go through so "fun time" would not work and "fun times" would
8.  You can change the whole line to just "log" instead of "kick and log" by changing the 7 to a 5 I think but it is not as safe for your community as a script kiddie could then run that command and it would NOT kick them

 

Link to comment
Share on other sites

Hey!

 

I tried what you are saying here but i cant say im finding any AI's.

 

 

-I made a folder in my Epoch.Altis folder and called it custom, then i made a new folder within that folder and called it Roamers. Inside that folder i pasted the walk.sqf, init.sqf and generate_zone.sqf

 

- init.sqf within the Roamers folder looks like this.

if!(isserver) exitwith {};

 

generate_zone = compile preprocessFile "custom\Roamers\Generate_Zone.sqf"; 

walk = compile preprocessFile "custom\Roamers\walk.sqf";

 

civilclass = ["I_Soldier_EPOCH","I_Soldier_EPOCH","I_Soldier_EPOCH","I_Soldier_EPOCH","I_Soldier_EPOCH","Epoch_Sapper_F"];

DCLaltistownpositions = [[20875,6575],[20775,6675],[20875,6675],[20775,6775],[20875,6775],[21675,7575],[21775,7575],[20475,8875],[20575,8875],[3775,11075],[3875,11075],[5175,11075],[3875,11175],[5075,11175],[5175,11175],[5075,11275],[5175,11275],[4975,11375],[5075,11375],[9475,11575],[20175,11575],[4175,11675],[20175,11675],[20275,11675],[4075,11775],[4175,11775],[20175,11775],[20275,11775],[9075,11875],[9175,11875],[9275,11875],[9375,11875],[8975,11975],[9075,11975],[9175,11975],[8875,12075],[8975,12075],[9075,12075],[10675,12175],[10575,12275],[10675,12275],[16575,12475],[16675,12475],[16775,12475],[16775,12575],[16875,12575],[16975,12575],[3475,12675],[16775,12675],[16875,12675],[16975,12675],[3475,12775],[3575,12775],[3775,12775],[3875,12775],[16775,12775],[16875,12775],[3475,12875],[3575,12875],[3675,12875],[16775,12875],[16875,12875],[3275,12975],[3375,12975],[3475,12975],[3575,12975],[3675,12975],[3375,13075],[3475,13075],[3575,13075],[3675,13075],[3275,13175],[3375,13175],[3475,13175],[3575,13175],[17375,13175],[17475,13175],[3475,13275],[3575,13275],[3675,13275],[3775,13275],[19375,13275],[19475,13275],[3575,13375],[10975,13375],[11075,13375],[3675,13475],[3775,13475],[3575,13575],[3675,13575],[3775,13575],[3875,13575],[3775,13675],[3875,13675],[3975,13675],[11675,13675],[3675,13775],[3775,13775],[3875,13775],[3975,13775],[11775,13775],[3875,13875],[3575,13975],[12375,14175],[3375,14275],[12275,14275],[12375,14275],[12575,14275],[12675,14275],[12475,14375],[12575,14375],[12675,14375],[3575,14475],[12475,14475],[11075,14575],[11175,14575],[4275,15075],[9575,15075],[12875,15075],[12975,15075],[17975,15175],[18075,15175],[18175,15175],[17975,15275],[18075,15275],[18175,15275],[18275,15275],[7375,15375],[18175,15375],[12375,15575],[12475,15575],[20575,15675],[9075,15775],[9275,15775],[20775,15775],[9175,15875],[9275,15875],[9375,15875],[9375,15975],[9475,15975],[9575,15975],[9575,16075],[16675,16075],[4775,16175],[4875,16175],[15575,16175],[16675,16175],[6275,16275],[14175,16275],[15275,16275],[15975,16275],[21275,16375],[21375,16375],[21475,16375],[21575,16375],[7175,16475],[18775,16575],[18875,16575],[18775,16675],[18675,16775],[20875,16875],[20975,16875],[20875,16975],[20975,16975],[21075,16975],[15975,17075],[20875,17075],[20975,17075],[16475,17175],[20975,17175],[10475,17275],[16175,17275],[16275,17275],[16375,17275],[16475,17275],[14475,17575],[14575,17575],[14475,17675],[8575,18275],[8675,18275],[13975,18575],[14075,18575],[13875,18675],[13975,18675],[14075,18675],[13875,18775],[13975,18775],[14075,18775],[10275,19075],[10375,19075],[20975,19175],[9375,20275],[9475,20275],[25575,21275],[25675,21275],[25775,21275],[4575,21375],[25575,21375],[25675,21375],[25775,21375],[25775,21475],[26875,23175],[26975,23275],[27075,23275]];

 

// civilian pop when players are at x meters

DCLdistancepop = 100;

 

// Civilians are in a group when they pop

// Number max random of civilians in the group are x numbers

DCLgroupsize = 6;

 

// civilian can move in houses around x meters

// of theirs initial position

DCLdistancemove = 250;

 

// civilian side

DCLcivilianside = resistance;

 

// HC client

DCLusehclient = false;

 

// HC client name

DCLhclientname = "HC";

 

{

garbage = [_x] spawn generate_zone;

sleep 0.01;

}foreach DCLaltistownpositions;

 

- generate_zone.sqf looks like  this:

if(!(isserver) and !(DCLusehclient)) exitwith {};

if(!(!hasInterface && !isServer && name player == DCLhclientname) and DCLusehclient) exitwith {};

 

private [

"_allunits",

"_back",

"_buildings",

"_civil",

"_civiltype",

"_civilrole",

"_index",

"_group",

"_number",

"_position",

"_positions",

"_start",

"_trigger"

];

 

_position = _this select 0;

 

if (isnil "_position") exitwith { hint "DCL: empty position";};

if (count _position < 1) exitwith { hint "DCL: required a position ARRAY";};

if (surfaceiswater _position) exitwith { hint "DCL: position is in the water";};

 

_allunits = [];

_back = [];

_positions = [];

_start = true;

 

DCLcountplayer = {

private ["_array", "_count"];

_array = _this select 0;

_count = 0;

if (isnil "_array") exitwith {_count = 0; _count;};

{

if(isplayer _x) then {

_count = _count + 1;

};

sleep 0.0001;

}foreach _array;

_count;

};

 

// List all units in Zone

_trigger = createTrigger["EmptyDetector", _position];

_trigger setTriggerArea[DCLdistancepop, DCLdistancepop, 0, false];

_trigger setTriggerActivation["ANY", "PRESENT", TRUE];

_trigger setTriggerStatements["", "", ""];

 

while { ([(list _trigger)] call DCLcountplayer == 0) } do { sleep (random 5); };

 

_buildings = nearestObjects[_position,["House_F"], 150];

sleep 1;

{

_index = 0;

while { format ["%1", _x buildingPos _index] != "[0,0,0]" } do {

_positions = _positions + [(_x buildingPos _index)];

_index = _index + 1;

};

}foreach _buildings;

 

_number = 1 + round (random DCLgroupsize);

_group = creategroup DCLcivilianside;

for "_x" from 0 to _number do {

_civiltype = civilclass call BIS_fnc_selectRandom;

_position = _positions call BIS_fnc_selectRandom;

_civilrole = "civil";

_back = _back + [[_civiltype, _position, _civilrole]];

 

};

 

while { true } do {

// restore civils

if(([(list _trigger)] call DCLcountplayer == 0) or _start) then {

_start = false;

{

if(alive _x) then {

_civilrole = _x getvariable "civilrole";

_back = _back + [[typeof _x, position _x, _civilrole]];

_x removeAllEventHandlers "Killed";

_x setdammage 1;

deletevehicle _x;

};

sleep 0.1;

}foreach (units _group);

deletegroup _group;

while { ([(list _trigger)] call DCLcountplayer == 0) } do { sleep (random 5); };

_group = creategroup DCLcivilianside;

{

_civiltype = _x select 0;

_civil = _group createUnit [_civiltype, (_x select 1), [], 0, "FORM"];

_position = _positions call BIS_fnc_selectRandom;

_civil setvariable ["civilrole", (_x select 2), true];

_civil setvariable ["destination", _position, false];

_civil setvariable ["wcprotected", true, false];

sleep 0.1;

}foreach _back;

wcgarbage = [_group] spawn walk;

_back = [];

};

sleep 5;

};

 

- walk.sqf looks like this:

private [

"_allunits",

"_buildings",

"_civil",

"_index",

"_group",

"_position",

"_positions"

];

 

_allunits = [];

_positions = [];

 

_group = _this select 0;

 

_group setcombatmode "RED";

_group allowfleeing 0;

_group setspeedmode "FULL";

 

{

_x setbehaviour "COMBAT";

_x allowFleeing 0;

_x setvariable ["lastpos", position _x, false];

_x setvariable ["destination", position _x, false];

_x setvariable ["moveretry", 0, false];

_x setunitpos "UP";

} foreach (units _group);

 

_position = position (leader _group);

_buildings = nearestObjects[_position,["House_F"], DCLdistancemove];

sleep 1;

 

{

_index = 0;

while { format ["%1", _x buildingPos _index] != "[0,0,0]" } do {

_position = _x buildingPos _index;

_positions = _positions + [_position];

_index = _index + 1;

};

}foreach _buildings;

 

while { count (units _group) > 0 } do {

if(count _allunits == 0) then {

_allunits = units _group;

};

 

_civil = _allunits select 0;

_allunits = _allunits - [_civil];

 

if(format["%1", _civil getvariable "lastpos"] == format["%1", position _civil]) then {

_civil setvariable ["moveretry", (_civil getvariable "moveretry") + 1, false];

};

 

_civil setvariable ["lastpos", position _civil, false];

 

if(_civil getvariable "moveretry" > 3) then {

_position = _positions call BIS_fnc_selectRandom;

_civil stop false;

_civil setvariable ["destination", _position, false];

_civil domove _position;

_civil setvariable ["moveretry", 0, false];

};

sleep 5;

};

 

-After that i added this to my init.sqf located in my epoch.Altis folder:

 

 

if (isServer) then {

execVM "custom\Roamers\init.sqf";

};

 

-Backed out of the epoch.Altis folder and packed it to epoch.Altis.pbo.

 

-Then i deleted my old epoch.Altis.pbo inside my MPMissions folder and uploaded the new one.

 

What am i missing? =/

 

GOD I HOPE MY SPOILERS WORK xD

 

Can you post a copy of your server .rpt log, so that I can see what's going on in there? I have been using the exact same setup that I posted since day 1, without issue. I have used every different version of antihack and script out there testing them, and never once been without ai. 

 

So if you could post that server .rpt inside one of those little spoiler things :) it would help me to understand what is missing.

 

Currently I'm working on getting some custom AI roaming about, rather than using the stock uav AI and calling them. I'd like my players to be able to pick up better than a pdw for all their hard work, especially the new spawns (even though they are given starting gear, it's only 556, a 6.5 or 7.62 as a reward would probably make them quite happy AI killing machines). As soon as I have a solid working copy of that script I will post it.

Link to comment
Share on other sites

Hello, This script worked great on altis! but on chernarus i can't get the ai's to spawn, my .rpt log:

(this error was already mentioned in page 3 and 4 but no sollution yet?

 

*Try'd making Spoiler with special BBcode, but it doesnt let me do it!*

 

20:24:28 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
20:24:28 Error position: <_position, _civilrole]];

};

while { tr>
20:24:28 Error Undefined variable in expression: _position
20:24:28 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
20:24:28 Error position: <_position, _civilrole]];

};

while { tr>
20:24:28 Error Undefined variable in expression: _position
20:24:28 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
20:24:28 Error position: <_position, _civilrole]];

};

while { tr>
20:24:28 Error Undefined variable in expression: _position
20:24:28 Error in expression < "civil";
_back = _back + [[_civiltype, _position, _civilrole]];

};

while { tr>
20:24:28 Error position: <_position, _civilrole]];

};

while { tr>
20:24:28 Error Undefined variable in expression: _position
20:24:28 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
20:24:28 Error position: <createUnit [_civiltype, (_x select 1), [>
20:24:28 Error 0 elements provided, 3 expected
20:24:28 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>
20:24:28 Error position: <createUnit [_civiltype, (_x select 1), [>
20:24:28 Error 0 elements provided, 3 expected
20:24:28 Error in expression <iviltype = _x select 0;
_civil = _group createUnit [_civiltype, (_x select 1), [>

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

hello,

 

i have done some arma 3/arma2 servers epoch arma 2 .  now i have arma 3 epoch and added this script but like always i mess up the battleye. i got the script restriction error #22,#21 and #96 it might be to much to ask but could someone please tell me how/where to add the the scripts to the battleye and if it also needs to be in the publicvariable or not.

 

thank you

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...