Jump to content

Re-Worked WAI 0.173 - Supported System


Recommended Posts

Has anyone managed to "port" this to run in MPMission? I have it running in mine but I have a few problems. I can't get the markers to work which is my major problem right now.

I'm running this on a HC and everything is working well except the markers.

Link to comment
Share on other sites

I use your great playerstats.sqf and your WAI both GREAT
how would I add restart time to admin debug and FPS to player debug ???

oh and how do I use spoilers so I dont take up this whole page ??

if ((getPlayerUID player) in ["77953158","92319750","122799686","79440198","97846342","68942406","139162630","79087558","73019398","10419840","128121606","11259648","10377664"]) then { 
	  
	  hintSilent parseText format ["
	<t size='0.95' font='Bitstream' align='left' >[%18]</t><t size='0.95' font='Bitstream' align='right'>[FPS: %10]</t><br/>
	<t size='0.95' font='Bitstream' align='center' color='#FFBF00'>Survived %7 Days</t><br/>
	<t size='0.95' font='Bitstream' align='left' >Players: %8</t><t size='0.95 'font='Bitstream' align='right'>Within 500m: %11</t><br/>
	<t size='0.95' font='Bitstream' align='left' >Vehicles:</t><t size='0.95' font='Bitstream'align='right'>%13(%14)</t><br/>
	<t size='0.95' font='Bitstream' align='left'>Air: %16</t><t size='0.95' font='Bitstream'align='right'>Sea: %23</t><br/>
	<t size='0.95' font='Bitstream' align='left' >All Bikes: %15</t><t size='0.95' font='Bitstream'align='right'>Cars: %17</t><br/>
	<t size='0.95' font='Bitstream' align='left' >Zombies (alive/total): </t><t size='0.95' font='Bitstream' align='right'>%20(%19)</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%2</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='0.95' font='Bitstream' align='right'>%3</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
	<t size='0.95' font='Bitstream' align='left' >GPS: %22</t><t size='0.95' font='Bitstream' align='right'>DIR: %24</t><br/>
	<t size='0.95'font='Bitstream'align='center' >%21</t><br/>",
	(name player),
	(player getVariable['zombieKills', 0]), 
	(player getVariable['headShots', 0]),
	(player getVariable['humanKills', 0]),
	(player getVariable['banditKills', 0]),
	(player getVariable['humanity', 0]),
	(dayz_skilllevel),
	(count playableUnits),
	r_player_blood,
	(round diag_fps),
	(({isPlayer _x} count (getPos vehicle player nearEntities [["AllVehicles"], 500]))-1),
	viewdistance,
	(count([6800, 9200, 0] nearEntities [["StaticWeapon","Car","Motorcycle","Tank","Air","Ship"],25000])),
	count vehicles,
	(count([6800, 9200, 0] nearEntities [["Motorcycle"],25000])),
	(count([6800, 9200, 0] nearEntities [["Air"],25000])),
	(count([6800, 9200, 0] nearEntities [["Car"],25000])),
	(gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'displayName')),
	(count entities "zZombie_Base"),
	({alive _x} count entities "zZombie_Base"),
	(getPosASL player),
	(mapGridPosition getPos player),
	(count([6800, 9200, 0] nearEntities [["Ship"],25000])),
	(round(getDir player))
];

} else {

hintSilent parseText format ["
	<t size='1.4' font='Bitstream' align='center' color='#DDDDDD'>Total Calamity DayZ Epoch</t><br/>
	<t size='1.15' font='Bitstream' align='center' color='#DDDDDD'>%9 Players Online</t><br/><br/>
	<t size='1.25' font='Bitstream' color='#5882FA'>%1</t><br/><br/>
	<t size='1.20' font='Bitstream' color='#5882FA'>Survived %7 Days</t><br/><br/>
	<t size='1.15' font='Bitstream' align='left'>Zombies Killed: </t><t size='1.15' font='Bitstream' align='right'>%2</t><br/>
	<t size='1.15' font='Bitstream' align='left'>Headshots: </t><t size='1.15' font='Bitstream' align='right'>%3</t><br/>
	<t size='1.15' font='Bitstream' align='left'>Murders: </t><t size='1.15' font='Bitstream' align='right'>%4</t><br/>
	<t size='1.15' font='Bitstream' align='left'>Bandits Killed: </t><t size='1.15' font='Bitstream' align='right'>%5</t><br/><br/>
	<t size='1.15' font='Bitstream' align='left'>Humanity: </t><t size='1.15' font='Bitstream' align='right'>%6</t><br/>
	<t size='1.15' font='Bitstream' align='left' color='#C70000'>Blood: </t><t size='1.15' font='Bitstream' align='right' color='#C70000'>%8</t><br/><br/>
	<t size='1' font='Bitstream' align='center' color='#16DB57'>Restart in %10 minutes</t><br/><br/>
	<t size='1' font='Bitstream' align='center' color='#DDDDDD'>NO SIDE VOICE</t><br/>
	<t size='1' font='Bitstream' align='center' color='#DDDDDD'>TS roguesgallery.teamspeak3.com password saintpeter</t><br/>",
	(name player),
	(player getVariable['zombieKills', 0]),
	(player getVariable['headShots', 0]),
	(player getVariable['humanKills', 0]),
	(player getVariable['banditKills', 0]),
	(player getVariable['humanity', 0]),
	(dayz_Survived),
	(r_player_blood),
	(count playableUnits),
	(360-(round(serverTime/60)))
];};

