- Joined
- Aug 2, 2006
- Messages
- 346
...either that or I'm doing something stupid...
What this trigger is supposed to do is take a small plot of land (all stone, so unbuildable) and make it buildable. It is an area 96 by 56 (each of these is a pathing tile, so the area in WC3 units is 3072x1792 as each pathing tile is 32x32)
96*56 is 5376, so the gold (which I am incrementing every step of the way) SHOULD be at 5376 when the loop finishes, but instead it only makes it up to 1618, and not all of the area is buildable. It goes along the y axis and then by the x axis (so it goes across the row, moves down, then repeats). What's odd is that the pathing changes end in the middle of a row.
I can't see any reason for this happening except maybe Warcraft 3 is ending the loop prematurely because it thinks it's going to be an infinite loop or something. Is anyone else thinking this? And if so, what can I do to avoid this?
What this trigger is supposed to do is take a small plot of land (all stone, so unbuildable) and make it buildable. It is an area 96 by 56 (each of these is a pathing tile, so the area in WC3 units is 3072x1792 as each pathing tile is 32x32)
96*56 is 5376, so the gold (which I am incrementing every step of the way) SHOULD be at 5376 when the loop finishes, but instead it only makes it up to 1618, and not all of the area is buildable. It goes along the y axis and then by the x axis (so it goes across the row, moves down, then repeats). What's odd is that the pathing changes end in the middle of a row.
I can't see any reason for this happening except maybe Warcraft 3 is ending the loop prematurely because it thinks it's going to be an infinite loop or something. Is anyone else thinking this? And if so, what can I do to avoid this?
-
Init
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Custom script: local integer x = 0
-
Custom script: local integer y = 0
-
Custom script: local location tempPoint
-
Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
-
Custom script: loop
-
Custom script: exitwhen y>95
-
Custom script: set x = 0
-
Custom script: loop
-
Custom script: exitwhen x>55
-
Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) + 1)
-
Custom script: set tempPoint = Location((x*32) - 7024 , 6384 - (y*32))
-
Custom script: call SetTerrainPathableBJ( tempPoint, PATHING_TYPE_BUILDABILITY, true )
-
Custom script: call RemoveLocation(tempPoint)
-
Custom script: set x = x + 1
-
-
Custom script: endloop
-
Custom script: set y = y + 1
-
-
Custom script: endloop
-
-