Hi all,
EDIT:In my mission "1-13 Red Mercury" I have just got a beta testing report regarding a weird mission ending bug or design error. You are supposed to disarm a nuclear bomb and if you perform the correct action an end trigger is started.
From mission start a random script (only run on the server) decides on the correct way to disarm the bomb, as in:
_number = ceil random 5;
if (_number == 1) then {correctDisarm = "DISCONNECT THE BATTERY"; publicVariable "correctDisarm"};
if (_number == 2) then {correctDisarm = "REMOVE THE EXPLOSIVES"; publicVariable "correctDisarm"};
if (_number == 3) then {correctDisarm = "FLIP THE ARMING SWITCH"; publicVariable "correctDisarm"};
if (_number == 4) then {correctDisarm = "SHORTCIRCUIT THE GENERATOR"; publicVariable correctDisarm"};
if (_number == 5) then {correctDisarm = "DISMANTLE THE TIMER"; publicVariable "correctDisarm"};
In player sided action scripts the performed disarm method is chosen, as in example:
nukedisarmer = _this select 0;
publicVariable "nukedisarmer";
disarmPerformed = "DISCONNECT THE BATTERY";
publicVariable disarmPerformed;
In a global trigger I have this condition:
! (isNil "nukedisarmer") AND (disarmPerformed == correctDisarm) AND isNil "screwup"
onActivation:
hint "Task completed."; tskObj4 setTaskState "SUCCEEDED"; goodend = true; [] exec "winoutro.sqs"
"screwup" is a variable that is set to true if the wrong disarm method is used. Before that it is undefined.
What one tester has told me is that only the disarmer player got the winoutro and mission ending. The other players stayed in game... How is this possible when the winoutro is started through publicVariable command???
I have of course checked this function on a dedicated server myself and this never happened to me, though of course I was the disarmer in that test. Read somewhere that ArmA2 has some kind of "bandwith" limit for custom scripts, could that be the issue or have I missed something really important here?
Finally, I still don't know if JIP could have created a mess for me here, the tester never gave me a thorough description. A also NEVER get any script errors, even though I have -showScriptErrors active.
Would this be safer:
! (isNil "nukedisarmer") AND ! (isNil "correctDisarm") AND ! (isNil "disarmPerformed") AND (disarmPerformed == correctDisarm) AND isNil "screwup"
Should I run EVERYTHING via the server that then decides when the mission is accomplished? Don't see why since the publicVariable command from the player action shouldn't really have any weird sync problems... right?
END EDITOtherwise I am stumped
Laggy