Link to comment
Share on other sites

Is it possible to generate a group af AI, that travels arround the map?

 

i want to have different groups with different skills (survivors, heroes, thugs, bandits, mafia, selfdefence groups, soldiers, special foces)

 

there shold spawn at least one group of each, but there might spawn several.

 

i dont want a complete setup, i just want help to get it done, where do i edit (all the places) because i hate that after 100+ files edited, there is a file that needs to be changed also :-)

 

 

Is it possible to create non bandits?

 

i want to create a hostage scenario, where there is a group of bandits and som hostages.

I want to make humanity drop 2000-5000 if a hostage is killed, so i have to very accurate, as allways ;-)

 

The scenario does not have the hostagetakers to kill the hostages, but if the mission times out, yhe text shows that the hostages are killed.

 

At the moment i have 6-8 new missions, based on the original missions, so i can edit, add and remove stuff from the missions already in Wai.

 

Anybody?

Link to comment
Share on other sites

Is it possible to move my "[] ExecVM "\z\addons\dayz_server\WAI\customSpawns.sqf";" from \WAI\init.sqf to my init.sqf in my MPmission folder?

I just want to rename my customspawn according to each map fx customspawmLingor.sqf and call the file from my MPmission\init.sqf.

 

I still want the files to stay in the WAI dir.

Link to comment
Share on other sites

Is there anyway to have a customSpawn to each map?

My guess was that i couldt create CustomSpawn_Chernarus.sqf and CustomSpawn_Lingor.sqf and so on, and from my init.sqf (in my mission folder) add:

 

//Load custom spawns
[] ExecVM "\z\addons\dayz_server\WAI\CustomSpawns_Chernarus.sqf";
 
But it cant find my file.
 
Is there anyway to make the customspawn just launch the "correct" spawn according to the instance?
Link to comment
Share on other sites

So I've read through some of this thread (it's quite long) and I've seen it asked several times now but haven't seen it definitively answered. Is there a way to make the patrols respawn yet? It seems like such a simple thing, Sarge AI has it, it has a completely dynamic spawning system that spans the whole map, can be a little laggy at times but I'd really love to see at lease some of Sarge's capability for randomness added to this system. If not dynamically spawning patrols at least the ability to respawn the statically defined ones.

Link to comment
Share on other sites

AI not attacking players on Namalsk server! Anyone run into that or know what may be causing it?

It's strange, I use WAI on Chernarus and Panthera - not a single problem!

On Namalsk though, it's like they somehow switch to blufor/west! (not sure if that's what's happening, but they just won't attack!)

