1 team left

T

Todilo

Guest
How can I see if a hero dies and if the remaining heroes is in the same team. The team consists of either 1 or 2 players ...

Someon HAS to know how to do this .. please
 
This is a tricky way( It must be a easier way):

Trigger 1 (Map initialization and if trigger needed again)
This one is to make the whole thing work with both 1 or 2 players




Events
Map initialization
Conditions
Actions
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Not equal to Is playing
Then - Actions
Set TeamDead[1] = (TeamDead[1] + 1)
Else - Actions
Do nothing
For each (Integer A) from 3 to 4, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Not equal to Is playing
Then - Actions
Set TeamDead[2] = (TeamDead[2] + 1)
Else - Actions
Do nothing
For each (Integer A) from 5 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Not equal to Is playing
Then - Actions
Set TeamDead[3] = (TeamDead[3] + 1)
Else - Actions
Do nothing
For each (Integer A) from 7 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) Not equal to Is playing
Then - Actions
Set TeamDead[4] = (TeamDead[4] + 1)
Else - Actions
Do nothing
For each (Integer A) from 9 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Not equal to Is playing
Then - Actions
Set TeamDead[5] = (TeamDead[5] + 1)
Else - Actions
Do nothing


Trigger 2 (When Hero dies)




Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is an ally of Player 1 (Red)) Equal to True
((Owner of (Triggering unit)) is an ally of Player 2 (Blue)) Equal to True
Then - Actions
Set TeamDead[1] = (TeamDead[1] + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is an ally of Player 3 (Teal)) Equal to True
((Owner of (Triggering unit)) is an ally of Player 4 (Purple)) Equal to True
Then - Actions
Set TeamDead[2] = (TeamDead[2] + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is an ally of Player 5 (Yellow)) Equal to True
((Owner of (Triggering unit)) is an ally of Player 6 (Orange)) Equal to True
Then - Actions
Set TeamDead[3] = (TeamDead[3] + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is an ally of Player 7 (Green)) Equal to True
((Owner of (Triggering unit)) is an ally of Player 8 (Pink)) Equal to True
Then - Actions
Set TeamDead[4] = (TeamDead[4] + 1)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is an ally of Player 9 (Gray)) Equal to True
((Owner of (Triggering unit)) is an ally of Player 10 (Light Blue)) Equal to True
Then - Actions
Set TeamDead[5] = (TeamDead[5] + 1)
Else - Actions
Do nothing
Trigger - Run Win Check <gen> (checking conditions)




Trigger 3(Win Check)
Check if it's only 1 team left( Inseed of -------- Victory Team X -------- you will have to put in some actions)



Win Check
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DeadInteger[1] Equal to 2
DeadInteger[2] Equal to 2
DeadInteger[3] Equal to 2
DeadInteger[4] Equal to 2
Then - Actions
-------- Victory Team 5 --------
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DeadInteger[1] Equal to 2
DeadInteger[2] Equal to 2
DeadInteger[3] Equal to 2
DeadInteger[5] Equal to 2
Then - Actions
-------- Victory Team 4 --------
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DeadInteger[1] Equal to 2
DeadInteger[2] Equal to 2
DeadInteger[4] Equal to 2
DeadInteger[5] Equal to 2
Then - Actions
-------- Victory Team 3 --------
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DeadInteger[1] Equal to 2
DeadInteger[3] Equal to 2
DeadInteger[4] Equal to 2
DeadInteger[5] Equal to 2
Then - Actions
-------- Victory Team 2 --------
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DeadInteger[2] Equal to 2
DeadInteger[3] Equal to 2
DeadInteger[4] Equal to 2
DeadInteger[5] Equal to 2
Then - Actions
-------- Victory Team 1 --------
Else - Actions
Do nothing




If your up to use this more than once you will have to run "Trigger 1" again

This seems to bee mutch work for such a small thing. Can anyone do it better?
 
thank you SO much for taking time to do this. I will try it right away but as you said there HAS to be a shorter, less complex version.

Btw is there a way to sort of copy the triggers you made or do I have to do them manually?
 
Code:
TestVictory
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
        (Number of units in (Units in (Playable map area) matching (((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is alive) Equal to True)) and (((Owner of (Matching unit)) is an enemy of Player 1 (Red)) Equal to True)))) Equal to 0
    Actions
        Game - Victory Player 1 (Red) (Show dialogs, Show scores)

That might be a bit involved to type back in...
And, you will have to repeat it for every player.


A somewhat simpler way would be to use two integer variables that
count the number of Heroes per team.
If one of them gets 0, the other team wins.
 
could you please do an example of that. I am really new to this editing. If it is not too much trouble that is
 
Code:
NewHero
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Entering unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Entering unit)) Equal to Player 1 (Red)
                        (Owner of (Entering unit)) Equal to Player 2 (Blue)
            Then - Actions
                Set HeroesTeam1 = (HeroesTeam1 + 1)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Entering unit)) Equal to Player 3 (Teal)
                        (Owner of (Entering unit)) Equal to Player 4 (Purple)
            Then - Actions
                Set HeroesTeam2 = (HeroesTeam2 + 1)
            Else - Actions

Whenever a new Hero enters the map,
if it belongs to player 1 or player 2, we add 1 to the number of Heroes of team 1,
if it belongs to player 3 or player 4, we add 1 to the number of Heroes of team 2.


Code:
HeroDies
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Dying unit)) Equal to Player 1 (Red)
                        (Owner of (Dying unit)) Equal to Player 2 (Blue)
            Then - Actions
                Set HeroesTeam1 = (HeroesTeam1 - 1)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Dying unit)) Equal to Player 3 (Teal)
                        (Owner of (Dying unit)) Equal to Player 4 (Purple)
            Then - Actions
                Set HeroesTeam1 = (HeroesTeam1 - 1)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                HeroesTeam1 Equal to 0
            Then - Actions
                Game - Defeat Player 1 (Red) with the message: Defeat!
                Game - Defeat Player 2 (Blue) with the message: Defeat!
                Game - Victory Player 3 (Teal) (Show dialogs, Show scores)
                Game - Victory Player 4 (Purple) (Show dialogs, Show scores)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                HeroesTeam2 Equal to 0
            Then - Actions
                Game - Victory Player 1 (Red) (Show dialogs, Show scores)
                Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
                Game - Defeat Player 3 (Teal) with the message: Defeat!
                Game - Defeat Player 4 (Purple) with the message: Defeat!
            Else - Actions

Almost the same, only the other way around,
we subtract 1 from the Hero count of one team.
If that count gets 0, that team loses, the other one wins.


HeroesTeam1 and HeroesTeam2 are variables of type "integer".

This assumes that all Heroes in your map are created, or bought, or found somewhere.
If there are any pre-placed Heroes, you must set the default values of 0
for those variables to the actual number of Heroes in the map at game start.

This also assumes that your teams are:
Team 1 = player 1 and player 2,
Team 2 = player 3 and player 4.
If they are different, change the numbers accordingly.
 
It took some time but now I have created triggers. I have 5 teams :p. I also added a trigger conditin for the hero dies, "arena_fight is true". How should I make the victory condition, I am going to reward the winners something and then return everyone to their fighting places(somewhere else on the map).
 
I have limited testing abilities and are therefore wondering if the

Game - victory

ends the game?
I guess it does but I really don't want that, YET :D.
 
Ok. I send a message and make a region available so that the players can leave and when they do so they will be teleported. I just have to revive all the heroes too, a bit tricky. And I have to do that BEFORE they leave the arena. And when one player leaves ALL should move.

Ok fixed everything but to revive the heroes instantly when killed. Then when the arena fight ends I also have to re-add or re-fill the HeroesinTeam 1/2/3/4/5 somehow since they will fight more than once.

This is all the triggers I have come up with so far, if anyone care to take a look. My first map attemt so it might be a bit messy :p.

Triggers
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    I think on the new one they did change it, but idk. I don't really care whatever the government is doing right now because it's consistently absurd. Like what is RFK doing in charge of health anything? I love the bear story because WTF was that, but also, pretty much every time he talks it's WTF. Like even his voice sounds microwaved
    +1
  • Varine Varine:
    The pyramid is fucking dumb as shit, no matter how you arrange it.
  • Varine Varine:
    It's actually remarkably easy to make mayonnaise though. Fun fact, it USED to kind of be a French mother sauce. I believe that Careme considered it one, it may have been aioli but that has also built a different meaning than it used to. An aioli is just mayonnaise I mixed with other shit typically, I didn't start it don't come at me
  • Varine Varine:
    It's very hard to do it on a large scale though
  • Varine Varine:
    Depending on how you pour the oil the consistency can vary wildly, but that's true for most emulsions. I can only make about two quarts at a time with my robo coup, and if I have to make several in series because I forgot to order it becomes really obvious even when I do it. We have to wait and mix them all together to make sure we have the same thing.
  • Varine Varine:
    Hollandaise is also kind of like that, emulsions require a very steady hand to do exactly the same every time.
  • Varine Varine:
    Luckily I live in an age with electricity so it's way fucking faster, but when I was just a boy trying to find my place I had some hardcore chefs that made use do things like that by hand. It is WAY easier to get right by hand because you control it and can feel it, but it takes soooooo much longer. And on the scale a modern kitchen requires... I serve 400-500 guests on average per day right now, if I had 100 then we could do things way better
  • Varine Varine:
    But we can't do that. In the winter yeah, but I HAVE to get people through here right now so I can afford the staff that we CAN do that. We have about 100 days of summer, and if that summer doesn't make us what it will, then I can't operate the other most of the year with my staff. The owner is talking about closing two days a week to cut down on labor, I told him he should cut down on vacations and it did not go great. I do think I won though, I have to keep my fucking core staff and they have to be gainfully employed
  • Varine Varine:
    Sure some of them might take a second job, but I can't just cut my entire staff to unlivable hours, nor can I can cut them off all winter if I want them to come back.
  • Varine Varine:
    And also, there is no fucking way I'm pulling these hours come september. I only do this right now because I have to, the second I don't have to be the one doing it I won't be
  • Varine Varine:
    I have a 5 person core staff in the kitchen, not including me or Chef Ben
  • Varine Varine:
    Though two of those people are likely not making it this year. One of them has been replaced, the other I am kind of trying to. He's being a giant bitch, today I had to get onto him because in the three hours before I left he had taken like thirty minutes for cigarette breaks
  • Varine Varine:
    And he was also complaining to me the other day that he was out of weed so couldn't smoke any before work that day, and was confused about why I was annoyed he was telling me, his boss, that he is smoking weed everyday before work.
    +1
  • Varine Varine:
    Like yeah I can tell. I don't need to fucking know.
  • Varine Varine:
    So now he's getting scrutinized and will not be top of the list. I know I don't have the smartest people but I do expect them to have some common fucking sense
  • Varine Varine:
    I did do a rare thing for me and hire a girl last month without warning. Everyone was made at me because I started her at like 21, but she worked with me before and I was like don't care. She made 19 at her old job and I wanted her to come work with me, she is the best
    +1
  • Varine Varine:
    I'm going to get her a raise at the end of the summer. She wants to go to school again, but I want her to still work with me so.... she kind of can just tell me what the price is. I can go to 25 if she keeps up. I need to get her onto line more, that's what she wants, but I need her where she is and it's not fair that she doesn't get the little bit of raise that comes with it. She can do it no problem, I've worked with her there.
  • Varine Varine:
    It's just hard to move and train people unnecessarily right now. And also the line fucking sucks, it's not any more fun. This is turn and burn so I have the bankroll, and everyone suffers for it
  • Varine Varine:
    Eventually we'll get it balanced, we'
  • Varine Varine:
    we're starting online orders and stuff, but I also turn that off all the time because I barely keep up trying to be the best at Sysco shit
  • Varine Varine:
    I think it's gonna be a good fall and winter though. We're going to have a good staff, they will get along, they will be able to manage the workload and the complications, they know how to really cook this year, like every person on line knows their steak temps. Some of them use thermometers a lot and they don't always use them right, but they do know how to do it. Failure, especially in this field, is the only way to get better. They'll get it
  • Varine Varine:
    They won't get feel down while they do the thermometer, but we didn't have an instant read probe when I was learning. Like they did but god knows how off it is, you HAD to do it by feel. Even if the chef was fine with me bringing my own, it takes too long. Poke and know
  • The Helper The Helper:
    420 threads in the Artificial Intelligence forum :)
  • The Helper The Helper:
    Happy Monday!
    +1
  • The Helper The Helper:
    and then it was Tuesday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top