• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Team sorting trigger

Status
Not open for further replies.
Level 7
Joined
Oct 12, 2004
Messages
186
In my new rpg I'm makin, I have two teams. I will have a script that will sort the players into teams based on the 6 races in the game. But for some reason none of my attempts have worked.

Here is my current trigger:
------------------------------------------------------

Chossing Done
Events
Time - Every 0.10 seconds of game time
Conditions
playersDONE Equal to Playernumbers
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
Unit - Make (Picked unit) Vulnerable
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
-------- computer --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Human Warrior
Then - Actions
Player - Make (Picked player) treat Player 11 (Dark Green) as an Enemy
Player - Make (Picked player) treat Player 12 (Brown) as an Ally
Player - Make Player 12 (Brown) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 12 (Brown)
Player Group - Add (Picked player) to goodgroup
Player Group - Add Player 12 (Brown) to goodgroup
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Orc Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Troll Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Undead Warrior
Then - Actions
Player - Make (Picked player) treat Player 11 (Dark Green) as an Ally
Player - Make (Picked player) treat Player 12 (Brown) as an Enemy
Player - Make Player 11 (Dark Green) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 11 (Dark Green)
Player Group - Add (Picked player) to goodgroup
Player Group - Add Player 11 (Dark Green) to evilgroup
Else - Actions
Do nothing
-------- Player 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Human Warrior
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to Human Warrior
Then - Actions
Player - Make (Picked player) treat Player 1 (Red) as an Ally
Player - Make Player 1 (Red) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 1 (Red)
Player - For Player 1 (Red), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Human Warrior
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to Orc Warrior
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to Troll Warrior
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to Undead Warrior
Then - Actions
Player - Make (Picked player) treat Player 1 (Red) as an Enemy
Player - Make Player 1 (Red) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Orc Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Troll Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Undead Warrior
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by Player 1 (Red)))) Equal to Human Warrior
Then - Actions
Player - Make (Picked player) treat Player 1 (Red) as an Enemy
Player - Make Player 1 (Red) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Human Warrior
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to Human Warrior
Then - Actions
Player - Make (Picked player) treat Player 2 (Blue) as an Ally
Player - Make Player 2 (Blue) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 2 (Blue)
Player - For Player 2 (Blue), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Human Warrior
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to Orc Warrior
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to Troll Warrior
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to Undead Warrior
Then - Actions
Player - Make (Picked player) treat Player 2 (Blue) as an Enemy
Player - Make Player 2 (Blue) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Orc Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Troll Warrior
(Unit-type of (First unit of group (Units owned by (Picked player)))) Equal to Undead Warrior
And - All (Conditions) are true
Conditions
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to Dwarf Warrior
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to High Elf Warrior
(Unit-type of (First unit of group (Units owned by Player 2 (Blue)))) Equal to Human Warrior
Then - Actions
Player - Make (Picked player) treat Player 2 (Blue) as an Enemy
Player - Make Player 2 (Blue) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 3 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 3 (Teal) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 3 (Teal) as an Ally
Player - Make Player 3 (Teal) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 3 (Teal)
Player - For Player 3 (Teal), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 3 (Teal) is in evilgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 3 (Teal) as an Enemy
Player - Make Player 3 (Teal) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in evilgroup) Equal to True
(Player 3 (Teal) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 3 (Teal) as an Enemy
Player - Make Player 3 (Teal) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 4 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 4 (Purple) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 4 (Purple) as an Ally
Player - Make Player 4 (Purple) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 4 (Purple)
Player - For Player 4 (Purple), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 4 (Purple) is in evilgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 4 (Purple) as an Enemy
Player - Make Player 4 (Purple) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in evilgroup) Equal to True
(Player 4 (Purple) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 4 (Purple) as an Enemy
Player - Make Player 4 (Purple) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 5 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 5 (Yellow) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 5 (Yellow) as an Ally
Player - Make Player 5 (Yellow) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 5 (Yellow)
Player - For Player 5 (Yellow), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 5 (Yellow) is in evilgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 5 (Yellow) as an Enemy
Player - Make Player 5 (Yellow) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in evilgroup) Equal to True
(Player 5 (Yellow) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 5 (Yellow) as an Enemy
Player - Make Player 5 (Yellow) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 6 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 6 (Orange) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 6 (Orange) as an Ally
Player - Make Player 6 (Orange) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 6 (Orange)
Player - For Player 6 (Orange), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 6 (Orange) is in evilgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 6 (Orange) as an Enemy
Player - Make Player 6 (Orange) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in evilgroup) Equal to True
(Player 6 (Orange) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 6 (Orange) as an Enemy
Player - Make Player 6 (Orange) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 7 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 7 (Green) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 7 (Green) as an Ally
Player - Make Player 7 (Green) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 7 (Green)
Player - For Player 7 (Green), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 7 (Green) is in evilgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 7 (Green) as an Enemy
Player - Make Player 7 (Green) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in evilgroup) Equal to True
(Player 7 (Green) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 7 (Green) as an Enemy
Player - Make Player 7 (Green) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 8 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 8 (Pink) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 8 (Pink) as an Ally
Player - Make Player 8 (Pink) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 8 (Pink)
Player - For Player 8 (Pink), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 8 (Pink) is in evilgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 8 (Pink) as an Enemy
Player - Make Player 8 (Pink) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in evilgroup) Equal to True
(Player 8 (Pink) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 8 (Pink) as an Enemy
Player - Make Player 8 (Pink) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 9 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 9 (Gray) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 9 (Gray) as an Ally
Player - Make Player 9 (Gray) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 9 (Gray)
Player - For Player 9 (Gray), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 9 (Gray) is in evilgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 9 (Gray) as an Enemy
Player - Make Player 9 (Gray) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in evilgroup) Equal to True
(Player 9 (Gray) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 9 (Gray) as an Enemy
Player - Make Player 9 (Gray) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- Player 10 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 10 (Light Blue) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 10 (Light Blue) as an Ally
Player - Make Player 10 (Light Blue) treat (Picked player) as an Ally
Player - For (Picked player), turn Experience sharing Off toward Player 10 (Light Blue)
Player - For Player 10 (Light Blue), turn Experience sharing Off toward (Picked player)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in goodgroup) Equal to True
(Player 10 (Light Blue) is in evilgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 10 (Light Blue) as an Enemy
Player - Make Player 10 (Light Blue) treat (Picked player) as an Enemy
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in evilgroup) Equal to True
(Player 10 (Light Blue) is in goodgroup) Equal to True
Then - Actions
Player - Make (Picked player) treat Player 10 (Light Blue) as an Enemy
Player - Make Player 10 (Light Blue) treat (Picked player) as an Enemy
Else - Actions
Do nothing
-------- pvp --------
Game - Display to (All players) the text: Everyone has create...
Game - Display to (All players) the text: |c00FF0000PvP is no...
-------- gates --------
Destructible - Open Gate (Horizontal) 0007 <gen>
Destructible - Open Demonic Gate (Vertical) 0000 <gen>
Trigger - Turn off (This trigger)

