changing team trigger help

Stretch

New Member
Ok guys I will try be as clear as I can.

What I want is, when the unit "king" dies, that triggering player changes to team 2 and gets 2 builders spawned at a certain location they are also allied with every other player in team 2 and all of team 2 are allied with them.

Keep in mind the player might be allied with one or more players from team 1 (its optional).

here's an example:
player 1's king dies
he loses control of all his units
he gets made allies with all of team 2
two builders spawn for him at team 2's base

I would like this adding onto my existing trigger where they lose troops, this trigger is below.

Trigger:
  • Defeat Human
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 9 (Gray) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to King
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • Game - Give all (Triggering player) units to the Neutral Victim player
      • Quest - Display to (All players) the Mission Failed message: ((Name of (Triggering player)) + has been defeated!)


the "has been defeated!" message will be changed but that isn't really relevant right now ^^

Thanks in advance guys :)
 

Accname

2D-Graphics enthusiast
use a generic unit event:
Trigger:
  • Unit - A unit dies


the condition is fine.

the actions should be:
(BEWARE!!! HANDWRITTEN!)
Trigger:
  • Actions
    • set TempGroup = (units owned by (Owner of (Triggering Player)))
    • unit group - pick all units in TempGroup and do
      • loop actions
        • change owner of picked unit to WHATEVER
    • player group - pick all players in TEAM 2 and do
      • loop actions
        • Make (Owner of (Triggering Unit)) treat (picked player) as an ally with shared vision
        • Make (picked player) treat (Owner of (Triggering Unit)) as an ally with shared vision
    • unit - create 2 BUILDER for (Owner of (Triggering Unit)) at SOMEPOSITION facing 270.00 degree

the TEAM 2 should be a player group (force) created somewhere at map init or later or whatever you like.
all capital-letter-only words are some constants or globals you have to set yourself cause i aint know what exactly your map is like.

something like this.
 

Ashlebede

New Member
use a generic unit event:
Trigger:
  • Unit - A unit dies
I disagree. Using the generic event will take more time upon map initialization and will also trigger when, say, neutral hostile units die. If he already entered it for every player individually, there is absolutely no need to make it worse. It would be having went through all the trouble for no reason at all. He should, at least, keep it as it is, since it is better like that, although, in a normal situation, he should have used a generic event.
 

Stretch

New Member
thank you so much Accname, you help me once again, I had to edit a few things to make it work but you helped tons, thanks to you i'm getting much better with variables :)

edit: haha ash I have already changed it to what accname put but if it does reduce the time at map initialization I will put time back into reversing it, I like a nice fast start up map
 

Stretch

New Member
hmm I have a problem where these players are still able to ally and unally the other team and vice versa, is there anyway I can stop the triggering player being able to ally other players by typing -ally (example: -ally red) also I was wanting it so he treats all players not in team 2 as enemies and they do same and won't be able to ally him.

here is my triggers

Defeat trigger for joining team 2
Trigger:
  • Defeat Human
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 9 (Gray) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to King
    • Actions
      • Set tempgroup = (Units owned by (Triggering player))
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • Game - Give all (Triggering player) units to the Neutral Victim player
      • Player Group - Pick every player in Team2 and do (Actions)
        • Loop - Actions
          • Player - Make (Triggering player) treat (Picked player) as an Ally with shared vision
          • Player - Make (Picked player) treat (Triggering player) as an Ally with shared vision
          • Player Group - Add (Triggering player) to Team2
      • Unit - Create 2 Builder for (Triggering player) at (Center of Region 019 <gen>) facing Default building facing degrees
      • Quest - Display to (All players) the Mission Failed message: ((Name of (Triggering player)) + has been defeated and joined the raiders!)
      • Camera - Pan camera for (Triggering player) to (Center of Region 019 <gen>) over 0.00 seconds


my ally trigger

