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

Moderator: rbodleyscott

Post Reply
locustmustdie
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Fri Mar 05, 2021 11:33 am

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

Post 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?
locustmustdie
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Fri Mar 05, 2021 11:33 am

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

Post by locustmustdie »

Tested,it works.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28429
Joined: Sun Dec 04, 2005 6:25 pm

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

Post 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.
Richard Bodley Scott

Image
Post Reply

Return to “Field of Glory II: Medieval - Scenario Design”