HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[Help] Trigger only running once (again)

02-07-2009, 02:31 AM#1
Tide-Arc Ephemera
Trigger:
GE Initialize
Collapse Events
Time - Elapsed game time is 0.01 seconds
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in TreeChangers and do (Actions)
Collapse Loop - Actions
Set TCInteger = (TCInteger + 1)
Set TCTreeChange[TCInteger] = (Position of (Picked unit))
Set TCPoint = TCTreeChange[TCInteger]
Set TCTimer[TCInteger] = (Random integer number between 90 and 150)
Collapse Destructible - Pick every destructible within 260.00 of TCPoint and do (Actions)
Collapse Loop - Actions
Trigger - Add to GE Destructible Invisibility <gen> the event (Destructible - (Picked destructible) dies)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Random integer number between 1 and 10) Greater than (>) 5
Collapse Then - Actions
Set TCDeadAlive[TCInteger] = True
Collapse Else - Actions
Set TCDeadAlive[TCInteger] = False
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
TCDeadAlive[TCInteger] Equal to (==) True
Collapse Then - Actions
Set TCDeadAlive[TCInteger] = False
Environment - Change terrain type at TCPoint to Ashenvale - Grass using variation -1 in an area 3 and shape Circle
Collapse Destructible - Pick every destructible within 200.00 of TCPoint and do (Actions)
Collapse Loop - Actions
Destructible - Kill (Picked destructible)
Collapse Else - Actions
Set TCDeadAlive[TCInteger] = True
Custom script: call RemoveLocation(udg_TCPoint)
Unit - Kill (Picked unit)

Trigger:
GE Tree Change
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to TCInteger, do (Actions)
Collapse Loop - Actions
Set TCTimer[(Integer A)] = (TCTimer[(Integer A)] - 1)
Set TCPoint = TCTreeChange[(Integer A)]
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
TCTimer[(Integer A)] Less than or equal to (<=) 0
Collapse Then - Actions
Set TCTimer[(Integer A)] = (Random integer number between 90 and 150)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
TCDeadAlive[(Integer A)] Equal to (==) True
Collapse Then - Actions
Set TCDeadAlive[(Integer A)] = False
Environment - Change terrain type at TCPoint to Ashenvale - Grass using variation -1 in an area 3 and shape Circle
Collapse Destructible - Pick every destructible within 260.00 of TCPoint and do (Actions)
Collapse Loop - Actions
Destructible - Kill (Picked destructible)
Collapse Else - Actions
Set TCDeadAlive[(Integer A)] = True
Environment - Change terrain type at TCPoint to Ashenvale - Leaves using variation -1 in an area 3 and shape Circle
Custom script: set bj_wantDestroyGroup = true
Collapse Destructible - Pick every destructible within 260.00 of TCPoint and do (Actions)
Collapse Loop - Actions
Destructible - Show (Picked destructible)
Destructible - Resurrect (Picked destructible) with 10000000.00 life and Show birth animation
Collapse Unit Group - Pick every unit in (Units within 200.00 of TCPoint) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) is A structure) Equal to (==) False
Collapse Then - Actions
Set TempPoint[1] = (Position of (Picked unit))
Set TempPoint[2] = (TempPoint[1] offset by 50.00 towards (Angle from TCPoint to TempPoint[1]) degrees)
Unit - Create 1 Tree Shove Unit for Neutral Passive at TempPoint[2] facing Default building facing (270.0) degrees
Set TempPoint[10] = (Position of (Last created unit))
Unit - Remove (Last created unit) from the game
Custom script: call RemoveLocation(udg_TempPoint[1])
Custom script: call RemoveLocation(udg_TempPoint[2])
Unit - Move (Picked unit) instantly to TempPoint[10]
Custom script: call RemoveLocation(udg_TempPoint[10])
Collapse Else - Actions
Unit - Kill (Picked unit)
Else - Actions
Custom script: call RemoveLocation(udg_TCPoint)

Okay, problem is that the initializer works but the periodic changers don't and I can't find what's going on. Extra eyes would be much appreciated to help me multi-run the trigger, thankyou.
02-07-2009, 02:43 AM#2
ShadowWolf
1) Does anything else change TCInteger?

2) Place debug messages through various key places in the trigger functions to determine how far it's getting, which parts are firing, etc.
02-07-2009, 03:35 AM#3
Tide-Arc Ephemera
1) Nope.

2) That's the thing, NO parts are firing. It's either A or B... A means it raises trees and changes the leaves/grass, B kills the trees and changes the leaves/grass.

I have a trigger that forces all timers to 1 so they ALL go off after a bit, however none of them change when its used.
02-07-2009, 04:28 AM#4
ShadowWolf
So the main loop in GE Tree Change isn't firing at all?

Well, if what you're saying is true, then that means the root of the problem would be in the conditions for the loop since the entire function is contained within the loops.

And if that's true, my first inclination is that something is wrong with TCInteger.
Place a game text message displaying the value of TCInteger as the first action in GE Tree Change, before the loop. If that var is returning 0 or 1 then you have your problem.
02-07-2009, 06:42 AM#5
Tide-Arc Ephemera
It was another thing I suspected, it's one of those retarded-looking bugs. It's VISUALLY perfect, setting a location equal to another location... it seems to point to it instead of set itself to it.

I replaced Set Location stuff with set udg_TCPoint = Location(GetLocationX(udg_TCTreeChange[GetForLoopIndexA()]), GetLocationY(udg_TCTreeChange[GetForLoopIndexA()])) and it magically worked.