Jump to content
Sign in to follow this  
Rough Knight

"eject" action in dedicated server

Recommended Posts

Hi guys,

I seem to keep coming across these strange issues I'm sorry I have exhausted myself again with this. No other thread seems to have stated this issue unfortunately. My ejectvehicle script works in the editor, but not on a dedicated server.

I have a ded server running from one core of my machine while I test with my game running on the other core.

I have script to eject a unit from a vehicle once a trigger area is reached. One script executes another.

extraction.sqf

_unit = _this select 0;
_helo = _this select 1;
_wp1 = _this select 2;
_wp2 = _this select 3;
_wait1 = _this select 4;


_group = group _helo;
_unitgrp = group _unit;
_ChopperLeader = leader (group (vehicle _helo));
choppergroup = group _Chopperleader;
_uvehicle = vehicle _unit;

sleep 0.1; 

if (vehicle _unit == _unit) then {} else {nul = [_unit, _uvehicle] execVM "ejectvehicle.sqf"};

then :

ejectvehicle.sqf

//Check position and speed of POWs then eject them from vehicle.

if (!isServer) exitWith {};

private ["_unit", "_vehicle", "_speed", "_height"];

_unit = _this select 0;
_vehicle = _this select 1;
_Speed = speed vehicle _unit;
_Height = getPosatl _unit select 2;
_check = false;

sleep 0.2;

while {!(_check)} do {
		_Speed = speed vehicle _unit;
		_Height = getPosatl _unit select 2;
		sleep 0.1;
		//hint format ["height is %1 \nspeed is %2", _height, _speed];


		// Get POW to exit vehicle if height and speed of vehicle is below 2.
		If ((_Speed < 2) And (_Height < 1.4)) Then {_check = true};

		sleep 1;		
	  };

unassignVehicle _unit;
_unit action ["eject", _vehicle];
getout = true; 
publicVariable "getout";

So any ideas why this is a problem on dedicated server but not from the editor? I appreciate your help as usual.

Thanks

Frosty

Share this post


Link to post
Share on other sites

Trying to run eject on server when the AI are local to the player because they are in his vehicle?

Share this post


Link to post
Share on other sites

OK....that may explain it. What happens is the unit actually joins grpnull when you enter the trigger area. The script is then supposed to monitor the vehicles speed and height until they are safe to issue the eject command. The unit is then given waypoints by script to move away and do his own thing.

If this is the case, would what shk said still be true? and I guess more importantly how do I get around it.

I will try keeping the unit as part of your group untill the vehicle stops then eject him and then make him join grpnull. That should work with minimal scripting adjustment I guess.

I'll feedback.

Ohhh.. Thanks SHK as always : ) :yay:

Rough Knight

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×