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

Kill Specific Unit to get reinforcements. (not working, need help)

Status
Not open for further replies.
Level 1
Joined
Dec 4, 2016
Messages
2
This is fixed, so if you came to help none needed, otherwise feel free to look around. Thanks again -Davidc94.

So I have two teams that are fighting each other and a third team that does nothing till a player kills a specific unit and then steps into a circle of power which results in the third team uniting with the team of the player that enters this. Additionally this spawns units to help that team. These two things are what i'm having trouble with.

I have included a picture of a visual aid of what the field would look like of said unit and power circle (Visual_Aid.png).
here is the Bandit Prodder Death trigger:
  • Bandit Prodder Dead
    • Events
      • Unit - Bandit Prodder (Bandit) 0203 <gen> Dies
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Someone has killed ...
      • Trigger - Turn on Ownership Swap <gen>
Here is the Ownership Swap trigger:
  • Ownership Swap
    • Events
      • Unit - A unit enters Ownership Swap <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to ((Triggering player) is an ally of Player 10 (Light Blue))
          • Unit_Creation_vs_Raider Equal to 0
          • Unit_Creation_vs_Tyrant Equal to 0
        • Then - Actions
          • Set Unit_Creation_vs_Raider = 1
          • Trigger - Turn on Unit Creation vs Raider <gen>
          • Player - Make Player 9 (Gray) treat Player 10 (Light Blue) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 5 (Yellow) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 6 (Orange) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 7 (Green) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 8 (Pink) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 11 (Dark Green) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 1 (Red) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 2 (Blue) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 3 (Teal) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 4 (Purple) as an Enemy
          • Unit - Create 1 Bandit Prodder (Bandit) for Player 9 (Gray) at (Center of Bandit Prodder Spawn <gen>) facing 0.00 degrees
          • Game - Display to (All players) the text: Bandit's are now he...
          • Trigger - Turn off Ownership Swap <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to ((Triggering player) is an ally of Player 11 (Dark Green))
          • Unit_Creation_vs_Raider Equal to 0
          • Unit_Creation_vs_Tyrant Equal to 0
        • Then - Actions
          • Set Unit_Creation_vs_Tyrant = 1
          • Trigger - Turn on Unit Creation vs Tyrant <gen>
          • Player - Make Player 9 (Gray) treat Player 11 (Dark Green) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 1 (Red) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 2 (Blue) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 3 (Teal) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 4 (Purple) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 10 (Light Blue) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 5 (Yellow) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 6 (Orange) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 7 (Green) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 8 (Pink) as an Enemy
          • Unit - Create 1 Bandit Prodder (Bandit) for Player 9 (Gray) at (Center of Bandit Prodder Spawn <gen>) facing 0.00 degrees
          • Game - Display to (All players) the text: Bandit's are now he...
          • Trigger - Turn off Ownership Swap <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to ((Triggering player) is an ally of Player 11 (Dark Green))
          • Unit_Creation_vs_Raider Equal to 1
          • Unit_Creation_vs_Tyrant Equal to 0
        • Then - Actions
          • Set Unit_Creation_vs_Tyrant = 1
          • Set Unit_Creation_vs_Raider = 0
          • Trigger - Turn on Unit Creation vs Tyrant <gen>
          • Trigger - Turn off Unit Creation vs Raider <gen>
          • Player - Make Player 9 (Gray) treat Player 11 (Dark Green) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 1 (Red) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 2 (Blue) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 3 (Teal) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 4 (Purple) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 10 (Light Blue) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 5 (Yellow) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 6 (Orange) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 7 (Green) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 8 (Pink) as an Enemy
          • Unit - Create 1 Bandit Prodder (Bandit) for Player 9 (Gray) at (Center of Bandit Prodder Spawn <gen>) facing 0.00 degrees
          • Game - Display to (All players) the text: Bandit's are now he...
          • Trigger - Turn off Ownership Swap <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to ((Triggering player) is an ally of Player 10 (Light Blue))
          • Unit_Creation_vs_Raider Equal to 0
          • Unit_Creation_vs_Tyrant Equal to 1
        • Then - Actions
          • Set Unit_Creation_vs_Raider = 1
          • Set Unit_Creation_vs_Tyrant = 0
          • Trigger - Turn on Unit Creation vs Raider <gen>
          • Trigger - Turn off Unit Creation vs Tyrant <gen>
          • Player - Make Player 9 (Gray) treat Player 10 (Light Blue) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 5 (Yellow) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 6 (Orange) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 7 (Green) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 8 (Pink) as an Ally with shared vision
          • Player - Make Player 9 (Gray) treat Player 11 (Dark Green) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 1 (Red) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 2 (Blue) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 3 (Teal) as an Enemy
          • Player - Make Player 9 (Gray) treat Player 4 (Purple) as an Enemy
          • Unit - Create 1 Bandit Prodder (Bandit) for Player 9 (Gray) at (Center of Bandit Prodder Spawn <gen>) facing 0.00 degrees
          • Game - Display to (All players) the text: Bandit's are now he...
          • Trigger - Turn off Ownership Swap <gen>
        • Else - Actions