No obvious errors in RPT logs either :(

Link to comment
Share on other sites

Do your AI spawn with the default bandit skin? Probably a faction issue where they see a player in a bandit skin and consider them a friendly. I've always changed my AI to spawn with unobtainable skins (US Delta force, UN soldier, etc) and I've not seen this issue.

Link to comment
Share on other sites

Good tip! I'll have to check this and try it, thanks Fr1nk! :D

Do your AI spawn with the default bandit skin? Probably a faction issue where they see a player in a bandit skin and consider them a friendly. I've always changed my AI to spawn with unobtainable skins (US Delta force, UN soldier, etc) and I've not seen this issue.

Link to comment
Share on other sites

Some players reported an issue in the IKEA convoy mission.

They said there is an invisible static gunner.

 

This is the mission:

//Construction Supply

private ["_objPosition3","_objPosition2","_vehclass3","_vehclass2","_veh3","_veh2","_playerPresent","_cleanmission","_currenttime","_starttime","_missiontimeout","_vehname","_veh","_position","_vehclass","_vehdir","_objPosition"];

_vehclass = cargo_trucks call BIS_fnc_selectRandom;
_vehclass2 = refuel_trucks call BIS_fnc_selectRandom;
_vehclass3 = military_unarmed call BIS_fnc_selectRandom;

_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;
diag_log format["WAI: Mission Convoy Started At %1",_position];

//Construction Supply Box
_box = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];
[_box] call Construction_Supply_box;

_veh = createVehicle [_vehclass,[(_position select 0) - 15,(_position select 1),0], [], 0, "CAN_COLLIDE"];
_vehdir = round(random 360);
_veh setDir _vehdir;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
_veh setVariable ["ObjectID","1",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh];
diag_log format["WAI: Mission Convoy spawned a %1",_vehclass];

_objPosition = getPosATL _veh;

_veh2 = createVehicle [_vehclass2,[(_position select 0) + 15,(_position select 1),0], [], 0, "CAN_COLLIDE"];
_veh2 setDir _vehdir;
clearWeaponCargoGlobal _veh2;
clearMagazineCargoGlobal _veh2;
_veh2 setVariable ["ObjectID","1",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh2];
diag_log format["WAI: Mission Convoy spawned a %1",_vehclass2];

_objPosition2 = getPosATL _veh2;

_veh3 = createVehicle [_vehclass3,[(_position select 0) + 30,(_position select 1),0], [], 0, "CAN_COLLIDE"];
_veh3 setDir _vehdir;
clearWeaponCargoGlobal _veh3;
clearMagazineCargoGlobal _veh3;
_veh3 setVariable ["ObjectID","1",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh3];
diag_log format["WAI: Mission Convoy spawned a %1",_vehclass3];

_objPosition3 = getPosATL _veh3;

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

//Turrets
[[[(_position select 0) + 5, (_position select 1) + 10, 0]], //position(s) (can be multiple).
"M2StaticMG",             //Classname of turret
0.7,                      //Skill level 0-1. Has no effect if using custom skills
"USMC_LHD_Crew_Yellow",                          //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)
true                        // mission true
] call spawn_static;

[[[(_position select 0) - 5, (_position select 1) - 10, 0]], //position(s) (can be multiple).
"M2StaticMG",             //Classname of turret
0.7,                      //Skill level 0-1. Has no effect if using custom skills
"USMC_LHD_Crew_Blue",                          //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)
true                        // mission true
] call spawn_static;

[[[(_position select 0) + 10, (_position select 1) -15, 0]], //position(s) (can be multiple).
"M2StaticMG",             //Classname of turret
0.7,                      //Skill level 0-1. Has no effect if using custom skills
"USMC_LHD_Crew_Yellow",                          //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)
true                        // mission true
] call spawn_static;

//Heli Para Drop
[[(_position select 0),(_position select 1),0],[0,0,0],400,"BAF_Merlin_HC3_D",10,1,"Random",4,"","USMC_LHD_Crew_Blue","Random",False] spawn heli_para;


