In my mission two tasks are shown from the beginning. Easy stuff
Two additional tasks will be updated during the mission, and they will not be shown until a boolean variable is true for each of them.
Does anyone know of a safe way to do that without any doubling of tasks or missing tasks when the player teamswitches.
This is my current solution which works kind of OK, but not always 100%.
init.sqf
nil = [] execVM "briefing.sqf";
[] exec "briefingmarkerupdate.sqs";
[] exec "briefingdisarmupdate.sqs";
BriefedUnits = [];
BriefedUnitsUpd1 = [];
BriefedUnitsUpd2 = [];
Briefing script and update scripts end with
one of these lines
correspondingly:
BriefedUnits = BriefedUnits + [player];
BriefedUnitsUpd1 = BriefedUnitsUpd1 + [player];
BriefedUnitsUpd2 = BriefedUnitsUpd2 + [player];
In my MP mission I use respawn "side", so I have this solution in a repeatedly trigger:
onTeamSwitch {if (! (player in BriefedUnits)) then {execVM "briefing.sqf"};
if (! (isNil "disarminfotaken") AND ! (player in BriefedUnitsUpd1)) then {[] exec "briefingdisarmupdate.sqs"};
if (! (isNil "mapinfotaken") AND ! (player in BriefedUnitsUpd2)) then {[] exec "briefingmarkerupdate.sqs"}}
"disarminfotaken" and "mapinfotaken" are both broadcasted with publicVariable command.
Does anyone see the flaws in my solution?
Grateful for any help.
Laggy