changing team trigger help

Stretch

New Member
Reaction score
0
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
Reaction score
1,462
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
Reaction score
43
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
Reaction score
0
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
Reaction score
0
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
Reaction score
1,462
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
Reaction score
0
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
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
oh i am sorry, its a boolean comparison. blablaA equal to blablaB
 

Stretch

New Member
Reaction score
0
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.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top