Jump to content
  • 0

Animated Ikea truck? Moving marked patrols?


DynaMike

Question

I would like a MOVING truck (maybe with a live updated marker) to move from 1 position to another on the map.  

The objective would be to intercept and shoot the driver (and co-driver) and then grabbing the vehicle with the loot INSIDE.

If vehicle gets destroyed then some loot will spawn around like a chopper crash.

 

I like the idea of a moving marker (saw it in Wasteland) but it could also just be start and end position shown.

 

Both start position and end position should be randomly set.  So players are able to chase the vehicle but as such not knowing where the mission starts.

 

 

I have tried editing the existing animated crash spawner but had no luck.  Anyone willing or wanting to take on this task?  Creating this would result in unlimited variations for server owners.  They will be able to create missions based on this and activating their players even more.  ATV/MC patrols getting chased.  Policecar on its way to apprehend criminals - intercept and protect your friends = loot

 

The possibilities are MANY.

 

Should be run as an Epoch event.

Link to comment
Share on other sites

Recommended Posts

  • 0

The problem is currently the unit creation

 

wasteland (the version that dayz servers used) uses civilian units and adds them into the vehicles

 

the problem behind this is that they wont attack you on their own, since survivors and units would be on the same faction.

Iam trying to sort this out using opfor, but I want to have a look into the wicked AI unitcreation first.

 

The overall scripts is basically the same as in Wasteland, just using random locations to go instead of the Mission and town markers

Link to comment
Share on other sites

  • 0

ah Cmon ^^, put all your brains together, look at some excisting scripts and try to make it boys ^^.

 

it's pretty doable if not saing easy ^^.

 

Some tips i can give u just by head. 

  • Busscript on the coastline
  • Vehicle patrol script (DZAI i think).
  • DZAI updating of mission marker to keep track of the truck :)
  • Add EAST characters in the truck. 
  • Add timer to delete the convoy after x minuts 
Link to comment
Share on other sites

  • 0

as far as the convoy timer... not quite what im looking for. If you noticed the brown marker in the pic from an earlier post, that is the target destination. Once the AI got there, they parked, got out, and patrolled the area.

 

Any tips for that? 0=]

Link to comment
Share on other sites

  • 0

Taken from the last Wicked AI commit.

 