[_position,"Disabled Convoy"] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
[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;

_missiontimeout = true;
_cleanmission = false;
_playerPresent = false;
_starttime = floor(time);
while {_missiontimeout} do {
    sleep 5;
    _currenttime = floor(time);
    {if((isPlayer _x) AND (_x distance _position <= 150)) then {_playerPresent = true};}forEach playableUnits;
    if (_currenttime - _starttime >= wai_mission_timeout) then {_cleanmission = true;};
    if ((_playerPresent) OR (_cleanmission)) then {_missiontimeout = false;};
};
if (_playerPresent) then {
    [_veh,[_vehdir,_objPosition],_vehclass,true,"0"] call custom_publish;
    [_veh2,[_vehdir,_objPosition2],_vehclass2,true,"0"] call custom_publish;
    [_veh3,[_vehdir,_objPosition3],_vehclass3,true,"0"] call custom_publish;
    waitUntil
    {
        sleep 5;
        _playerPresent = false;
        {if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;
        (_playerPresent)
    };
    diag_log format["WAI: Mission Convoy Ended At %1",_position];
    [nil,nil,rTitleText,"Survivors have secured the building supplies!", "PLAIN",10] call RE;
} else {
    clean_running_mission = True;
    deleteVehicle _veh;
    deleteVehicle _veh2;
    deleteVehicle _veh3;
    deleteVehicle _box;
    {_cleanunits = _x getVariable "missionclean";
    if (!isNil "_cleanunits") then {
        switch (_cleanunits) 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);};
        };
        deleteVehicle _x;
        sleep 0.05;
    };    
    } forEach allUnits;
    
    diag_log format["WAI: Mission Convoy timed out At %1",_position];
    [nil,nil,rTitleText,"Survivors did not secure the convoy in time!", "PLAIN",10] call RE;
};
missionrunning = false;

 

I also having the problem that the vehicles of a mission are not deleted after they timed out.

What to do about this?

 

Thanks!

Link to comment
Share on other sites

Anybody knows how to create a mission, where, in not cleared in time, an action will happen?

 

fx i want a mission, where some scientists is about to detonate a nuke, and if the mission times out, there will be a 10 sec timer, and then the nuke goes off.

 

I think this will force some players to work together, so the area is not radiated.

 

if somebody already have a mission like this, or the princip of "the action thing", and are willing to share, please send me a PM.

 

Thanks!

Link to comment
Share on other sites

I have upgraded Epoch to version 105 and am now getting this error:

 