Trigger:
  • Ally
    • Events
      • Player - Player 1 (Red) types a chat message containing -ally as A substring
      • Player - Player 2 (Blue) types a chat message containing -ally as A substring
      • Player - Player 3 (Teal) types a chat message containing -ally as A substring
      • Player - Player 4 (Purple) types a chat message containing -ally as A substring
      • Player - Player 5 (Yellow) types a chat message containing -ally as A substring
      • Player - Player 6 (Orange) types a chat message containing -ally as A substring
      • Player - Player 7 (Green) types a chat message containing -ally as A substring
      • Player - Player 8 (Pink) types a chat message containing -ally as A substring
      • Player - Player 9 (Gray) types a chat message containing -ally as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -ally as A substring
    • Conditions
    • Actions
      • Set stringvariable = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • stringvariable Equal to red
        • Then - Actions
          • Player - Make (Triggering player) treat Player 1 (Red) as an Ally with shared vision
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • stringvariable Equal to blue
            • Then - Actions
              • Player - Make (Triggering player) treat Player 2 (Blue) as an Ally with shared vision
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • stringvariable Equal to teal
                • Then - Actions
                  • Player - Make (Triggering player) treat Player 3 (Teal) as an Ally with shared vision
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • stringvariable Equal to purple
                    • Then - Actions
                      • Player - Make (Triggering player) treat Player 4 (Purple) as an Ally with shared vision
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • stringvariable Equal to yellow
                        • Then - Actions
                          • Player - Make (Triggering player) treat Player 5 (Yellow) as an Ally with shared vision
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • stringvariable Equal to orange
                            • Then - Actions
                              • Player - Make (Triggering player) treat Player 6 (Orange) as an Ally with shared vision
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • stringvariable Equal to green
                                • Then - Actions
                                  • Player - Make (Triggering player) treat Player 7 (Green) as an Ally with shared vision
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • stringvariable Equal to pink
                                    • Then - Actions
                                      • Player - Make (Triggering player) treat Player 8 (Pink) as an Ally with shared vision
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • stringvariable Equal to gray
                                        • Then - Actions
                                          • Player - Make (Triggering player) treat Player 9 (Gray) as an Ally with shared vision
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • stringvariable Equal to lightblue
                                            • Then - Actions
                                              • Player - Make (Triggering player) treat Player 10 (Light Blue) as an Ally with shared vision
                                            • Else - Actions
                                              • Do nothing
 

Accname

2D-Graphics enthusiast
you would need to add another condition here:

Trigger:
  • Set stringvariable = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • stringvariable Equal to red
        • (Player 1 (Red) is in TEAM2) Gleich (Triggering Player is in TEAM2)
      • Then - Actions
        • Player - Make (Triggering player) treat Player 1 (Red) as an Ally with shared vision
      • Else - Actions

with this way one player could only ally other players if either both are within TEAM2 or none of them is in TEAM2.
of course you can change this if needed, its just for you to get the basic idea.
 

Stretch

New Member
hey can I ask where you found this condition as i'm having trouble finding it, also can I ask what the gleich bit is in english? probably why im having trouble finding it :p
 

Stretch

New Member
hmm i'm still having problems, I would like the condition to be where neither of the players are in team 2, so if they are in team 2 they will not be allied.

This is pretty much last important bit of my map and I want to get it right ^^
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    it is all percolating man
  • The Helper The Helper:
    TheHelper.net #1!
  • Wizard Wizard:
    #1
  • The Helper The Helper:
    LOL I love this place
  • Wizard Wizard:
    ;D
  • Wizard Wizard:
    We all do.
  • O Old Mountain Shadow:
    So what is next for thehelper.net? Is there a new set goals yet?
  • The Helper The Helper:
    yes we are going to be expanding
    +1
  • The Helper The Helper:
    help more people
  • The Helper The Helper:
    thank you for asking Old Mountain Shadow hell ya@
  • The Helper The Helper:
    Look at Mountain Shadow in the chat!
  • The Helper The Helper:
    welcome to thehelper.net
  • O Old Mountain Shadow:
    thanks although I'm really kind of regretting this name lol ... is there a way to change it out or will I need to make a new account?
    +1
  • Wizard Wizard:
    One of us can change it for you, I believe. Just send me a PM on what you want.
  • Ghan Ghan:
    Some day we should get the feature where you can change your own name.
  • Wizard Wizard:
    Soon!
  • The Helper The Helper:
    did the mountain shadow get his name changed? personally I think Old Mountain Shadow is a kickass name
  • The Helper The Helper:
    but what do i know lol
  • Wizard Wizard:
    No they haven't had their name changed, it is badass xD
    +1
  • O Old Mountain Shadow:
    Thanks, lol! I haven't quite come up with a good new one yet. I was gonna default to one of my older usernames: Cha Zui = tea drunk in Chinese but then decided it too didn't quite fit right. I'm not asian lol... But I am tall, and old spirited which is sort of where the Old Mountain Shadow came about.
  • O Old Mountain Shadow:
    Either way I appreciate the willingness to help me change it! Should I discover something better I'll swap it, but for now ill stay with what I got.
  • The Helper The Helper:
    If you want a change like they said earlier just let us know
    +1
  • Ghan Ghan:
    Patched and rebooted the server this morning.
  • Ghan Ghan:
  • The Helper The Helper:
    dam pwnkit what a name probably perfectly describes it

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top