Need Help With Defeat

Pyroflame

New Member
Reaction score
4
How can I make it so that when all heros of players one through seven, it defeats them all; as opposed to defeating them one at a time (possibly defeating the host and ruining the game).

So far I have:

~ Events ~
Unit - A unit owned by Player 1 (Red) Dies
Unit - A unit owned by Player 2 (Red) Dies
Unit - A unit owned by Player 3 (Red) Dies
Unit - A unit owned by Player 4 (Red) Dies
Unit - A unit owned by Player 5 (Red) Dies
Unit - A unit owned by Player 6 (Red) Dies
Unit - A unit owned by Player 7 (Red) Dies

~ Conditions ~
((Dying unit) is (A Hero) equal to True

And that's it.

I know I'd have to count units owned by players one through seven some how as a total, and if it were to equal 0 then defeat them all. I'm not sure how to do this though.
 

Exide

I am amazingly focused right now!
Reaction score
448
If your enemy/computer players doesn't have a Hero you can do this:

Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set DefeatGroup = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in DefeatGroup) Equal to 0
        • Then - Actions
          • -------- Defeat Players Here.. --------
        • Else - Actions
      • Custom script: call DestroyGroup(udg_DefeatGroup)


You can also create this group at the start of the game, like this:

Trigger:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Add Paladin 0000 <gen> to DefeatGroup
      • Unit Group - Add Archmage 0001 <gen> to DefeatGroup
      • Unit Group - Add Mountain King 0002 <gen> to DefeatGroup
      • Unit Group - Add Blood Mage 0003 <gen> to DefeatGroup


Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Number of units in DefeatGroup) Equal to 0
    • Actions
      • -------- Defeat Players Here.. --------


You can do it in lots of ways. It depends on your map.
 

Azlier

Old World Ghost
Reaction score
461
I'm quite sure that heroes aren't cleaned from unit groups on death.
 

Pyroflame

New Member
Reaction score
4
Thanks, but there is one computer, which has 4 heros to be exact.

Each player chooses from one of twelve custom heros at the start of the game, from taverns. And the only reason I checked to see if the dying unit was a hero, was becuase some heros have summons.

But I do see what you were doing with the Unit Groups. So maybe perhaps when a player purchases his hero I would need to add (purchased unit) to the unit group? Then if the player decides to -repick, I would have to remove it? Or again, when the hero dies, it would get removed from the group. And when the group hits 0, game over?
 

Exide

I am amazingly focused right now!
Reaction score
448
Like I said: You can do this in tons of different ways, it depends on your map.
In order to help you further, with a more detailed trigger, I need to see your triggers for chosing heroes. -So that you can assign them to variables.

I, personally, always create a unit array variable named Hero. Then set Hero[*Player number*] = *unit*.
-That way I always know where to get a certain unit.

I suggest you do something similar, then use a loop to add these units into a unit group. Then you can use my trigger in post #2 of this thread.
 

HydraRancher

Truth begins in lies
Reaction score
197
You could do:
Trigger:
  • Defeat
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Red) Dies
      • Unit - A unit owned by Player 3 (Red) Dies
      • Unit - A unit owned by Player 4 (Red) Dies
      • Unit - A unit owned by Player 5 (Red) Dies
      • Unit - A unit owned by Player 6 (Red) Dies
      • Unit - A unit owned by Player 7 (Red) Dies
    • Conditions
      • (Dying unit) is (A Hero) equal to True
    • Actions
      • For each integer A from 1 to 7 do actions
        • Defeat Player(Integer A) with message You Fail

if I understand what you want
 

Pyroflame

New Member
Reaction score
4
You could do:
Trigger:
  • Defeat
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Red) Dies
      • Unit - A unit owned by Player 3 (Red) Dies
      • Unit - A unit owned by Player 4 (Red) Dies
      • Unit - A unit owned by Player 5 (Red) Dies
      • Unit - A unit owned by Player 6 (Red) Dies
      • Unit - A unit owned by Player 7 (Red) Dies
    • Conditions
      • (Dying unit) is (A Hero) equal to True
    • Actions
      • For each integer A from 1 to 7 do actions
        • Defeat Player(Integer A) with message You Fail

if I understand what you want

Not quite, wanted it to only defeat everyone after everyone is dead. I'll look into what exide said.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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