if (isServer) then {

	_this spawn {

		private["_vehicle","_position","_unitgroup","_waypoint_data","_num_waypoints","_leader","_count_wp","_waypoints","_waypoint_prev","_msg","_wp"];

		_vehicle 		= _this select 0;
		_position 		= _this select 1;
		_unitgroup 		= _this select 2;
		_waypoint_data 	= _this select 3;
		_num_waypoints 	= _this select 4;
		_leader			= leader _unitgroup;
		_count_wp		= count _waypoint_data;
		_waypoint_prev	= "";

		_vehicle setvehiclelock "UNLOCKED";

		_unitgroup setBehaviour "COMBAT";
		_unitgroup setCombatMode "YELLOW";

		{

			if(_leader == _x) then {
				_x assignAsDriver _vehicle;
				_x action["getInDriver",_vehicle];
				diag_log format["WAI: %1 assigned as driver",_x];
			} else {

				if((_vehicle emptyPositions "GUNNER") > 0) then {
					_x assignAsGunner _vehicle;
					_x moveInGunner _vehicle;

					diag_log format["WAI: %1 assigned as gunner",_x];
				} else {
					_x moveInCargo _vehicle;
					diag_log format["WAI: %1 assigned as cargo",_x];
				};

			};

		} forEach units _unitgroup;

		waitUntil {(_vehicle emptyPositions "DRIVER" == 0)};	// Wait until driver gets inside vehicle

		diag_log format["WAI: Driver is inside vehicle, continue.."];

		[_vehicle,_unitgroup] spawn {

			private["_vehicle","_unitgroup","_runmonitor"];

			_vehicle 	= _this select 0;
			_unitgroup 	= _this select 1;
			_runmonitor = true;

			while {(canMove _vehicle && _runmonitor)} do {
				if (fuel _vehicle < 0.2) then { _vehicle setfuel 1; };
				if (!(alive leader _unitgroup)) then {
					diag_log "WAI: Driver was killed, ejecting AI and removing waypoints.";
					_runmonitor = false;
				};
				sleep .5;
			};

			if(_runmonitor) then {
				diag_log "WAI: Vehicle became undriveable, ejecting crew.";
			};

			deleteWaypoint [_unitgroup, all];

			waitUntil { (speed _vehicle < 10) };	// Wait until vehicle slows down before ejecting crew

			{
				_x action ["eject",vehicle _x];
			} forEach crew _vehicle;

			_wp = _unitgroup addWaypoint [(getPos _vehicle),0];
			_wp setWaypointType "GUARD";
			_wp setWaypointBehaviour "COMBAT";

		};

		for "_i" from 1 to _num_waypoints do {

			_rand_nr 	= ceil(random((_count_wp - _i)));
			_waypoint 	= (_waypoint_data select _rand_nr);
			_waypoint_data set[_rand_nr,-1];
			_waypoint_data	= _waypoint_data - [-1];
			
			_wp = _unitgroup addWaypoint [(_waypoint select 1),0];
			
			if(_i == _num_waypoints) then { 
				_wp setWaypointType "GUARD";
			} else { 
				_wp setWaypointType "MOVE";
			};

			_wp setWaypointBehaviour "CARELESS";
			_wp setWaypointCombatMode "YELLOW";

			if(_waypoint_prev != "") then {
				_msg = format["[RADIO] The patrol arrived at %1, heading towards %2",_waypoint_prev,(_waypoint select 0)];
			} else {
				_msg = format["[RADIO] The patrol is seen moving towards %1",(_waypoint select 0)];
			};
			
			sleep random(10);
			
			if (wai_radio_announce) then {
				RemoteMessage = ["radio",_msg];
				publicVariable "RemoteMessage";
			} else {
				[nil,nil,rTitleText,_msg,"PLAIN",10] call RE;
			};
			
			waitUntil{sleep 1; (_vehicle distance (_waypoint select 1) < 30)};

			_waypoint_prev = (_waypoint select 0);
		};

	};

};
Guess you could enhance it to suit your needs :) All the code is there to suit your needs.
Link to comment
Share on other sites

  • 0

Taken from the last Wicked AI commit.

 

if (isServer) then {

	_this spawn {

		private["_vehicle","_position","_unitgroup","_waypoint_data","_num_waypoints","_leader","_count_wp","_waypoints","_waypoint_prev","_msg","_wp"];

		_vehicle 		= _this select 0;
		_position 		= _this select 1;
		_unitgroup 		= _this select 2;
		_waypoint_data 	= _this select 3;
		_num_waypoints 	= _this select 4;
		_leader			= leader _unitgroup;
		_count_wp		= count _waypoint_data;
		_waypoint_prev	= "";

		_vehicle setvehiclelock "UNLOCKED";

		_unitgroup setBehaviour "COMBAT";
		_unitgroup setCombatMode "YELLOW";

		{

			if(_leader == _x) then {
				_x assignAsDriver _vehicle;
				_x action["getInDriver",_vehicle];
				diag_log format["WAI: %1 assigned as driver",_x];
			} else {

				if((_vehicle emptyPositions "GUNNER") > 0) then {
					_x assignAsGunner _vehicle;
					_x moveInGunner _vehicle;

					diag_log format["WAI: %1 assigned as gunner",_x];
				} else {
					_x moveInCargo _vehicle;
					diag_log format["WAI: %1 assigned as cargo",_x];
				};

			};

		} forEach units _unitgroup;

		waitUntil {(_vehicle emptyPositions "DRIVER" == 0)};	// Wait until driver gets inside vehicle

		diag_log format["WAI: Driver is inside vehicle, continue.."];

		[_vehicle,_unitgroup] spawn {

			private["_vehicle","_unitgroup","_runmonitor"];

			_vehicle 	= _this select 0;
			_unitgroup 	= _this select 1;
			_runmonitor = true;

			while {(canMove _vehicle && _runmonitor)} do {
				if (fuel _vehicle < 0.2) then { _vehicle setfuel 1; };
				if (!(alive leader _unitgroup)) then {
					diag_log "WAI: Driver was killed, ejecting AI and removing waypoints.";
					_runmonitor = false;
				};
				sleep .5;
			};

			if(_runmonitor) then {
				diag_log "WAI: Vehicle became undriveable, ejecting crew.";
			};

			deleteWaypoint [_unitgroup, all];

			waitUntil { (speed _vehicle < 10) };	// Wait until vehicle slows down before ejecting crew

			{
				_x action ["eject",vehicle _x];
			} forEach crew _vehicle;

			_wp = _unitgroup addWaypoint [(getPos _vehicle),0];
			_wp setWaypointType "GUARD";
			_wp setWaypointBehaviour "COMBAT";

		};

		for "_i" from 1 to _num_waypoints do {

			_rand_nr 	= ceil(random((_count_wp - _i)));
			_waypoint 	= (_waypoint_data select _rand_nr);
			_waypoint_data set[_rand_nr,-1];
			_waypoint_data	= _waypoint_data - [-1];
			
			_wp = _unitgroup addWaypoint [(_waypoint select 1),0];
			
			if(_i == _num_waypoints) then { 
				_wp setWaypointType "GUARD";
			} else { 
				_wp setWaypointType "MOVE";
			};

			_wp setWaypointBehaviour "CARELESS";
			_wp setWaypointCombatMode "YELLOW";

			if(_waypoint_prev != "") then {
				_msg = format["[RADIO] The patrol arrived at %1, heading towards %2",_waypoint_prev,(_waypoint select 0)];
			} else {
				_msg = format["[RADIO] The patrol is seen moving towards %1",(_waypoint select 0)];
			};
			
			sleep random(10);
			
			if (wai_radio_announce) then {
				RemoteMessage = ["radio",_msg];
				publicVariable "RemoteMessage";
			} else {
				[nil,nil,rTitleText,_msg,"PLAIN",10] call RE;
			};
			
			waitUntil{sleep 1; (_vehicle distance (_waypoint select 1) < 30)};

			_waypoint_prev = (_waypoint select 0);
		};

	};

};
Guess you could enhance it to suit your needs :) All the code is there to suit your needs.

 

