I'm trying to make a trigger that updates on a regular cycle. Every update cycle, it's supposed to take a variable (the increment), add it to another variable (the old value), and save the result (the new value). However, while most of this seems to work, the updates appear to be updating the increment itself, as well. Specifically, doubling it on every update. The update function is shown below:
Additionally, if it's important: I am working with classic Warcraft III, not Reforged.
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
Player Group - Pick every player in empirePlayers and do (Actions)
-
Loop - Actions
- Set CurrentBoard = (Load (Player number of (Picked player)) of (Integer(multiboards)) in empireTables)
- -------- Update population --------
- -------- Update Ore --------
- Set oldValue = (Load (Player number of (Picked player)) of (Integer(currentOre)) from empireTables)
- Set increment = (Load (Player number of (Picked player)) of (Integer(currentMiners)) from empireTables)
- Game - Display to (Player group((Picked player))) the text: (Current Miners: + (String((Load (Player number of (Picked player)) of (Integer(currentMiners)) from empireTables))))
- Set newValue = (oldValue + increment)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- increment Greater than 0
-
Then - Actions
- Set localString = (((String(newValue)) + |cff55ff55(+) + ((String(increment)) + )|r))
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- increment Less than 0
-
Then - Actions
- Set localString = (((String(newValue)) + |cffff5555() + ((String(increment)) + )|r))
-
Else - Actions
- Set localString = ((String(newValue)) + (+0))
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Hashtable - Save newValue as (Player number of (Picked player)) of (Integer(currentOre)) in empireTables
- Multiboard - Set the text for CurrentBoard item in column 1, row 1 to localString
-
Loop - Actions
-
Player Group - Pick every player in empirePlayers and do (Actions)
Additionally, if it's important: I am working with classic Warcraft III, not Reforged.