• 🏆 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!

[Trigger] Problem with Victory Trigger

Status
Not open for further replies.

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Annoying Problem with Victory Trigger

Hey all I have been fiddling with a custom victory trigger for awhile and it is getting real annoying. I have come a long way trying to get this to work but it still fails in a few areas.

The main problem I have is that Removing the triggering player from the player group doesn't work therefore it is impossible to have 0 as a player group #. This basically throws a wrench into the entire thing. No matter what, it doesn't decrease the #. Even if that player is defeated. I have been testing this on computers, so I am unsure of if it would reduce that for actual players on something like Battle.net.

  • Victory Conditions
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering player) slot status) Equal to Is playing
      • (Count structures controlled by (Owner of (Triggering unit)) (Exclude incomplete structures)) Equal to 0
      • ((Triggering player) is in Player Group - Neutral Hostile) Equal to False
    • Actions
      • Game - Display to (All players) the text: ((Name of (Triggering player)) + has been defeated.)
      • Game - Defeat (Owner of (Triggering unit)) with the message: Defeat!
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player Group - Remove (Triggering player) from (All enemies of (Picked player))
          • Player Group - Remove (Triggering player) from (All allies of (Picked player))
          • Player Group - Remove (Triggering player) from (All players)
          • Game - Display to (All players) the text: (String((Number of players in (All allies of (Picked player)))))
          • Game - Display to (All players) the text: (String((Number of players in (All enemies of (Picked player)))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering player) controller) Equal to Computer
              • (Number of players in (All enemies of (Picked player))) Equal to 0
            • Then - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
              • (Number of players in (All enemies of (Picked player))) Equal to 0
            • Then - Actions
              • Game - Victory (Picked player) (Show dialogs, Show scores)
            • Else - Actions
The problem seems to be that the Player Group - Remove doesn't work.
 
Last edited:

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Strangely enough Triggering player works for all of them. However it might not work for the player group remove... I shall try that as well. Thanks.

EDIT: Tried replacing all Triggering Player to Owner of (triggering unit) and still the same thing.
 

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Yup, double, triple checked. I'll put it in a separate map for you if you like.
 

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Here is a quick map I threw together with 4 player starts.

EDIT: I replaced it with an easier one to test with, which is why I removed the first. Just made a DH on start with 2k damage so it's faster to destroy buildings. ;P
 

Attachments

  • Test.w3x
    17.8 KB · Views: 64

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Wow, exactly what I was looking for. I should have thought about just making a custom player group instead of trying to change the existing one. ^^ +rep for sure.
 
Last edited:

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
The variable being the allenemies player group I assume? So like:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked player) slot status) Equal to Is playing
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 (Red) is an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player Group - Add (Picked player) to allenemies[0]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 2 (Blue) is an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player Group - Add (Picked player) to allenemies[1]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 3 (Teal) is an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player Group - Add (Picked player) to allenemies[2]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 4 (Purple) is an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player Group - Add (Picked player) to allenemies[3]
            • Else - Actions
        • Else - Actions
EDIT: I am kind of unsure what you mean or how to implement an array for the code you provided. Probably have to add some things in to check if all the teams are defeated, somehow. Could you help out on that part? I am unsure how to do this with the code you added.
 
Last edited:

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Yeah that is basically what mine is. What I mean is, how would I go about checking allenemy arrays 1-4 and making sure all arrays but the one I am checking are 0? So like on death it would see if it is array 1, then check 2,3,4 and see if all are set to 0. Then I would have to do the same for 2, check if 1,3,4 are and so. I guess I could do that with some lengthy if commands.

EDIT: And how would I go about removing the correct ones from each individual allenemy array? I think that one would have to be rewritten for teams unfortunately. I am lost.

EDIT2: Yeah I did get as far as the above, but basically what happened is, if I killed 1 player and there were 2 on that team, it would still Victory me. Think of it this way 3 teams: Allenemy[1] (Team one) defeats Allenemy[2] (Team 2) and Allenemy[3] (team 3) is just sitting there.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Number of players in allenemies[2]) Less than or equal to 0
  • Then - Actions
  • Game - Victory killingPlayer (Show dialogs, Show scores)
  • Else - Actions
Tells it to victory, even if there is a team 3. See what I mean?
 

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Yeah. Here you go. Make 2 computers on separate teams and you'll see what I mean.