12:52:46 "_iClass isNil, exiting loot spawn!"
12:52:46 Error in expression <s select _index;
_itemType = _itemTypes select _index;
[_itemType select 0, _ite>
12:52:46   Error position: <select _index;
[_itemType select 0, _ite>
12:52:46   Error Zero divisor
12:52:46 File z\addons\dayz_server\WAI\missions\missions\crash_spawner.sqf, line 73
 
Can anyone help?
Link to comment
Share on other sites

Can anybody confirm that this is the correct list in the different setups for the missions?

Brackets are the value i got in my example

 

The reason is that sometimes AI is paradropped in, without any weapons.

 

TROOPS:

Number of troops (5)

Skill level (0.6)

Gun set (12)

Number of mags (4)

Backpack ("")

Skin ("RU_Policeman_DZ")

Gear set ("Random")

 

Example: [[_position select 0, _position select 1, 0],5,0.6,12,4,"","RU_Policeman_DZ","Random",true] call spawn_group;

 

TURRETS:

Classname ("KORD_high")

Skill level (0.6)

Skin ("RU_Policeman_DZ")

Gun set (12)

Number of mags (2)

Backpack ("")

Gear set ("Random")

 

Example: [[[(_position select 0) + 5, (_position select 1) + 10, 0]],"KORD_high",0.6,"RU_Policeman_DZ",12,2,"","Random",true] call spawn_static;

 

PARADROP:

Activation distance (500)

Classname ("BAF_Merlin_HC3_D")

Number of troops (10)

Skill (1)

Gun set (12)

Number of mags (4)

Backpack ("")

Skin ("RU_Policeman_DZ")

Gear set ("Random")

 

Example: [[(_position select 0),(_position select 1),0],[0,0,0],500,"BAF_Merlin_HC3_D",10,1,12,4,"","RU_Policeman_DZ","Random",True] spawn heli_para;

 

Thanks!

Link to comment
Share on other sites

_iClass isNil, exiting loot spawn!"
Error in expression <s select _index;
_itemType = _itemTypes select _index;
[_itemType select 0, _ite>
Error position: <select _index;
[_itemType select 0, _ite>
Error Zero divisor
 
 
 
 
 
 
 

 

Get the same error with the 1.0.5 update

Link to comment
Share on other sites

Since Arma 112555 my Rpt.log gets spammed by spawning ai choppers. it says :

 

15:03:48 Error in expression <sent = false;
{if((isPlayer _x) AND (_x distance [(_position select 0),(_positio>
15:03:48   Error position: <distance [(_position select 0),(_positio>
15:03:48   Error Type Array, expected Number
15:03:48 File z\addons\dayz_server\WAI\compile\heli_para.sqf, line 33

 

 

and in the compile\heli_para.sqf is written

 

if (!isServer)exitWith{};
private ["_cleanheli","_drop","_helipos","_gunner2","_gunner","_playerPresent","_skillarray","_aicskill","_aiskin","_aigear","_helipatrol","_gear","_skin","_backpack","_mags","_gun","_triggerdis","_startingpos","_aiweapon","_mission","_heli_class","_startPos","_helicopter","_unitGroup","_pilot","_skill","_paranumber","_position","_wp1"];
_position = _this select 0;
_startingpos = _this select 1;
_triggerdis = _this select 2;
_heli_class = _this select 3;
_paranumber = _this select 4;
_skill = _this select 5;
_gun = _this select 6;
_mags = _this select 7;
_backpack = _this select 8;
_skin = _this select 9;
_gear = _this select 10;
_helipatrol = _this select 11;
if (count _this > 12) then {
	_mission = _this select 12;
} else {
	_mission = False;
};
//_delay = _this select 12;
_aiweapon = [];
_aigear = [];
_aiskin = "";
_aicskill = [];
_skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];

// wait for player to come into area.
diag_log "WAI: Paradrop Waiting for player";
waitUntil
{
	sleep 10;
	_playerPresent = false;
	{if((isPlayer _x) AND (_x distance [(_position select 0),(_position select 1),0] <= _triggerdis)) then {_playerPresent = true};}forEach playableUnits;
	(_playerPresent)
};
//Delay before chopper spawns in.
//sleep _delay;
//Spawing in Chopper and crew
diag_log format ["WAI: Spawning a %1 with %2 units to be paradropped at %3",_heli_class,_paranumber,_position];
_unitGroup = createGroup east;
_pilot = _unitGroup createUnit ["Bandit1_DZ", [0,0,0], [], 1, "NONE"];
[_pilot] joinSilent _unitGroup;
ai_air_units = (ai_air_units +1);

_helicopter = createVehicle [_heli_class, [(_startingpos select 0),(_startingpos select 1), 100], [], 0, "FLY"];
_helicopter setFuel 1;
_helicopter engineOn true;
_helicopter setVehicleAmmo 1;
_helicopter flyInHeight 150;
_helicopter addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];

_pilot assignAsDriver _helicopter;
_pilot moveInDriver _helicopter;

_gunner = _unitGroup createUnit ["Bandit1_DZ", [0,0,0], [], 1, "NONE"];
_gunner assignAsGunner _helicopter;
_gunner moveInTurret [_helicopter,[0]];
[_gunner] joinSilent _unitGroup;
ai_air_units = (ai_air_units +1);

_gunner2 = _unitGroup createUnit ["Bandit1_DZ", [0,0,0], [], 1, "NONE"];
_gunner2 assignAsGunner _helicopter;
_gunner2 moveInTurret [_helicopter,[1]];
[_gunner2] joinSilent _unitGroup;
ai_air_units = (ai_air_units +1);

{_pilot setSkill [_x,1]} forEach _skillarray;
{_gunner setSkill [_x,0.7]} forEach _skillarray;
{_gunner2 setSkill [_x,0.7]} forEach _skillarray;
{_x addweapon "Makarov";_x addmagazine "8Rnd_9x18_Makarov";_x addmagazine "8Rnd_9x18_Makarov";} forEach (units _unitgroup);
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_helicopter];
[_helicopter] spawn veh_monitor;

_unitGroup allowFleeing 0;
_unitGroup setBehaviour "CARELESS";
_unitGroup setSpeedMode "FULL";
_unitGroup setCombatMode "RED";

// Add waypoints to the chopper group.
_wp = _unitGroup addWaypoint [[(_position select 0), (_position select 1)], 0];
_wp setWaypointType "MOVE";
_wp setWaypointCompletionRadius 100;

_drop = True;
_helipos = getpos _helicopter;
while {(alive _helicopter) AND (_drop)} do {
	private ["_magazine","_weapon","_weaponandmag","_chute","_para","_pgroup"];
	sleep 1;
	_helipos = getpos _helicopter;
	if (_helipos distance [(_position select 0),(_position select 1),100] <= 200) then {
		_pgroup = createGroup east;
		for "_x" from 1 to _paranumber do {
			_helipos = getpos _helicopter;
			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
			};
			_para = _pgroup createUnit [_aiskin, [0,0,0], [], 1, "PRIVATE"];
			if (_backpack == "") then {
				_aipack = ai_packs call BIS_fnc_selectRandom;
			} else {
				_aipack = _backpack
			};
			_para enableAI "TARGET";
			_para enableAI "AUTOTARGET";
			_para enableAI "MOVE";
			_para enableAI "ANIM";
			_para enableAI "FSM";
			_para setCombatMode ai_combatmode;
			_para setBehaviour ai_behaviour;
			removeAllWeapons _para;
			removeAllItems _para;
			_para addweapon _weapon;
			for "_i" from 1 to _mags do {_para addMagazine _magazine;};
			_para addBackpack _aipack;
			{_para addMagazine _x} forEach _gearmagazines;
			{_para 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;};
			};
				{_para setSkill [(_x select 0),(_x select 1)]} forEach _aicskill;
			} else {
				{_para setSkill [_x,_skill]} forEach _skillarray;
			};
			ai_ground_units = (ai_ground_units + 1);
			_para addEventHandler ["Killed",{[_this select 0, _this select 1, "ground"] call on_kill;}];
			_chute = createVehicle ["ParachuteEast", [(_helipos select 0), (_helipos select 1), (_helipos select 2)], [], 0, "NONE"];
			_para moveInDriver _chute;
			[_para] joinSilent _pgroup;
			sleep 1.5;
		};
		_drop = false;
		_pgroup selectLeader ((units _pgroup) select 0);
		diag_log format ["WAI: Spawned in %1 ai units for paradrop",_paranumber];
		[_pgroup, _position,_mission] call group_waypoints;
	};
};
if (_helipatrol) then { 
	_wp1 = _unitGroup addWaypoint [[(_position select 0),(_position select 1)], 100];
	_wp1 setWaypointType "SAD";
	_wp1 setWaypointCompletionRadius 150;
	_unitGroup setBehaviour "AWARE";
	_unitGroup setSpeedMode "FULL";
	_unitGroup setCombatMode "RED";
	{_x addEventHandler ["Killed",{[_this select 0, _this select 1, "air"] call on_kill;}];} forEach (units _unitgroup);
} else {
	{_x doMove [(_startingpos select 0), (_startingpos select 1), 100]} forEach (units _unitGroup);
	_unitGroup setBehaviour "CARELESS";
	_unitGroup setSpeedMode "FULL";
	_unitGroup setCombatMode "RED";
	_cleanheli = True;
	while {_cleanheli} do {
		sleep 20;
		_helipos1 = getpos _helicopter;
		if ((_helipos1 distance [(_startingpos select 0),(_startingpos select 1),100] <= 200) OR (!alive _helicopter)) then {
			deleteVehicle _helicopter;
			{deleteVehicle _x} forEach (units _unitgroup);
			sleep 10;
			deleteGroup _unitGroup;
			ai_air_units = (ai_air_units -3);
			diag_log "WAI: Paradrop cleaned up";
			_cleanheli = False;
		};
	};
};

 

That is the part and line 33 is the one with { if ( ( isPlayer _x )

{
	sleep 10;
	_playerPresent = false;
	{if((isPlayer _x) AND (_x distance [(_position select 0),(_position select 1),0] <= _triggerdis)) then {_playerPresent = true};}forEach playableUnits;
	(_playerPresent)
};

Can somebody pls tell me how to fix it ? I just disabled the npc patrol choppers to spawn now, so i can read the logs. but i want them back

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