- Joined
- Dec 17, 2005
- Messages
- 337
I've been busting my brain trying to think of a formula and trigger that can do this:
If player 1 and 2 are playing, set player 2 as player 1's enemy
if player 2 isn't playing, set player 3 as player 1's enemy
etc...
It has to do this for every player (up to 8 players), setting the next player in line (1,2,3,4...) as the enemy for the player just before him. The problem I have is making it so that player 8 searches for enemies from player 1 and up instead of player 9 to infinity.
I've currently got something where:
I know this must be confusing but all I really need in simplicity is a formula that makes searching go in a circle from 1-8 and back to 1 instead of going to 9.
If player 1 and 2 are playing, set player 2 as player 1's enemy
if player 2 isn't playing, set player 3 as player 1's enemy
etc...
It has to do this for every player (up to 8 players), setting the next player in line (1,2,3,4...) as the enemy for the player just before him. The problem I have is making it so that player 8 searches for enemies from player 1 and up instead of player 9 to infinity.
I've currently got something where:
-
Remove Unplaying
-
Events
- Player - Player 1 (Red) leaves the game
- Player - Player 2 (Blue) leaves the game
- Player - Player 3 (Teal) leaves the game
- Player - Player 4 (Purple) leaves the game
- Player - Player 5 (Yellow) leaves the game
- Player - Player 6 (Orange) leaves the game
- Player - Player 7 (Green) leaves the game
- Player - Player 8 (Pink) leaves the game
- Conditions
-
Actions
-
For each (Integer A) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Player((Integer A))) slot status) Equal to Is playing
- ((Player(((Integer A) + 1))) slot status) Equal to Is playing
-
Then - Actions
- Set PlayersEnemy[(Integer A)] = (Player(((Integer A) + 1)))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 8, do (Actions)
-
Events
I know this must be confusing but all I really need in simplicity is a formula that makes searching go in a circle from 1-8 and back to 1 instead of going to 9.
Last edited: