Jump to content
Sign in to follow this  
mokeyii

Script not working on Dedibox, works on editor/self host

Recommended Posts

So, I'm not quite understanding this. 

http://www.armaholic.com/page.php?id=25458

The Simple Paradrop Script, I have it working flawlessly on the mission editor or a self hosted session through arma. However as soon as I put it on my dedicated box it fails to open the chute at 100m BUT opens it for all AI. All of the other functions work properly. 

This is a Co-Op Mission... If that makes a difference.

Can some1 help me with this issue?

Github: https://github.com/Fractured-Gaming/FracturedLines2

eject.sqf

 

if (!isServer && hasInterface) exitWith {};
private ["_vehicle","_chuteheight","_paras","_dir"];
_vehicle = _this select 0;
_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 100 };
_paras = assignedcargo _vehicle;
_dir = direction _vehicle;
[_paras] allowGetIn false;

paraLandSafe = 
{
    private ["_unit"];
    _unit = _this select 0;
    (vehicle _unit) allowDamage false;// Set parachute invincible to prevent exploding if it hits buildings
    waitUntil {isTouchingGround _unit || (position _unit select 2) < 1 };
    _unit allowDamage false;
    _unit action ["EJECT", vehicle _unit];
    _unit setvelocity [0,0,0];
    sleep 1;// Para Units sometimes get damaged on landing. Wait to prevent this.
    _unit allowDamage true;
};

{
    _x disableCollisionWith _vehicle;
    _x allowdamage false;
    unassignvehicle _x;
    _x action ["GETOUT", _vehicle];
    _x setDir (_dir + 90);
    sleep 0.35;//So units are not too far spread out when they land.
} forEach _paras;

{
    waitUntil {(position _x select 2) <= _chuteheight};
    if (vehicle _x != _x) exitWith {};
    _chute = createVehicle ["Steerable_Parachute_F", position _x, [], ((_dir)- 5 + (random 10)), 'FLY'];
    _chute setPos (getPos _x);
    _x assignAsDriver _chute;
	_x moveIndriver _chute;
    _x allowdamage true;
} forEach _paras;

{ 
  [_x] spawn paraLandSafe;
} forEach _paras;

Share this post


Link to post
Share on other sites

I thought locality was the issue with the variable _chute, so I mad a local Variable like so. However this still did not work.

 

{
    waitUntil {(position _x select 2) <= _chuteheight};
    if (vehicle _x != _x) exitWith {};
	private ["_chuteMe"];
    _chuteMe = createVehicle ["Steerable_Parachute_F", position _x, [], ((_dir)- 5 + (random 10)), 'FLY'];
    _chuteMe setPos (getPos _x);
    _x assignAsDriver _chuteMe;
	_x moveIndriver _chuteMe;
    _x allowdamage true;
} forEach _paras;

Still does not work on the dedicated box. 

Share this post


Link to post
Share on other sites

Placed all inits into all players, Increased Chute open distance by 1.5x, still same issue.

Also Changed the script to try and fix it.

 

private ["_vehicle","_chuteheight","_paras","_dir","_unit","_chuteMe"];

if (!isServer && hasInterface) exitWith {};
_vehicle = _this select 0;
_chuteheight = if ( count _this > 1 ) then { _this select 1 } else { 100 };
_paras = assignedcargo _vehicle;
_dir = direction _vehicle;
[_paras] allowGetIn false;

paraLandSafe = 
{
    _unit = _this select 0;
    (vehicle _unit) allowDamage false;// Set parachute invincible to prevent exploding if it hits buildings
    waitUntil {isTouchingGround _unit || (position _unit select 2) < 1 };
    _unit allowDamage false;
    _unit action ["EJECT", vehicle _unit];
    _unit setvelocity [0,0,0];
    sleep 1;// Para Units sometimes get damaged on landing. Wait to prevent this.
    _unit allowDamage true;
};

{
    _x disableCollisionWith _vehicle;
    _x allowdamage false;
    unassignvehicle _x;
    _x action ["GETOUT", _vehicle];
    _x setDir (_dir + 90);
    sleep 0.35;//So units are not too far spread out when they land.
} forEach _paras;

{
    waitUntil {(position _x select 2) <= _chuteheight};
    if (vehicle _x != _x) exitWith {};
    _chuteMe = createVehicle ["Steerable_Parachute_F", position _x, [], ((_dir)- 5 + (random 10)), 'FLY'];
    _chuteMe setPos (getPos _x);
    _x assignAsDriver _chuteMe;
	_x moveIndriver _chuteMe;
    _x allowdamage true;
} forEach _paras;

{ 
  [_x] spawn paraLandSafe;
} forEach _paras;

Share this post


Link to post
Share on other sites

Changed 

["Steerable_Parachute_F", position _x, [], ((_dir)- 5 + (random 10)), 'FLY'];

to
 

"Steerable_Parachute_F" createVehicle position _x;

Looks  a lot better, but AI still deploy parachutes and Players do not.

Share this post


Link to post
Share on other sites
_paras = assignedcargo _vehicle;

After that line, put the _paras array into the server's log (diag_log) and see if your player is in it ... respectively put player in _paras into the log so you don't have to search yourself.

 

And change the first line to just

if (!isServer) exitWith {};

because with hasInterface, you're letting a client named "__SERVER__" execute this script too, because the server logs on to itself as a client (read here), but has no interface, so hasInterface would be false hence the script won't exit there.

Share this post


Link to post
Share on other sites
_paras = assignedcargo _vehicle;

After that line, put the _paras array into the server's log (diag_log) and see if your player is in it ... respectively put player in _paras into the log so you don't have to search yourself.

There is no "player" variable on dedicated server

Share this post


Link to post
Share on other sites

I will try it tonight when I get off work and let you know.

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  

×