Skip to content
This repository has been archived by the owner on Jul 5, 2018. It is now read-only.

Commit

Permalink
Ready-up improvements
Browse files Browse the repository at this point in the history
-For fairness, added countdown when all teams are ready prior to safestart disabling.

-Remove unready action when countdown starts.
  • Loading branch information
tanaaKa committed Feb 20, 2018
1 parent 8b24a78 commit 1dcc870
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 26 deletions.
50 changes: 42 additions & 8 deletions scripts/readyup/gamestart.sqf
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
while {true} do
{
waitUntil
{
(blufor_ready && {opfor_ready} && {indfor_ready});
};
[false] call potato_safeStart_fnc_toggleSafeStart;
};
waitUntil
{
(blufor_ready && {opfor_ready} && {indfor_ready});
};
sleep 2;
if !(isNil "bluPL") then {
bluPL removeAction bluUnready;
}
else {};
if !(isNil "bluASL") then {
bluASL removeAction bluUnready;
}
else {};

if !(isNil "opfPL") then {
opfPL removeAction opfUnready;
}
else {};
if !(isNil "opfASL") then {
opfASL removeAction opfUnready;
}
else {};

if !(isNil "indPL") then {
indPL removeAction indUnready;
}
else {};
if !(isNil "indASL") then {
indASL removeAction indUnready;
}
else {};

["MISSION IS LIVE IN 10 SECONDS","systemChat"] call BIS_fnc_MP;
"MISSION IS LIVE IN 10 SECONDS" remoteExec ["hint", 0];
sleep 5;
["MISSION IS LIVE IN 5 SECONDS","systemChat"] call BIS_fnc_MP;
"MISSION IS LIVE IN 5 SECONDS" remoteExec ["hint", 0];
sleep 4;
["MISSION IS LIVE","systemChat"] call BIS_fnc_MP;
hint "";

[false] call potato_safeStart_fnc_toggleSafeStart;
36 changes: 18 additions & 18 deletions scripts/readyup/readyup_addaction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ if (isServer) then {
};

//Define PLs and SLs per faction
_bluPL = missionNamespace getVariable "BLU_PL";
_bluASL = missionNamespace getVariable "BLU_ASL";
_opfPL = missionNamespace getVariable "OPF_PL";
_opfASL = missionNamespace getVariable "OPF_ASL";
_indPL = missionNamespace getVariable "IND_PL";
_indASL = missionNamespace getVariable "IND_ASL";
bluPL = missionNamespace getVariable "BLU_PL";
bluASL = missionNamespace getVariable "BLU_ASL";
opfPL = missionNamespace getVariable "OPF_PL";
opfASL = missionNamespace getVariable "OPF_ASL";
indPL = missionNamespace getVariable "IND_PL";
indASL = missionNamespace getVariable "IND_ASL";

//Set the ready variables per team to false
blufor_ready = false;
Expand All @@ -28,11 +28,11 @@ gamestart = false;

///////////////////////////////////////////////////////////////
//Add readyup action to each PL IF they exist, otherwise give to ASL
if (isNil "_bluPL") then
if (isNil "bluPL") then
{
if !(isNil "_bluASL") then
if !(isNil "bluASL") then
{
blurdyup = _bluASL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_blu.sqf"];
blurdyup = bluASL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_blu.sqf"];
}
else
{
Expand All @@ -42,14 +42,14 @@ if (isNil "_bluPL") then
}
else
{
blurdyup = _bluPL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_blu.sqf"];
blurdyup = bluPL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_blu.sqf"];
};

if (isNil "_opfPL") then
if (isNil "opfPL") then
{
if !(isNil "_opfASL") then
if !(isNil "opfASL") then
{
opfrdyup = _opfASL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_opf.sqf"];
opfrdyup = opfASL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_opf.sqf"];
}
else
{
Expand All @@ -59,14 +59,14 @@ if (isNil "_opfPL") then
}
else
{
opfrdyup = _opfPL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_opf.sqf"];
opfrdyup = opfPL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_opf.sqf"];
};

if (isNil "_indPL") then
if (isNil "indPL") then
{
if !(isNil "_indASL") then
if !(isNil "indASL") then
{
indrdyup = _indASL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_ind.sqf"];
indrdyup = indASL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_ind.sqf"];
}
else
{
Expand All @@ -76,6 +76,6 @@ if (isNil "_indPL") then
}
else
{
indrdyup = _indPL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_ind.sqf"];
indrdyup = indPL addaction ["<t color='#ff0000'>Ready Up</t>","scripts\readyup\readyup_ind.sqf"];
};
///////////////////////////////////////////////////////////////

0 comments on commit 1dcc870

Please sign in to comment.