The script is working fine, there a no script errors.
isserver is not needed in the addaction script
not in but around, as in:
if (isServer) then {
... addaction ...
};
(see below)
Post some more of your scripts.
For easier reading I've now split my init into two seperate inits, one for Server the other for client.
init.sqf starts:
Code:
ws_init_server = [] execVM "ws_scripts\ws_init_server.sqf";
ws_init = [] execVM "ws_scripts\ws_init.sqf";
ws_init_server
Code:
if !(isServer) exitWith {};
//Wolfenswan - required variables
if (isNil "ws_initdone") then {ws_initdone = false;publicvariable "ws_initdone";};
if (isNil "ws_markersdone") then {ws_markersdone = false;publicvariable "ws_markersdone";};
if (isNil "ws_uploadstarted") then {ws_uploadstarted = false;publicvariable "ws_uploadstarted";};
if (isNil "ws_uploaddone") then {ws_uploaddone = false;publicvariable "ws_uploaddone";};
if (isNil "ws_mapclicked") then {ws_mapclicked = false;publicvariable "ws_mapclicked";};
//Wolfenswan - server side scripts
ws_placewreckage = [] execVM "ws_scripts\ws_placewreckage2.sqf";
ws_wreckmarkers = [] execVM "ws_scripts\ws_wreckmarkers.sqf";
waitUntil {scriptDone f_processParamsArray};
if (f_var_debugMode == 0) then {deleteVehicle trgDBG; deleteVehicle trgDBG_1;};
if (f_param_uav == 0) then {deleteVehicle UnitRU_UAV;deleteVehicle mdlULB;deleteVehicle UnitRU_Terminal;deleteMarker "mkrTerminal";};
ws_init:
Code:
//Invisible markers
{_x setMarkerAlpha 0;} forEach ["mArea","mArea_1","mArea_2","mArea_3","mArea_4","mArea_5"];
//Precompiling stuff we need later
BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
call compile preprocessfile "SHK_pos\shk_pos_init.sqf";
//Launching client side scripts - Wolfenswan
[] execVM "ws_scripts\ws_Intro.sqf"; //The script blacking out the player screens until the mission has properly loaded
[] execVM "custom\groupTeleport.sqf"; //Teleport for the Journalists & HALO for Spetsnatz
waituntil {scriptDone ws_init_server};
waituntil {(ws_initdone)};
//Set Wreck on fire
if (f_param_fire == 1) then {_fire = [Wreck,5,time,false,false] spawn BIS_Effects_Burn;};
//Action to allow Data Transfer
ws_uploadaction = Wreck addAction ["<t color='#dddd00'>"+"Begin transfer (DEBUG)"+"</t>","ws_scripts\ws_uploadaction.sqf",nil,1,false,true,"","((_target distance _this) < 9) && (group _this != grpRU_Grnd)"];
//Action allowing the grounded pilot to estimate his location
if (f_param_broadcastaction == 1) then {
ws_broadcastlocation = UnitRU_Grnd_P addAction ["<t color='#dddd00'>"+"Estimate location"+"</t>","ws_scripts\ws_mapclickaction.sqf",nil,1,false,true,"","(driver _target == _this)&&((Wreck distance _this)<250)"];
} else {
ws_broadcastlocation = UnitRU_Grnd_P addAction ["<t color='#dddd00'>"+"Estimate location"+"</t>","ws_scripts\ws_mapclickaction.sqf",nil,1,false,true,"","(driver _target == _this)"];};
ws_placewreckage2.sqf (the script moving the Wreck around Cherna), works perfectly fine
Code:
//Based on init_start.sqf in: Jolly Green, made by Shuko of LDD Kyllikki
sleep 0.1;
if (!isServer) exitWith {};
if (ws_initdone) exitWith {};
private ["_findFlatGround"];
_findFlatGround =
{
private ["_pos","_posTL","_posTR","_posBL","_posBR","_result","_water","_gradientTooBig","_posArray","_radius","_maxFactor"];
_pos = _this select 0;
_radius = _this select 1;
_maxFactor = _this select 2;
_posTL = [(_pos select 0) - _radius, (_pos select 1) - _radius];
_posTR = [(_pos select 0) + _radius, (_pos select 1) - _radius];
_posBL = [(_pos select 0) - _radius, (_pos select 1) + _radius];
_posBR = [(_pos select 0) + _radius, (_pos select 1) + _radius];
_result = [false,_pos];
_water = false;
{
if (surfaceIsWater _x) exitWith { _water = true; };
} forEach [_pos, _posTL, _posTR, _posBL, _posBR];
_gradientTooBig = false;
_posArray = [_pos, _posTL, _posTR, _posBL, _posBR];
for "_i" from 0 to ((count _posArray) - 1) do
{
for "_k" from 0 to ((count _posArray) - 1) do
{
private ["_pos1", "_pos2"];
_pos1 = _posArray select _i;
_pos2 = _posArray select _k;
if (((_pos1 select 0) != (_pos2 select 0)) && ((_pos1 select 1) != (_pos2 select 1))) then
{
private ["_sample1", "_sample2", "_posASL1", "_posASL2"];
_sample1 = "RoadCone" createVehicle _pos1;
_sample2 = "RoadCone" createVehicle _pos2;
_posASL1 = getPosASL _sample1;
_posASL2 = getPosASL _sample2;
deleteVehicle _sample1;
deleteVehicle _sample2;
private ["_heightDiff"];
_heightDiff = abs ((_posASL1 select 2) - (_posASL2 select 2));
if (_heightDiff > _maxFactor) then { _gradientTooBig = true; };
};
};
};
if (!_water && !_gradientTooBig) then { _result = [true,_pos]; };
_result
};
//sleep (random 0.5);
private ["_area","_centerpos","_cx","_cy","_areasize","_rx","_ry","_ad","_cd","_sd","_tx","_ty","_xout","_yout","_bomb","_found","_result"];
switch (round random 5) do {
case 0: {_area = "mArea";};
case 1: {_area = "mArea_1";};
case 2: {_area = "mArea_2";};
case 3: {_area = "mArea_3";};
case 4: {_area = "mArea_4";};
case 5: {_area = "mArea_5";};
};
_centerpos = getMarkerPos _area;
_cx = abs(_centerpos select 0);
_cy = abs(_centerpos select 1);
_areasize = getMarkerSize _area;
_rx = _areasize select 0;
_ry = _areasize select 1;
_ad = (markerDir _area) * -1;
_cd = cos(_ad);
_sd = sin(_ad);
_found = false;
while {!_found} do {
_tx=(random (_rx*2)) - _rx;
_ty=(random (_ry*2)) - _ry;
_xout=if (_ad!=0) then {_cx+ (_cd*_tx - _sd*_ty)} else {_cx+_tx};
_yout=if (_ad!=0) then {_cy+ (_sd*_tx + _cd*_ty)} else {_cy+_ty};
_result = [[_xout,_yout,0],2,4.5] call _findFlatGround;
_found = _result select 0;
};
Wreck_loc = _result select 1;
publicvariable "Wreck_Loc";
_bomb = "Bo_GBU12_LGB" createVehicle Wreck_loc;
[_bomb] spawn {
waituntil {isNull (_this select 0)};
Wreck setPos [Wreck_loc select 0,Wreck_loc select 1,0];
Wreck setvectorup [0,0,0];
Wreck setdir (random 360);
Wreck allowdamage false;
Wreck setVelocity [0,0,0];};
ws_initdone = true;
publicvariable "ws_initdone";
ws_uploadaction.sqf:
Code:
private ["_caller"];
_caller = _this select 1;
ws_uploader = _caller;
ws_uploadstarted = true;
publicvariable "ws_uploadstarted";
publicvariable "ws_uploader";
ws_upload.sqf (started by a trigger named trgUpload that listens for ws_uploadstarted)
Code:
waitUntil {scriptDone f_processParamsArray};
private ["_time","_tick","_nearlist","_dots","_pos"];
_time = f_param_uploadtime;
_tick = 0;
Wreck removeAction ws_uploadaction;
deleteVehicle trgUpload;
_pos = getPos ws_uploader;
ws_laptop setPos _pos;
if (isNil "ws_pickuplaptop") then {
ws_pickuplaptop = ws_laptop addAction ["<t color='#dddd00'>"+"Pickup data"+"</t>","ws_scripts\ws_pickuplaptop2.sqf",nil,1,false,true,"","((_target distance _this) < 4) && (ws_uploaddone)"];
};
_mkr = createMarker ["LP", _pos];
_mkr setMarkerShape "ICON";
_mkr setMarkerType "Dot";
_mkr setMarkerColor "ColorGreen";
_mkr setMarkerText "Data";
hintsilent format ["%1 has established connection.",name ws_uploader];
while {_tick != _time} do {
_dots = "";
for "_i" from 0 to 5 do {
hintsilent format ["Transfering%1",_dots];
_dots = _dots + ".";
sleep 0.1;};
sleep 5;
_dots = "";
for "_i" from 0 to 5 do {
hintsilent format ["Transfering%1",_dots];
_dots = _dots + ".";
sleep 0.1;};
sleep 5;
_tick = _tick + 10;
};
hint format ["Transfer finished, data has been secured."];
ws_uploaddone = true;
publicvariable "ws_uploaddone";
As said, the action scripts self work perfectly fine.
What else do you need?