So there are 4 triggers that matter to make this happen, Unit Creation vs Tyrant (initially off), Unit Creation vs Raider (initially off), Ownership Swap (initially off), and Bandit Prodder Dead (always on). The unit creations don't matter till the Ownership Swap trigger is turned on.

What i am trying to get happen is a player kills the creature from the screen shot(Visual_Aid.png) making Ownership Swap trigger turn on, then walks to the circle of power. This makes one of the unit creation triggers turn on, allying the 3rd team to whatever team the player who killed the specific unit is on, creates another of the specific unit and then turns off the Ownership Swap trigger. There is of coarse 4 different if/then/else "functions" which handle if the third team is hostile vs everyone, or if he is hostile with a particular team and switches teams dependent on those circumstances and the player that kills him and who he's allied with.

Somewhere along this line, something messes up. It won't ally period, even on the first kill (supposed to be hostile to everyone, and if killed again, switches teams assuming that player is an enemy), and then create units. I am fairly new to triggers and i'm wondering if someone can help me out with the triggers, i did look up info to try and get these to work in case anyone is wondering but got squat.

Many Thanks -Davidc94.

UPDATE: Here is the working version in case anyone is interested.

Bandit Prodder Dead trigger:
  • Bandit Prodder Dead
    • Events
      • Unit - Bandit Prodder (Bandit) 0203 <gen> Dies
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Someone has killed ...
      • Trigger - Turn on Ownership Swap <gen>