EDIT: It's a melee kind of map. I am unable to use the standard Victory Conditions due to 'revealing' because of no town hall or what have you so I have to make custom ones that basically do the same job as it. Definitely a bigger PITA than I thought it was going to be.
 

Attachments

  • Test.w3x
    18.2 KB · Views: 35

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
There can be teams involved and/or free for all, so yes. Free for all is basically teams, but individual teams. So yes. Teams.

EDIT: Below, wouldn't that mean that the team I am on as well has 0? I am unsure. I think it might work... I have to figure out where to add the rest of the "Player Group - Remove deadPlayer from allenemies[0]"'s (0-4)

EDIT2: I feared as much, could you give me an example of 1?

EDIT3: Where exactly does that go? Actually I think the main problem is just the Player Group - Remove deadPlayer from allenemies[0] Part.
 
Last edited:

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
What about just using? :D I am close to giving up on this, it's starting to get more complicated and more annoying. ;P If anyone else can help, let me know. This is what I have so far:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked player) slot status) Equal to Is playing
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 (Red) is an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player Group - Add (Picked player) to allenemies[1]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 2 (Blue) is an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player Group - Add (Picked player) to allenemies[2]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 3 (Teal) is an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player Group - Add (Picked player) to allenemies[3]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 4 (Purple) is an enemy of (Picked player)) Equal to True
            • Then - Actions
              • Player Group - Add (Picked player) to allenemies[4]
            • Else - Actions
        • Else - Actions
  • Victory Conditions
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Equal to True
    • Actions
      • Set deadPlayer = (Owner of (Dying unit))
      • Set killingPlayer = (Owner of (Killing unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Count structures controlled by deadPlayer (Exclude incomplete structures)) Equal to 0
          • (deadPlayer is in Player Group - Neutral Hostile) Equal to False
          • (deadPlayer is in Player Group - Neutral Passive) Equal to False
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of deadPlayer) + has been defeated.)
          • Game - Defeat deadPlayer with the message: Defeat!
          • Player Group - Remove deadPlayer from allenemies[(Player number of killingPlayer)]
          • Player Group - Remove deadPlayer from (All players)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Number of players in allenemies[1]) Less than or equal to 0
                  • (Number of players in allenemies[2]) Less than or equal to 0
                  • (Number of players in allenemies[3]) Less than or equal to 0
                  • (Number of players in allenemies[4]) Less than or equal to 0
            • Then - Actions
              • Game - Victory killingPlayer (Show dialogs, Show scores)
            • Else - Actions
          • Player Group - Remove deadPlayer from (All allies of deadPlayer)
        • Else - Actions
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
First of all, you do notice you made this condition "((Dying unit) is A structure) Equal to True" ?

Now I was too lazy to read all the thread, what do you want your trigger to do exacly ?

[Edit] hmm, I think you wanted something like this?

  • Untitled Trigger 14,867.35
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Number of units in (Units owned by (Owner of (Triggering unit)))) Equal to 0
    • Actions
      • Game - Defeat (Owner of (Triggering unit)) with the message: Defeat!
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True))) Equal to 0
        • Then - Actions
          • Game - Victory (Owner of (Killing unit)) (Show dialogs, Show scores)
        • Else - Actions
 

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Nah. I basically wanted to make a victory trigger that is like the Melee one where 0 buildings = Defeat. That is why it activates on dying structure. The problem occurs when you start to have multiple players/teams I believe.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
In that case, my trigger would work exacly how it should, just change it to this two conditions

  • 287.36
    • (Number of units in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A structure) Equal to True))) Equal to 0
  • 287.37
    • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True)))) Equal to 0
 

vhx

vhx

Level 3
Joined
Jan 15, 2008
Messages
36
Unfortunately it didn't work.

EDIT: So I was experimenting and just put:
  • Set BuildCount = (Number of units in (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True))))
  • Game - Display to (All players) the text: (String(BuildCount))
And the output was 1. Even though this is AFTER I destroy the building. I have no idea what is going on. Why does this still output 1 when there are 0 buildings?

EDIT2: I have also tried multiple buildings. Even if those buildings are destroyed, the number is still the same. Why does this function still detect destroyed buildings? It's suppose to detect structures on the map...
 
Status
Not open for further replies.
Top