Sweet, is this going into compiles for a new type of static mission? Just curious since it has no completion indicator that i can tell, just log msgs for rpt 

Or am i retarded and its already in 2.2.0 v3 (what im using) somewhere?

Link to comment
Share on other sites

  • 0

Its a new type of dynamic mission. Check the github testbranch for the mission file :)

I see now. going to play with this on my test server =] 

It may solve my issue with my C130/Cargo plane mission clearing once i remove the crate. 

 

As far the script from scratch, im stumped. Every time i try to alter the bus script i just break it lol.

Link to comment
Share on other sites

  • 0

Where's the GITHUB test branch?  When I got to the download links in the main WAI thread, it just downloads a ZIP file.  And a Google search only found the GITHUB link for 2.1.4.

 

I've been wanting to set up dynamic missions for a while, as well as static missions where the spawn locations are semi-random, being picked from a location array.  I have a Sector B on our Epoch Overwatch Origins server and have machine gunners on the wall (among other places) but players know where they are.  Making them able to spawn into one of several locations will make it more challenging.  Haven't figured out how to do that yet either.

 

Bob

Link to comment
Share on other sites

  • 0

 

 

 

ah Cmon ^^, put all your brains together, look at some excisting scripts and try to make it boys ^^.

 

it's pretty doable if not saing easy ^^.

 

Some tips i can give u just by head. 

  • Busscript on the coastline
  • Vehicle patrol script (DZAI i think).
  • DZAI updating of mission marker to keep track of the truck :)
  • Add EAST characters in the truck. 
  • Add timer to delete the convoy after x minuts 

 

 

you might just be able to put the Gear script line into the DZAI Vehicle patrol script 

Link to comment
Share on other sites

  • 0

hi there,

i installed the testbranch, and tried to run the "convoy mission" (copy/paste from f3cuk post)  but rpt gives me an error:

15:22:20 Error in expression <movingconvoy.sqf"
if (isServer) then {

_this spawn {

private["_vehicle","_posi>
15:22:20   Error position: <_this spawn {

private["_vehicle","_posi>
15:22:20   Error Nicht definierte Variable in Ausdruck: _this
15:22:20 File z\addons\dayz_server\WAI\missions\hero\movingconvoy.sqf, line 3

can anyone help me with this please?

Link to comment
Share on other sites

  • 0

hi schwede,

i didnt call it anywhere in special, i just put the script as movingconvoy.sqf inside the hero mission folder.

in WIA/config i commented out the other missions  and only added:

 

wai_hero_missions            = [["movingconvoy",100]];

 

 

is there another way to make it work?

greetings ryker

Link to comment
Share on other sites

  • 0

ok, well why not try to make it in the same structure as the original missions without the __this spawn { ?

if (isServer) then {


		private["_vehicle","_position","_unitgroup","_waypoint_data","_num_waypoints","_leader","_count_wp","_waypoints","_waypoint_prev","_msg","_wp"];

		_vehicle 		= _this select 0;
		_position 		= _this select 1;
		_unitgroup 		= _this select 2;
		_waypoint_data 	= _this select 3;
		_num_waypoints 	= _this select 4;
		_leader			= leader _unitgroup;
		_count_wp		= count _waypoint_data;
		_waypoint_prev	= "";

		_vehicle setvehiclelock "UNLOCKED";

		_unitgroup setBehaviour "COMBAT";
		_unitgroup setCombatMode "YELLOW";

		{

			if(_leader == _x) then {
				_x assignAsDriver _vehicle;
				_x action["getInDriver",_vehicle];
				diag_log format["WAI: %1 assigned as driver",_x];
			} else {

				if((_vehicle emptyPositions "GUNNER") > 0) then {
					_x assignAsGunner _vehicle;
					_x moveInGunner _vehicle;

					diag_log format["WAI: %1 assigned as gunner",_x];
				} else {
					_x moveInCargo _vehicle;
					diag_log format["WAI: %1 assigned as cargo",_x];
				};

			};

		} forEach units _unitgroup;

		waitUntil {(_vehicle emptyPositions "DRIVER" == 0)};	// Wait until driver gets inside vehicle

		diag_log format["WAI: Driver is inside vehicle, continue.."];

		[_vehicle,_unitgroup] spawn {

			private["_vehicle","_unitgroup","_runmonitor"];

			_vehicle 	= _this select 0;
			_unitgroup 	= _this select 1;
			_runmonitor = true;

			while {(canMove _vehicle && _runmonitor)} do {
				if (fuel _vehicle < 0.2) then { _vehicle setfuel 1; };
				if (!(alive leader _unitgroup)) then {
					diag_log "WAI: Driver was killed, ejecting AI and removing waypoints.";
					_runmonitor = false;
				};
				sleep .5;
			};

			if(_runmonitor) then {
				diag_log "WAI: Vehicle became undriveable, ejecting crew.";
			};

			deleteWaypoint [_unitgroup, all];

			waitUntil { (speed _vehicle < 10) };	// Wait until vehicle slows down before ejecting crew

			{
				_x action ["eject",vehicle _x];
			} forEach crew _vehicle;

			_wp = _unitgroup addWaypoint [(getPos _vehicle),0];
			_wp setWaypointType "GUARD";
			_wp setWaypointBehaviour "COMBAT";

		};

		for "_i" from 1 to _num_waypoints do {

			_rand_nr 	= ceil(random((_count_wp - _i)));
			_waypoint 	= (_waypoint_data select _rand_nr);
			_waypoint_data set[_rand_nr,-1];
			_waypoint_data	= _waypoint_data - [-1];
			
			_wp = _unitgroup addWaypoint [(_waypoint select 1),0];
			
			if(_i == _num_waypoints) then { 
				_wp setWaypointType "GUARD";
			} else { 
				_wp setWaypointType "MOVE";
			};

			_wp setWaypointBehaviour "CARELESS";
			_wp setWaypointCombatMode "YELLOW";

			if(_waypoint_prev != "") then {
				_msg = format["[RADIO] The patrol arrived at %1, heading towards %2",_waypoint_prev,(_waypoint select 0)];
			} else {
				_msg = format["[RADIO] The patrol is seen moving towards %1",(_waypoint select 0)];
			};
			
			sleep random(10);
			
			if (wai_radio_announce) then {
				RemoteMessage = ["radio",_msg];
				publicVariable "RemoteMessage";
			} else {
				[nil,nil,rTitleText,_msg,"PLAIN",10] call RE;
			};
			
			waitUntil{sleep 1; (_vehicle distance (_waypoint select 1) < 30)};

			_waypoint_prev = (_waypoint select 0);
		};

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