Ownership Swap trigger (only really need to look at first if/then/else statement; as others just swap out info. Just so you don't have to keep scrolling):
  • Ownership Swap
    • Events
      • Unit - A unit enters Ownership Swap <gen>
    • 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
          • ((Triggering unit) belongs to an ally of Player 10 (Light Blue)) Equal to True
          • BuC_for_Raider Equal to 0
          • BuC_for_Tyrant Equal to 0
        • Then - Actions
          • Set BuC_for_Raider = 1
          • Player Group - Make Player Group - Player 9 (Gray) treat (All allies of Player 10 (Light Blue)) as an Ally with shared vision
          • Player Group - Make (All allies of Player 10 (Light Blue)) treat Player Group - Player 9 (Gray) as an Ally with shared vision
          • Trigger - Turn on BuC for Raider <gen>
          • Unit - Create 1 Bandit Prodder (Bandit) for Player 9 (Gray) at (Center of Bandit Prodder Spawn <gen>) facing 0.00 degrees
          • Game - Display to (All players) the text: Bandit's are now he...
          • Trigger - Turn off Ownership Swap <gen>
          • Unit Group - Remove all units from (Units in Bandit Defense 1 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 2 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 3 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 4 <gen> owned by Player 9 (Gray))
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 1 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 2 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 3 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 4 <gen>) facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
          • BuC_for_Raider Equal to 0
          • BuC_for_Tyrant Equal to 0
        • Then - Actions
          • Set BuC_for_Tyrant = 1
          • Player Group - Make Player Group - Player 9 (Gray) treat (All allies of Player 11 (Dark Green)) as an Ally with shared vision
          • Player Group - Make (All allies of Player 11 (Dark Green)) treat Player Group - Player 9 (Gray) as an Ally with shared vision
          • Trigger - Turn on BuC for Tyrant <gen>
          • Unit - Create 1 Bandit Prodder (Bandit) for Player 9 (Gray) at (Center of Bandit Prodder Spawn <gen>) facing 0.00 degrees
          • Game - Display to (All players) the text: Bandit's are now he...
          • Trigger - Turn off Ownership Swap <gen>
          • Unit Group - Remove all units from (Units in Bandit Defense 1 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 2 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 3 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 4 <gen> owned by Player 9 (Gray))
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 1 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 2 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 3 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 4 <gen>) facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 10 (Light Blue)) Equal to True
          • BuC_for_Raider Equal to 0
          • BuC_for_Tyrant Equal to 1
        • Then - Actions
          • Set BuC_for_Raider = 1
          • Set BuC_for_Tyrant = 0
          • Player Group - Make Player Group - Player 9 (Gray) treat (All allies of Player 10 (Light Blue)) as an Ally with shared vision
          • Player Group - Make (All allies of Player 10 (Light Blue)) treat Player Group - Player 9 (Gray) as an Ally with shared vision
          • Player Group - Make Player Group - Player 9 (Gray) treat (All allies of Player 11 (Dark Green)) as an Enemy
          • Player Group - Make (All allies of Player 11 (Dark Green)) treat Player Group - Player 9 (Gray) as an Enemy
          • Trigger - Turn off BuC for Tyrant <gen>
          • Trigger - Turn on BuC for Raider <gen>
          • Unit - Create 1 Bandit Prodder (Bandit) for Player 9 (Gray) at (Center of Bandit Prodder Spawn <gen>) facing 0.00 degrees
          • Game - Display to (All players) the text: Bandit's are now he...
          • Trigger - Turn off Ownership Swap <gen>
          • Unit Group - Remove all units from (Units in Bandit Defense 1 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 2 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 3 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 4 <gen> owned by Player 9 (Gray))
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 1 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 2 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 3 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 4 <gen>) facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
          • BuC_for_Raider Equal to 1
          • BuC_for_Tyrant Equal to 0
        • Then - Actions
          • Set BuC_for_Tyrant = 1
          • Set BuC_for_Raider = 0
          • Player Group - Make Player Group - Player 9 (Gray) treat (All allies of Player 11 (Dark Green)) as an Ally with shared vision
          • Player Group - Make (All allies of Player 11 (Dark Green)) treat Player Group - Player 9 (Gray) as an Ally with shared vision
          • Player Group - Make Player Group - Player 9 (Gray) treat (All allies of Player 10 (Light Blue)) as an Enemy
          • Player Group - Make (All allies of Player 10 (Light Blue)) treat Player Group - Player 9 (Gray) as an Enemy
          • Trigger - Turn off BuC for Raider <gen>
          • Trigger - Turn on BuC for Tyrant <gen>
          • Unit - Create 1 Bandit Prodder (Bandit) for Player 9 (Gray) at (Center of Bandit Prodder Spawn <gen>) facing 0.00 degrees
          • Game - Display to (All players) the text: Bandit's are now he...
          • Trigger - Turn off Ownership Swap <gen>
          • Unit Group - Remove all units from (Units in Bandit Defense 1 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 2 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 3 <gen> owned by Player 9 (Gray))
          • Unit Group - Remove all units from (Units in Bandit Defense 4 <gen> owned by Player 9 (Gray))
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 1 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 2 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 3 <gen>) facing Default building facing degrees
          • Unit - Create 4 Bandit Guard Tower for Player 9 (Gray) at (Center of Bandit Defense 4 <gen>) facing Default building facing degrees
        • Else - Actions
 

Attachments

  • Visual_Aid.PNG
    Visual_Aid.PNG
    2.9 MB · Views: 55
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
4,992
Next time you post, right click your triggers in the Trigger Editor and select "copy as text" then paste them here between [trigger][/trigger] tags so it looks pretty!

I believe the problem is that "Triggering Player" doesn't exist in when Ownership Swap is triggered. A unit enters the region and causes the event to happen, not a player doing something. To fix this I would move the hero check to the main trigger conditions and rewrite your player checks to use "Owner of (Triggering unit)" instead:

  • Events
    • Unit - A unit enters Ownership Swap <gen>
  • 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 10 (light blue)) equal to true
        • Unit_Creation_vs_Raider equal to 0
        • Unit_Creation_vs_Tyrant equal to 0
      • Then - Actions
        • -------- Whatever you gotta do --------
      • Else - Actions
If you post your whole trigger there might be a way to shorten/simplify/change it to be more succinct.
 
Status
Not open for further replies.
Top