- Joined
- Jan 1, 2009
- Messages
- 94
I'm currently working on a fun map, invented by me and a friend.
Its some kind of Tic-Tac-Toe extreme and therefor i tried to create a system, which creates the X or O for the player.
On the map are 9 Boxes with one unit in it which looks like an O, X or an invisible one (saved in an unitarray named Kasten_inner[])
each Box is surrounded by 4 flags (all saved in unitgrouparray named Kasten[]), which all have to be conquered to mark the Box.
Int[] is just an integerarray for the loop action.
The Boxes and Flags are all saved in the arrays at map initialization.
The flags are saved in the array like this:
and the centerunit (which is at the beginnig an invisible unit) like this:
This system should mark a Box with an X or O if the player ownes all 4 Flags surrounding it:
Could anyone help me?
If more triggers need to be posted please tell.
PS: I actually know that i have some leaks in it, but i just want to get it work first and then remove leaks.
Its some kind of Tic-Tac-Toe extreme and therefor i tried to create a system, which creates the X or O for the player.
On the map are 9 Boxes with one unit in it which looks like an O, X or an invisible one (saved in an unitarray named Kasten_inner[])
each Box is surrounded by 4 flags (all saved in unitgrouparray named Kasten[]), which all have to be conquered to mark the Box.
Int[] is just an integerarray for the loop action.
The Boxes and Flags are all saved in the arrays at map initialization.
The flags are saved in the array like this:
-
Unit Group - Add flagpole 0023 <gen> to Kasten[1]
-
Unit Group - Add flagpole 0024 <gen> to Kasten[1]
-
Unit Group - Add flagpole 0025 <gen> to Kasten[1]
-
Unit Group - Add flagpole 0026 <gen> to Kasten[1]
-
Unit Group - Add flagpole 0027 <gen> to Kasten[2]
-
Unit Group - Add flagpole 0028 <gen> to Kasten[2]
and the centerunit (which is at the beginnig an invisible unit) like this:
-
Set Kasten_inner[1] = empty box 0000 <gen>
This system should mark a Box with an X or O if the player ownes all 4 Flags surrounding it:
-
Events
-
Map initialization
-
Time - Every 0.30 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer Int[1]) from 1 to 9, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units owned by Player 1 (Red) matching (((Matching unit) is in Kasten[Int[1]]) Equal to True))) Equal to 4
-
(Owner of Kasten_inner[Int[1]]) Not equal to Player 1 (Red)
-
-
Then - Actions
-
Unit - Create 1 X for Player 1 (Red) at (Position of Kasten_inner[Int[1]]) facing Default building facing (270.0) degrees
-
Set Kasten_inner[Int[1]] = (Last created unit)
-
Game - Display to (All players) the text: |c00ff0000Sign set!...
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units owned by Player 2 (Blue) matching (((Matching unit) is in Kasten[Int[1]]) Equal to True))) Equal to 4
-
(Owner of Kasten_inner[Int[1]]) Not equal to Player 2 (Blue)
-
-
Then - Actions
-
Unit - Create 1 O for Player 2 (Blue) at (Position of Kasten_inner[Int[1]]) facing Default building facing (270.0) degrees
-
Unit - Remove Kasten_inner[Int[1]] from the game
-
Set Kasten_inner[Int[1]] = (Last created unit)
-
Game - Display to (All players) the text: |c00ff0000Sign Set!...
-
-
Else - Actions
-
-
-
-
Could anyone help me?
If more triggers need to be posted please tell.
PS: I actually know that i have some leaks in it, but i just want to get it work first and then remove leaks.