akvadakar 21 Posted January 31, 2015 I wonder if anyone can find a bug in this code. It works in LAN server. Maybe the problem is when more players are present. IDK I guess the crash is due to a non existent variable which the server wants to reach. It has nothing to do with dedh.sqs, vehic.sqs AFAIK. ? not local server : exit _pla= [] _plas= [man1,man2,man3,man4,man5,man6,man7,man8,man9,man10,man11,man12,man13,man14,man15,man16,man17,man18,man19,man20, man21, man22, man23, man24] _testik= 0 #si ~0.1 ? _testik >= 24 : goto "si2" _is= _plas select _testik ~0.1 ? format ["%1", _is] != "scalar bool array string 0xfcffffef" : _pla= _pla + [_is]; _testik= _testik + 1; goto "si" _testik= _testik + 1 goto "si" #si2 _a= ["UralRepair", "talibantrucka", "talibanamb","talibantruckEst","TalebpickupMGW","TalebmitsujeepMGE"] _aa= ["talebOFF", "talebrpg","talebMEDIC","talebMG","talebsolgrenadier","talebSOL","talebAAE","talebSNIPER","talebSOL2","talebMG2"] _beh= ["AWARE"] _spee= ["NORMAL"] _fom= ["LINE","STAG COLUMN" ,"WEDGE" ,"ECH LEFT" ,"ECH RIGHT" ,"VEE" ,"COLUMN"] _gg= gcon #sel _is= _pla select (random (count _pla - 1)) ~0.1 #sel1 ? not alive _is : goto "sel" ? _is distance resp < 100 : goto "sel" ? _is distance startar < 500 : goto "sel" ? (getpos _is select 2) > 200 : goto "sel" ~0.1 _i= "HeliHEmpty" createvehicle [(getpos _is select 0)+random 1200 - random 1200, (getpos _is select 1)+random 1200 - random 1200] ~0.5 ? ({_i distance _x < 900} count [vehicle man1,vehicle man2,vehicle man3,vehicle man4,vehicle man5,vehicle man6,vehicle man7,vehicle man8,vehicle man9,vehicle man10,vehicle man11,vehicle man12,vehicle man13,vehicle man14,vehicle man15,vehicle man16,vehicle man17,vehicle man18,vehicle man19,vehicle man20, vehicle man21, vehicle man22, vehicle man23, vehicle man24] > 0) : deletevehicle _i; goto "sel" ? ({_i distance _x < 1200} count [vehicle man1,vehicle man2,vehicle man3,vehicle man4,vehicle man5,vehicle man6,vehicle man7,vehicle man8,vehicle man9,vehicle man10,vehicle man11,vehicle man12,vehicle man13,vehicle man14,vehicle man15,vehicle man16,vehicle man17,vehicle man18,vehicle man19,vehicle man20, vehicle man21, vehicle man22, vehicle man23, vehicle man24] == 0) : deletevehicle _i; goto "sel" ? (getpos _i select 2) != 0 : deletevehicle _i; goto "sel" ? _i distance resp < 200 : deletevehicle _i; goto "sel" ~0.1 _n= 0 _vehi= [] _nov= "HeliHEmpty" createvehicle getpos _is _ar= [] _k= 0 _rcon= random 4 ~0.1 #stu ? _k >= _rcon : goto "zo" _carone= (_a select random (count _a -1)) createvehicle [(getpos _i select 0)+random 20 - random 20, (getpos _i select 1)+random 20 - random 20] ~0.5 [_carone, 1300] exec "vehic.sqs" _ar= _ar + [_carone] _carone setdir 90 _k= _k + 1 goto "stu" #zo _na= count _aa - 1 _s= _aa select random _na #wait ~0.1 ? param1 != 55 : _s createunit [getpos _i, _gg, "[this] exec {dedh.sqs}", lvl, "COLONEL"] ? param1 == 55 : _s createunit [getpos _i, _gg, "[this] exec {dedh.sqs}", random 1, "COLONEL"] _n= 1 ~0.5 #yg _u= (units _gg select _n) ~0.1 ? _u distance _i < 60 : goto "zg" _n= _n + 1 ~0.1 ? _n >= ((count units _gg) - 1) : _n= 0 ~0.1 goto "yg" #zg _n= 11.1 [_u] join grpnull ~0.5 _g= group _u ~0.1 #more _s= _aa select random _na ~0.1 ? param1 != 55 : _s createunit [getpos _i, _g, "[this] exec {dedh.sqs}", lvl, "COLONEL"] ? param1 == 55 : _s createunit [getpos _i, _g, "[this] exec {dedh.sqs}", random 1, "COLONEL"] ~0.5 ? count units _g < _n : goto "more" #nen ~0.1 _oka= 0 _okj= 0 #ss ~0.1 ? _okj + 1 > count units _g : goto "delt" _test= _ar select _oka _jedno= units _g select _okj ~0.1 ? isnull (driver (_test)) : _jedno moveindriver (_test); _okj= _okj + 1; goto "ss" ? (isnull (gunner _test) and typeof _test == "TalebmitsujeepMGE") : _jedno moveingunner (_test); _okj= _okj + 1; goto "ss" ? (isnull (gunner _test) and typeof _test == "TalebpickupMGW") : _jedno moveingunner (_test); _okj= _okj + 1; goto "ss" _oka= _oka + 1 ~0.1 ? _oka + 1 > count _ar : goto "cargo" goto "ss" #cargo _oka= 0 #cad ~0.1 _jedno= units _g select _okj ? _oka + 1 > count _ar : goto "del" _test= _ar select _oka ~0.1 _jedno moveincargo _test ~0.1 ? vehicle _jedno == _jedno : _oka= _oka + 1; goto "cad" ? _okj + 1 > count units _g : goto "delt" ~0.1 _okj= _okj + 1 goto "cad" #del _okj= 0 #dell ~0.1 ? _okj + 1 > count units _g : goto "nene" _jedno= units _g select _okj ~0.1 _okj= _okj + 1 ? _jedno == vehicle _jedno : _okj= _okj - 1; _jedno setpos getpos server; _jedno setdamage 1; goto "dell" goto "dell" #delt _oka= 0 #dellt ~0.1 ? _oka + 1 > count _ar : goto "nene" _jedno= _ar select _oka ~0.1 _oka= _oka + 1 ? isnull (driver (_jedno)) : _jedno setpos getpos server; goto "dellt" goto "dellt" #nene _g setcombatmode "RED" _g setspeedmode "NORMAL" _g setformation "COLUMN" _g allowfleeing 0 #move ? ((("not alive _x" count units _g) == count units _g)) : deletevehicle _i; deletevehicle _nov; goto "sel" _g move [(getpos _nov select 0)+random 800 - random 800, (getpos _nov select 1)+random 800 - random 800] ? ({leader _g distance _x < 1200} count [vehicle man1,vehicle man2,vehicle man3,vehicle man4,vehicle man5,vehicle man6,vehicle man7,vehicle man8,vehicle man9,vehicle man10,vehicle man11,vehicle man12,vehicle man13,vehicle man14,vehicle man15,vehicle man16,vehicle man17,vehicle man18,vehicle man19,vehicle man20, vehicle man21, vehicle man22, vehicle man23, vehicle man24] == 0) : goto "delete" ~20 + random 20 goto "move" #delete ~0.1 "_x setpos getpos server" foreach units _g ~0.1 deletevehicle _i deletevehicle _nov "_x setdamage 1" foreach units _g goto "sel" Share this post Link to post Share on other sites
krzychuzokecia 700 Posted February 1, 2015 (edited) I don't really know if what I'm going to tell You is right, because I've never got myself into advanced scripting, but IMHO the answer lies in the very first line of code: ? not local server : exit AFAIK dedicated server is not local server. So, that first line checks if server is dedicated, and if it is, script stops. That makes me think that script uses some global variable, and these don't work on dedicated servers, unless You'd use Chain of Command Network Services. But that's all I know, and I could be wrong. Edited February 1, 2015 by krzychuzokecia I was wrong Share this post Link to post Share on other sites
kenoxite 155 Posted February 1, 2015 @krzy: I'm afraid that's not correct. Local in that case refers to the scope of the server object, which is quite likely a game logic placed in the editor named "server". Logics are only managed by the server, same as with the AI. This script (all scripts, actually) are executed by default in all connected machines, be it the server or clients. By checking if the "server" logic is local before executing the rest of the script we can then know if the requester is the server or a client. If it's a client (if the "server" logic is not local to that machine), then we kill the script (exit). @ Akvadakar: Hard to tell, but my bet is that you're trying to deletevehicle too fast for a dedicated server. Try increasing the wait time after #si, as all the deletevehicle requests end up looping up there. Share this post Link to post Share on other sites
krzychuzokecia 700 Posted February 1, 2015 Ha ha! Good to know then. :) Share this post Link to post Share on other sites