Home   Help Search Login Register  

Author Topic: Updated briefing to work with teamswitch ?  (Read 1278 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Updated briefing to work with teamswitch ?
« on: 03 Feb 2010, 20:44:51 »
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
Code: [Select]
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:
Code: [Select]
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
« Last Edit: 03 Feb 2010, 20:51:02 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Shuko

  • Members
  • *
Re: Updated briefing to work with teamswitch ?
« Reply #1 on: 08 Feb 2010, 12:54:06 »
Instead of creating task for "player", why not just create and update them for each unit using allunits/playableunits (with side check IF for example). No need to remember who has what.