For the sake of my fingers, the trigger "Base" runs when a property change occours. That than goes to another trigger, which checks if the property change was 10 and it prints a debug if so. The following trigger is bugging
Periodic Fix Status
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
i = 0 <Integer>
IncomeTMP = 0 <Integer>
EnergyTMP = 0 <Integer>
WorkTMP = 0 <Integer>
Conditions
Actions
General - For each integer i from 1 to (Number of players in (Active Players)) with increment 1, do (Actions)
Actions
Variable - Set WorkTMP = (Workers Available[i] - Temporary Worker Restrict[i])
Variable - Set EnergyTMP = (Energy Available[i] - Temporary Energy Restrict[i])
Disable Changes()
General - If (Conditions) then do (Actions) else do (Actions)
If
(Base is on) == True
Then
UI - Display "no" for (All players) to Chat area
Else
UI - Display "yes" for (All players) to Chat area
Player - Modify player i Terrazine: Set To EnergyTMP
Player - Modify player i Custom Resource: Set To WorkTMP
Enable Changes()
(enable and disable changes disable a bunch of triggers, one of which being Base)
This prints yes. Good, right? no.
Ok, so i go do something that will proc the debug (get 10 minerals persay). Split second later (or a whole, whatever!) the trigger will run as intended (ONCE). Than, for all of the next procs of that trigger, it will print the debug. This shouldn't be happening because i broke the trigger chain (by disabling Base which wont run the trigger that shows the debug) but the debug shows up! Can anyone see anything or need more info
The "trigger is on/off" function only checks to see whether it can be run, not whether it is currently running. Try running your map in debug mode to see if Base has any threads going while it prints out "yes."
I think it's even more than that
this is similar issue where i had 10 check boxes, clicking one switched others between "turn off this" - "turn on this" yet the trigger was looping.
The easiest way you should try is 'wait 0.1, turn on' or global timer 0.1 which is restarted every time and have separate event to carry action
as long as the trigger has not reached either a wait point or it's end, the changes that that trigger makes to the game are put in memory and applied when the trigger reaches it's end. So when you disable a bunch of stuff, and then directly test if it was disabled you get the message that it was not disabled. if you place a wait(0.0) right in front of the check it will respond with that it was disabled. I think this is the problem that you are facing here.
For the sake of my fingers, the trigger "Base" runs when a property change occours. That than goes to another trigger, which checks if the property change was 10 and it prints a debug if so. The following trigger is bugging
(enable and disable changes disable a bunch of triggers, one of which being Base) This prints yes. Good, right? no.
Ok, so i go do something that will proc the debug (get 10 minerals persay). Split second later (or a whole, whatever!) the trigger will run as intended (ONCE). Than, for all of the next procs of that trigger, it will print the debug. This shouldn't be happening because i broke the trigger chain (by disabling Base which wont run the trigger that shows the debug) but the debug shows up! Can anyone see anything or need more info
Re explain it.
i tried to explain what's your issue with explanation here but it's so messed up that i got lost anyway.
The issue is that "Base" is still triggering even though that debug prints "yes"
The "trigger is on/off" function only checks to see whether it can be run, not whether it is currently running. Try running your map in debug mode to see if Base has any threads going while it prints out "yes."
@BasharTeg: Go
I think it's even more than that
this is similar issue where i had 10 check boxes, clicking one switched others between "turn off this" - "turn on this" yet the trigger was looping.
The easiest way you should try is 'wait 0.1, turn on' or global timer 0.1 which is restarted every time and have separate event to carry action
as long as the trigger has not reached either a wait point or it's end, the changes that that trigger makes to the game are put in memory and applied when the trigger reaches it's end. So when you disable a bunch of stuff, and then directly test if it was disabled you get the message that it was not disabled. if you place a wait(0.0) right in front of the check it will respond with that it was disabled. I think this is the problem that you are facing here.
@Helral: Go
little correction, i said 0.1 on purpose. tested 0 and it still looped but without execution took too long message
@illidans911: Go
what was the purpose of writing your code in such a manner?
some times its simpler to just have global booleans to turn things on and off rather then the triggers themselves.
as far as I can tell your code looks like its meant to handle multiple players..... but you only have one "base".
if you tell us what your actually trying to do .... someone might provide you with a better system.
With coding is like with art. Tell 10 artists to draw a horse and each of them will look different