• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Victory Player 12 - Help!

Status
Not open for further replies.
Level 6
Joined
Oct 25, 2018
Messages
108
I want to place a condition of victory for the player 12 that when all the units listed in the trigger die, he will be the winner ... but when killing them, nothing happens ... what did I do wrong? :c

  • Victoria Cuco
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Dying unit) Equal to Sepulturero (Male) 0011 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0010 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0009 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0008 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0007 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0006 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0005 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0004 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0003 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0002 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0000 <gen>
    • Actions
      • Game - Victory Player 12 (Brown) (Show dialogs, Show scores)
      • Player Group - Pick every player in (All allies of Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Show dialogs, Show scores)
      • Player Group - Pick every player in (All enemies of Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Game - Defeat (Picked player) with the message: Defeat!
  • [trigger]
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
1. Remove the And - All (Conditions) are true, without removing the specific conditions, it already checks if they're all true.
2. Why are you using Victory to Player 12 twice? All allies of player 12 (brown) already includes himself... it is written in the window box.
 
Level 7
Joined
Apr 17, 2017
Messages
316
Because the event happens when all units die at the same time. So change your condition to or any conditions are true and set a deathcounter.



  • Victoria Cuco
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - Or (Conditions) are true
        • Conditions
          • (Dying unit) Equal to Sepulturero (Male) 0011 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0010 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0009 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0008 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0007 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0006 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0005 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0004 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0003 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0002 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0000 <gen>
    • Actions
      • Set deathcounter = (deathcounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • deathcounter Equal to 11
        • Then - Actions
        • Game - Victory Player 12 (Brown) (Show dialogs, Show scores)
        • Player Group - Pick every player in (All allies of Player 12 (Brown)) and do (Actions)
          • Loop - Actions
            • Game - Victory (Picked player) (Show dialogs, Show scores)
            • Player Group - Pick every player in (All enemies of Player 12 (Brown)) and do (Actions)
            • Loop - Actions
            • Game - Defeat (Picked player) with the message: Defeat!
      • Else - Actions
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
Because the event happens when all units die at the same time. So change your condition to or any conditions are true and set a deathcounter.



  • Victoria Cuco
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - Or (Conditions) are true
        • Conditions
          • (Dying unit) Equal to Sepulturero (Male) 0011 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0010 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0009 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0008 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0007 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0006 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0005 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0004 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0003 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0002 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0000 <gen>
    • Actions
      • Set deathcounter = (deathcounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • deathcounter Equal to 11
        • Then - Actions
        • Game - Victory Player 12 (Brown) (Show dialogs, Show scores)
        • Player Group - Pick every player in (All allies of Player 12 (Brown)) and do (Actions)
          • Loop - Actions
            • Game - Victory (Picked player) (Show dialogs, Show scores)
            • Player Group - Pick every player in (All enemies of Player 12 (Brown)) and do (Actions)
            • Loop - Actions
            • Game - Defeat (Picked player) with the message: Defeat!
      • Else - Actions
No? Thats just like doing "All conditions are true then do actions" but with more unnecessary stuff like variables, they're clearly not needed. The event fires everytime a unit dies, not when units die at same time, that's pretty unrealistic and almost impossible.
 
Level 7
Joined
Apr 17, 2017
Messages
316
No? Thats just like doing "All conditions are true then do actions" but with more unnecessary stuff like variables, they're clearly not needed. The event fires everytime a unit dies, not when units die at same time, that's pretty unrealistic and almost impossible.

Here is the proof with and/or any conditions are true:
  • death event
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Forest Troll High Priest 0005 <gen>
          • (Triggering unit) Equal to Black Spider 0006 <gen>
          • (Triggering unit) Equal to Forest Troll Warlord 0004 <gen>
    • Actions
      • Custom script: call BJDebugMsg(GetUnitName(GetTriggerUnit()))
What I am trying to say is and all conditions are true checks these death conditions. so if x unit is dead, it can't die again right ? so event wont fire as you can see.
 

Attachments

  • or any conditions are true.png
    or any conditions are true.png
    1.3 MB · Views: 49
  • and all conditions are true.png
    and all conditions are true.png
    1.3 MB · Views: 46

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
Here is the proof with and/or any conditions are true:
  • death event
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Forest Troll High Priest 0005 <gen>
          • (Triggering unit) Equal to Black Spider 0006 <gen>
          • (Triggering unit) Equal to Forest Troll Warlord 0004 <gen>
    • Actions
      • Custom script: call BJDebugMsg(GetUnitName(GetTriggerUnit()))
What I am trying to say is and all conditions are true checks these death conditions. so if x unit is dead, it can't die again right ? so event wont fire as you can see.
Yeah you're right. Somehow I mistook the conditions for a boolean "is unit dead" lol. Guess I was just reading it as a solution to the problem.
 
Level 6
Joined
Oct 25, 2018
Messages
108
Because the event happens when all units die at the same time. So change your condition to or any conditions are true and set a deathcounter.



  • Victoria Cuco
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - Or (Conditions) are true
        • Conditions
          • (Dying unit) Equal to Sepulturero (Male) 0011 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0010 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0009 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0008 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0007 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0006 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0005 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0004 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0003 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0002 <gen>
          • (Dying unit) Equal to Sepulturero (Male) 0000 <gen>
    • Actions
      • Set deathcounter = (deathcounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • deathcounter Equal to 11
        • Then - Actions
        • Game - Victory Player 12 (Brown) (Show dialogs, Show scores)
        • Player Group - Pick every player in (All allies of Player 12 (Brown)) and do (Actions)
          • Loop - Actions
            • Game - Victory (Picked player) (Show dialogs, Show scores)
            • Player Group - Pick every player in (All enemies of Player 12 (Brown)) and do (Actions)
            • Loop - Actions
            • Game - Defeat (Picked player) with the message: Defeat!
      • Else - Actions


I did the test with this and it did not work ... I missed something? ...


  • Victoria Cuco
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Dying unit) Equal to 0011 <gen>
          • (Dying unit) Equal to 0010 <gen>
          • (Dying unit) Equal to 0009 <gen>
          • (Dying unit) Equal to 0008 <gen>
          • (Dying unit) Equal to 0007 <gen>
          • (Dying unit) Equal to 0006 <gen>
          • (Dying unit) Equal to 0005 <gen>
          • (Dying unit) Equal to 0004 <gen>
          • (Dying unit) Equal to 0003 <gen>
          • (Dying unit) Equal to 0002 <gen>
          • (Dying unit) Equal to 0000 <gen>
    • Actions
      • Set deathcounter = (deathcounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • deathcounter Equal to 11
        • Then - Actions
          • Game - Victory Player 12 (Brown) (Show dialogs, Show scores)
          • Player Group - Pick every player in (All allies of Player 12 (Brown)) and do (Actions)
            • Loop - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
              • Player Group - Pick every player in (All enemies of Player 12 (Brown)) and do (Actions)
                • Loop - Actions
              • Game - Defeat (Picked player) with the message: Defeat!
        • Else - Actions
  • [trigger]
 
Level 7
Joined
Apr 17, 2017
Messages
316
Pretty sure the event is working. Are you sure that player 12 is your ally ? Also move the last line inside loop block and seperate player group loops. I messed up the bbcode so it looks like that.

Edit: also change your condition to or any conditions are true
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Bro, you don't have to use counters, you're making it a far reach. Well the most guaranteed and easiest approach from me is to check PERIODICALLY if all the units are dead.
This is how you do it :

- First of all, I want you to make two triggers, a trigger that is periodic (Runs every 1 second to check all the time if all players have died), once all players die, it will run another trigger, which is that of victory and round end.

  • Checker for round end
    • 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
          • (Your unit Number 1 is dead) Equal to True
          • (Your unit Number 2 is dead) Equal to True ...etc (apply this to all units)
        • Then - Actions
          • Trigger - Run VICTORY ROUND END TRIGGER <gen> (ignoring conditions)
          • Trigger - Turn off (This trigger) (This is an important line because this trigger has to be turned off or the game will bug and run the second victory trigger many times)
        • Else - Actions
That's all to it, it's simple, two triggers, one that checks for players' deaths periodically (every 1 second), and another trigger that is isolated from it and has no events, but it will run using the first trigger when all the conditions are met.

The beauty of this trigger is that it is simple, and efficient, and will surely work.
 
Level 7
Joined
Apr 17, 2017
Messages
316
Bro, you don't have to use counters, you're making it a far reach. Well the most guaranteed and easiest approach from me is to check PERIODICALLY if all the units are dead.
This is how you do it :

- First of all, I want you to make two triggers, a trigger that is periodic (Runs every 1 second to check all the time if all players have died), once all players die, it will run another trigger, which is that of victory and round end.

  • Checker for round end
    • 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
          • (Your unit Number 1 is dead) Equal to True
          • (Your unit Number 2 is dead) Equal to True ...etc (apply this to all units)
        • Then - Actions
          • Trigger - Run VICTORY ROUND END TRIGGER <gen> (ignoring conditions)
          • Trigger - Turn off (This trigger) (This is an important line because this trigger has to be turned off or the game will bug and run the second victory trigger many times)
        • Else - Actions
That's all to it, it's simple, two triggers, one that checks for players' deaths periodically (every 1 second), and another trigger that is isolated from it and has no events, but it will run using the first trigger when all the conditions are met.

The beauty of this trigger is that it is simple, and efficient, and will surely work.
How does using counter make it far reach? I am pretty sure It's easier to add an integer variable than a whole trigger that checks if x,y are dead periodically but also more efficient performance wise
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
Aeryn's approach works and is one of the most solid and effective approach.
Another way would be to check if all those units are dead on death event, do your stuff and turn off the trigger.
Periodically checking? That is just ugly and inaccurate in timing.
Remove the first Game - Victory Player 12 (Brown) (Show dialogs, Show scores), it isn't doing anything there.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
How does using counter make it far reach? I am pretty sure It's easier to add an integer variable than a whole trigger that checks if x,y are dead periodically but also more efficient performance wise

I certainly didn't mention the difference in efficiency between my method and yours. Obviously, using an increment variable is always the best solution, yet, it makes it a far reach for someone who is, with no offense, a newbie to World Editing, and I would suggest the periodic trigger for a better reach. I would suggest the integer one, but we're here giving him the closest approaches, then he can decide whether to enhance his trigger from performance's and efficiency's perspective.

Aeryn's approach works and is one of the most solid and effective approach.
Another way would be to check if all those units are dead on death event, do your stuff and turn off the trigger.
Periodically checking? That is just ugly and inaccurate in timing.
Remove the first Game - Victory Player 12 (Brown) (Show dialogs, Show scores), it isn't doing anything there.

I am not sure if that's the right choice of words. I would kindly mention again that I didn't criticize his approach and I never said it didn't work, it's a far reach for the OP. But I would suggest it more than the periodic trigger. However, it seems you have exaggerated in your description about the periodic trigger. A one-second periodic checking has no effect howsoever on the performance especially if the trigger has a condition-barrier so it's never triggered past the conditions, that makes it, according to my calculations, as fast as your triggers, and it takes no memory howsoever.

About the inaccuracy in timing, it just depends on the interval. A one second interval is by no mean ugly and inaccurate, and is barely noticeable.

If we are talking efficiency-wise, I would certainly go for Aeryn's solution, but if we're talking newbie-friendly-wise, periodic checks work every time.
 
Status
Not open for further replies.
Top