Page 1 of 1

If a “SetUniversalVar” was written in StartTurn or StartTurnPost,will it be reset to zero in the next turn?

Posted: Sat Aug 06, 2022 3:55 pm
by locustmustdie
For instance,I intend to utilize a UniversalVar to kill the loop which shall be terminated once triggered under certain conditions. Be like this

Code: Select all

if(GetUniversalVar(“turntriggered”)==0)
{
    If (FunctionIWritten(side,team,routed)==1)
         {
            ……placereinforcement……
            SetUniversalVar(“turntriggered”,1);
          }
}       
The reinforcements shall be placed under the condition of Function(EditorWritten) rather than GetTurn() designated as a fixed number.Hence the loop must be killed once it’s “if(……)”was fulfilled and it’s {……} was executed.
However I’m not sure whether a “SetUniversalVar” written in either StartTurn or StartTurnPost,will it be reset to zero in the next turn?

Re: If a “SetUniversalVar” was written in StartTurn or StartTurnPost,will it be reset to zero in the next turn?

Posted: Sun Aug 07, 2022 1:28 am
by locustmustdie
Tested,it works.

Re: If a “SetUniversalVar” was written in StartTurn or StartTurnPost,will it be reset to zero in the next turn?

Posted: Mon Aug 08, 2022 6:43 am
by rbodleyscott
Universal Variables are not reset to 0 automatically each turn. But they can of course be set to 0 in StartTurn() or StartTurnPost() if you code that.