------------------------------------------------------
Please help me out. If you know of a better way to do this please share.

Thanks for your help in advance.
 
Level 22
Joined
May 11, 2004
Messages
2,863
Well, you are using a lot of variables, which you didnt list out. Any effor in those could cause a trigger to fail. I suggest making it a one-shot trigger as opposed to a looping trigger and give players a time limit to chose their races/heroes.

But you are mis-using the picked player action. You cant use (picked player) for opposing sides back to back when setting up allaince status. You have to put a pick player action in between each of them.

SO instead of using "picked player" as the start and then throwing in the long list of condition and action, do a pick player for every individual player and then all the conditions and actions that effect that one player alone...but if you go that route, it would be better to use seperate triggers, at least one for each player then making just one.
-VGsatomi
 
Level 7
Joined
Jul 30, 2004
Messages
451
wow thats humongously long

why not do something like

Code:
(as they are choosing their races put them in player groups pg1, pg2, pg3) or alternatively
for int a = 1 to 12
    if player(a) is user
        if [unit junk you have for human]
            add player(a) to pg1
        else if [unit junk for orc]
            add player(a) to pg2
        else
            add player(a) to pg3
        endif
    endif
endloop

//admitably i'm not sure if this part will work with double picks
pick all players in pg1
    set tempplayer == picked player
    pick all players in pg1
        ally picked player with tempplayer
        ally tempplayer with picked player
        etc...
    endpick
    pick all players in pg2
        enemy picked player with tempplayer
        enemy tempplayer with picked player
        etc...
    endpick
    etc...
endpick

if that doesn't work i suppose you could

for int a = 1 to 12
    if player(a) is in pg1
        pick all players in pg1
            ally player(a) with picked
            etc...
        endpick
        pick all players in pg2
            enemy player(a) with picked
            etc...
        endpick
        etc...
    else if player(a) is in pg2
        etc...
    else
        etc...
    endif
endloop
 
Status
Not open for further replies.
Top