2 teams victory trigger problem

  • Thread starter Thread starter new bed
  • Start date Start date
N

new bed

Guest
Recently i began creating a map with 2 teams : players red,blue,teal,orange on team 1, and players light blue,yellow, green, grey on team 2.

Each player recieves a hero in the beggining of the game. I want to make it so that once all of the heroes of team 1 are dead team 2 wins and vica versa. I know i am not supposed to be asking for help on this one but i really tried it on my own for 2 days and i dont know how to make it work. please help if you can. Thank you.
 
For an easy way you can make a integer variable array size 2.

And when a hero by player 1 dies make Integer[1] = Integer[1] + 1
Same for team 2 but with [2], and just make it when the integer reaches a certain amount make them lose
1 sec leme make the trigger so you can see exactly what i mean
 
Code:
Set Variable
    Events
        Time - Elapsed game time is 0.10 seconds
    Conditions
    Actions
        Player Group - Add Player 1 (Red) to Teams[1]
        Player Group - Add Player 2 (Blue) to Teams[1]
        -------- Team2 --------
        Player Group - Add Player 3 (Teal) to Teams[2]
        Player Group - Add Player 4 (Purple) to Teams[2]

Code:
Hero Dies
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        If ((Owner of (Dying unit)) Equal to Player 1 (Red)) then do (Set Integer[1] = (Integer[1] + 1)) else do (Do nothing)
        If ((Owner of (Dying unit)) Equal to Player 2 (Blue)) then do (Set Integer[1] = (Integer[1] + 1)) else do (Do nothing)
        -------- Team 2 --------
        If ((Owner of (Dying unit)) Equal to Player 3 (Teal)) then do (Set Integer[2] = (Integer[2] + 1)) else do (Do nothing)
        If ((Owner of (Dying unit)) Equal to Player 4 (Purple)) then do (Set Integer[2] = (Integer[2] + 1)) else do (Do nothing)


Code:
Win
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Integer[1] Equal to 2
            Then - Actions
                Player Group - Pick every player in Teams[1] and do (Game - Victory (Picked player) (Show dialogs, Show scores))
                Player Group - Pick every player in Teams[2] and do (Game - Defeat (Picked player) with the message: Defeat!)
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Integer[2] Equal to 2
            Then - Actions
                Player Group - Pick every player in Teams[1] and do (Game - Defeat (Picked player) with the message: Defeat!)
                Player Group - Pick every player in Teams[2] and do (Game - Victory (Picked player) (Show dialogs, Show scores))
            Else - Actions
                Do nothing
 
2 nd code

for the second code the first even is 'unit dies'. but in the editor i cant do this...
 
Hmm

For the second code: the action part :

Player 1 (Red)) then do (Set Integer[1] = (Integer[1] + 1)) else do (Do nothing)


I was able to fulfil every part except where i have to (Set Integer[1] = (Integer[1] + 1)) . is this yet another variable ?? i was unable to find how to accomplish this. :p
 
ok when you use the set command (set veriable) choose the variable you want to set... then you want to set it to (in this case an integer) arithmatic(should be autochosen for you)... put the variable that you are using in the left and the rest ( the " + 1") sould be set in the way you need it.
 
...

Does any1 know how to make it so that a unit would harvest lumber at a slower rate, and wouldnt have to go back to castle ?
 
If you dont want it to be a wisp, you can simply swap out the ability on another unit and add the Harvest Wisp Lumber Instead.
 
Another strange problem

okay. i followed ace heart's tutorial on how to create dialog boxes so ppl could choose heros in the beggining. everything works except for 1 minor detail. the names of heros are not exactly on the buttons except for 1st hero.

example of what im talking about:

Button1 - hero
2nd hero
button2
3rd hero
button3
4th hero
button4

You get the idea. I would like to direct your atttention to yet another detail. the names dont appear exactly between buttons which means that it might not be an integer problem. each hero after the first one is slightly higher on the button than they should be.

Any ideas ???? :banghead:
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1
  • The Helper The Helper:
    Weekend went by too fast. Next weekend I am going to try to do a nature thing - buddy of mine lives by the Colorado river and has some kayaks and invited me to do some kayaking from a place he knows to get on the river.
  • Ghan Ghan:
    That sounds like an adventure.
  • The Helper The Helper:
    400 users all online all looking at latest content

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top