Jump to content
  • 0

WAI - search a good vehicle "run over" solution


joe_candy

Question

Hey.. I've a few problems with players who use bugs with vehicles to get loot from the AI. So i like to add a trigger at the WAI marker, which destroy player vehicle if they drive into the mission area.

But there is a mistake at my idea, so the missions spawns without the trigger...

But there is also no Error at the rpt file.

Hope someone could help me.

 

There is one of the Mission files with my addet trigger...

//Armed Vehicle
private ["_playerPresent","_cleanmission","_currenttime","_starttime","_missiontimeout","_vehname","_veh","_position","_vehclass","_vehdir","_objPosition","_Trigger1","_Trigger2","_Trigger3"];
_vehclass = armed_vehicle call BIS_fnc_selectRandom;
_vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;
antiauto1 = _Trigger1;
antiauto2 = _Trigger2;
antiauto3 = _Trigger3;
diag_log format["WAI: Mission Armed Vehicle Started At %1",_position];
 _Trigger1 = createTrigger ["EmptyDetector", _position];
 _Trigger1 setTriggerArea [380, 380, 0, false];
 _Trigger1 setTriggerActivation ["ANY", "PRESENT", true];
 _Trigger1 setTriggerTimeout [0, 0, 0, true];
 _Trigger1 setTriggerStatements ["(player distance antiauto1) < 380;", "if ((vehicle player) isKindOf (""Car"")) then {titleText [""Warning, you are near a Mission. Please stop and leave your car or turn back."", ""PLAIN DOWN""];} else {""""};", ""];
 _Trigger2 = createTrigger ["EmptyDetector", _position];
 _Trigger2 setTriggerArea [330, 330, 0, false];
 _Trigger2 setTriggerActivation ["ANY", "PRESENT", true];
 _Trigger2 setTriggerTimeout [0, 0, 0, true];
 _Trigger2 setTriggerStatements ["(player distance antiauto2) < 330;", "if ((vehicle player) isKindOf (""Car"")) then {titleText [""Last Warning! You are near a Mission. Stop your car or turn back!"", ""PLAIN DOWN""];} else {""""};", ""];
 _Trigger3 = createTrigger ["EmptyDetector", _position];
 _Trigger3 setTriggerArea [280, 280, 0, false];
 _Trigger3 setTriggerActivation ["ANY", "PRESENT", true];
 _Trigger3 setTriggerTimeout [0, 0, 0, true];
 _Trigger3 setTriggerStatements ["(player distance antiauto3) < 280;", "if ((vehicle player) isKindOf (""Car"")) then {titleText [""You have been warned several times!"", ""PLAIN DOWN""]; player setdamage 1;} else {""""};", ""];
//Chain Bullet Box
_box = createVehicle ["USBasicWeaponsBox",[(_position select 0),(_position select 1) + 5,0], [], 0, "CAN_COLLIDE"];
[_box] call Chain_Bullet_Box;
//Armed Land Vehicle
_veh = createVehicle [_vehclass,_position, [], 0, "CAN_COLLIDE"];
_vehdir = round(random 360);
_veh setDir _vehdir;
_veh setVariable ["ObjectID","1",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh];
diag_log format["WAI: Mission Armed Vehicle spawned a %1",_vehname];
_objPosition = getPosATL _veh;
//[_veh,[_vehdir,_objPosition],_vehclass,true,"0"] call custom_publish;
//Troops
_rndnum = round (random 3) + 3;
[[_position select 0, _position select 1, 0],                  //position
_rndnum,        //Number Of units
1,           //Skill level 0-1. Has no effect if using custom skills
"Random",         //Primary gun set number. "Random" for random weapon set.
4,        //Number of magazines
"",        //Backpack "" for random or classname here.
"Ins_Soldier_Sapper",     //Skin "" for random or classname here.
"Random",      //Gearset number. "Random" for random gear set.
true       // Mission true or false
] call spawn_group;
[[_position select 0, _position select 1, 0],                  //position
4,        //Number Of units
1,           //Skill level 0-1. Has no effect if using custom skills
"Random",         //Primary gun set number. "Random" for random weapon set.
4,        //Number of magazines
"",        //Backpack "" for random or classname here.
"Ins_Soldier_Sapper",     //Skin "" for random or classname here.
"Random",      //Gearset number. "Random" for random gear set.
true       // Mission true or false
] call spawn_group;
[[_position select 0, _position select 1, 0],                  //position
4,        //Number Of units
1,           //Skill level 0-1. Has no effect if using custom skills
"Random",         //Primary gun set number. "Random" for random weapon set.
4,        //Number of magazines
"",        //Backpack "" for random or classname here.
"Ins_Soldier_Sapper",        //Skin "" for random or classname here.
"Random",      //Gearset number. "Random" for random gear set.
true      // mission true
] call spawn_group;
[[_position select 0, _position select 1, 0],                  //position
4,        //Number Of units
1,           //Skill level 0-1. Has no effect if using custom skills
"Random",         //Primary gun set number. "Random" for random weapon set.
4,        //Number of magazines
"",        //Backpack "" for random or classname here.
"Ins_Soldier_Sapper",        //Skin "" for random or classname here.
"Random",      //Gearset number. "Random" for random gear set.
true      // mission true
] call spawn_group;
//Turrets
[[[(_position select 0), (_position select 1) + 10, 0]], //position(s) (can be multiple).
"M2StaticMG",             //Classname of turret
1,       //Skill level 0-1. Has no effect if using custom skills
"Ins_Soldier_Sapper",              //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 or false
] call spawn_static;
 
[_position,_vehname] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
[nil,nil,rTitleText,"Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!", "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;
 waitUntil
 {
  sleep 5;
  _playerPresent = false;
  {if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;
  (_playerPresent)
 };
 diag_log format["WAI: Mission Armed vehicle Ended At %1",_position];
 [nil,nil,rTitleText,"Survivors have secured the armed vehicle!", "PLAIN",10] call RE;
} else {
 clean_running_mission = True;
 deleteVehicle _veh;
 deleteVehicle _box;
 deleteVehicle _Trigger1;
 deleteVehicle _Trigger2;
 deleteVehicle _Trigger3;
 {_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;
  deleteVehicle _Trigger1;
  deleteVehicle _Trigger2;
  deleteVehicle _Trigger3;
  sleep 0.05;
 }; 
 } forEach allUnits;
 
 diag_log format["WAI: Mission Armed vehicle Timed Out At %1",_position];
 [nil,nil,rTitleText,"Survivors did not secure the armed vehicle in time!", "PLAIN",10] call RE;
};
missionrunning = false;

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

For one, you are over-complicating this by using triggers when you already have a while do loop in the mission script you can modify.

Two, WAI doesn't check if all the units are dead, it only checks for player distance. This means a player would have to run up to the mission on foot to trigger it complete, and then drive up.

Three, you only have the mission triggers being deleted when the mission times out, not when its completed, so with the current code even after a player completes a mission, they would still blow up, and the triggers would still be there until the server restarts.

And finally four, WAI already has anti-vehicle. It's called RPGs and two M2 .50BMG turrets.

 

Most people consider anything that kills the player to be pretty extreme as far as punishment goes, especially for something that doesn't make logical sense since there is already anti-vehicle measures they would have to deal with, so I don't think very many people will be willing to help you with this. Even if your server has tanks, two RPGs to the same side will disable the tracks and prevent the tank from going anywhere, and a disabled tank to me is not worth a breifcase or two.

Link to comment
Share on other sites

  • 0

WAI already has anti-vehicle. It's called RPGs and two M2 .50BMG turrets.

 

Most people consider anything that kills the player to be pretty extreme as far as punishment goes, especially for something that doesn't make logical sense since there is already anti-vehicle measures they would have to deal with, so I don't think very many people will be willing to help you with this. Even if your server has tanks, two RPGs to the same side will disable the tracks and prevent the tank from going anywhere, and a disabled tank to me is not worth a breifcase or two.

 

Hey...

 

The anti-vehicle of WAI last time doesn't work.... I've addet also MAAWS and M107 to the AI... First week it works fine.... after a time some guys begin to run over the AI and could loot the high weapons (i use custom loottable, so they can't find this weapons somewhere else).

 

I'm also no friend of such a extreme Player kill Trigger. I'm just looking for a solution for the probem.

First time i try a Trigger with "vehicle setdamage 1" but this also doesn't work.

 

Today i try to import the "DZMS run over" configuration to WAI... but until now it isn't work.....

 

*Edit*

 

ok... find my mistake. Now the "run over" Configuration works fine and i don't need so a extreme trigger... ^^

This Thread could be deletet.

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
  • Discord

×
×
  • Create New...