- Reaction score
- 149
I have a trigger that is supposed to spawn some boxes around, and it all should work out like this:
yet, it just spawns 3 boxes in a row, additional 1 box on top of those three and then spawns all other on a weird pattern in the middle of the map.
Here is the trigger:
Can anyone see the mistake I made?
Code:
O O O O
O O
O O
O O O O
yet, it just spawns 3 boxes in a row, additional 1 box on top of those three and then spawns all other on a weird pattern in the middle of the map.
Here is the trigger:
Code:
Constructing
Events
Unit - A unit Begins construction
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Constructing structure)) Equal to Small Wooden Citadel
Then - Actions
Set tempCPoint = (Position of (Constructing structure))
Unit - Remove (Constructing structure) from the game
Set tempPoint = (tempCPoint offset by (128.00, -128.00))
Set tempInt = 4
Else - Actions
-------- Build --------
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
For each (Integer B) from 1 to tempInt, do (Actions)
Loop - Actions
Set bPoint = (tempPoint offset by (Real(((Integer B) x 32))) towards (Real((((Integer A) x 1) x 90))) degrees)
Unit - Create 1 Wooden Wall for (Owner of (Triggering unit)) at bPoint facing ((Real((Integer A))) x 90.00) degrees
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer B) Equal to tempInt
Then - Actions
Custom script: call RemoveLocation(udg_tempPoint)
Set tempPoint = bPoint
Else - Actions
Custom script: call RemoveLocation(udg_bPoint)
Can anyone see the mistake I made?