Jump to content
john123

AI not spawning when dedicated

Recommended Posts

Hi, I've got a feature whereby an ai spawns and drives a truck to a location which works fine when hosted locally but the driver does not spawn on when dedicated. i've got disabledAI=1; in my mission.sqm but i don't think this is the issue?

heres the script.

 

#include "..\..\script_macros.hpp"
_conv = createGroup west;
_location = [5790.634, 8577.739];
covdone = 0;

while {true} do {
	sleep 1800;
	_convlocation = selectRandom [[9206.708, 12600.52, 0], [7249.311, 1313.403, 0], [10455.72, 6416.583, 0]];
	_truck = "B_Truck_01_covered_F" createVehicle _convlocation;
	_driver = _conv createUnit ["B_RangeMaster_F", _convlocation,[], 0, "NONE"];
	_driver moveInDriver _truck;
	_conv setBehaviour "SAFE";
	_driver doMove _location;
	
	_Bmar = createMarker ["CV", player];
	_Bmar setMarkerType "hd_dot";
	"CV" setMarkerText "Goverment Convey";
	"CV" setMarkerColor "ColorRed";
	[1,format["The Goverment Convey has arrived and is on it's way to police base"]] remoteExec ["life_fnc_broadcast",0];
	_truck addAction["Steal Cargo", life_fnc_convoeysteal, "",0,false,false,"", 'playerSide isEqualTo civilian'];
	while {alive _truck} do {
		"CV" setMarkerPos (getPos _truck);
		sleep 3;
		if (_truck distance _location < 8) then {
			covdone = 1;
			deleteVehicle _truck;
			deleteVehicle _driver;
		};
	};
	deleteMarker "CV";
	if (covdone == 1) then {
		[1,format["The Goverment Convey made it to police base and delivered £15000"]] remoteExec ["life_fnc_broadcast",0];
		[] remoteExecCall ["Life_fnc_convoeysteal",west];
	}else{
		[1,format["The Goverment Convey didn't make it to police base"]] remoteExec ["life_fnc_broadcast",0];
	};
	covdone = 0;
};

 

Edited by john123

Share this post


Link to post
Share on other sites

i was running another script from there for something else and when using spawn it was causing and error however remote exec didn't. I shall try spawn

  • Confused 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...