• 🏆 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] Conquest Trigger

Status
Not open for further replies.
Level 19
Joined
Sep 4, 2007
Messages
2,826
I've asked about this before but I didn't get any real help so I'll try again.
Basically the trigger is meant to turn the attacked player into the attacking's team. The problem is that when the team grows they won't get allied with each other but only the one who actually turned them into the team.
Could someone please help me fix it?
  • Conqure Player
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Attacked unit) is A town-hall-type unit) Equal to True
          • (Life of (Attacked unit)) Less than or equal to ConqureHitpoint
    • Actions
      • -------- Fixing Town Hall --------
      • Set Player = (Owner of (Attacked unit))
      • Game - Display to (All players) the text: ((MultiboardColor[(Player number of (Owner of (Attacking unit)))] + (Name of (Owner of (Attacking unit)))) + ( |cffffcc99has conqured + (MultiboardColor[(Player number of Player)] + (Name of Player))))
      • Unit - Set life of (Attacked unit) to 10000.00
      • -------- Unally current team --------
      • Set TempPlayerGroup = (All allies of Player)
      • Player Group - Pick every player in TempPlayerGroup and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat Player as an Enemy
          • Player - Make Player treat (Picked player) as an Enemy
          • Player - Make Player 12 (Brown) treat Player as an Ally with shared vision
      • Custom script: call DestroyForce(udg_TempPlayerGroup)
      • -------- Ally with conquering team --------
      • Set TempPlayerGroup = (All allies of (Owner of (Attacking unit)))
      • Player Group - Pick every player in TempPlayerGroup and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat Player as an Ally with shared vision
          • Player - Make Player treat (Picked player) as an Ally with shared vision
          • Player - Change color of Player to (Color of (Owner of (Attacking unit))), Changing color of existing units
      • Custom script: call DestroyForce(udg_TempPlayerGroup)
 
Level 4
Joined
Jun 8, 2008
Messages
87
here it is. had to make some changes, because i made some bugs :)
  • Team Switch
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Life of (Attacked unit)) Less than or equal to You_decide_this
          • ((Attacked unit) is A town-hall-type unit) Equal to True
    • Actions
      • Player Group - Pick every player in (All allies of (Owner of (Attacked unit))) and do (Player Group - Add (Picked player) to allies_of_attacked_unit)
      • Player Group - Pick every player in (All enemies of (Owner of (Attacked unit))) and do (Player Group - Add (Picked player) to enemies_of_attacked_unit)
      • Player Group - Pick every player in enemies_of_attacked_unit and do (Actions)
        • Loop - Actions
          • Player - For (Picked player), turn Alliance (non-aggression) On toward (Owner of (Attacked unit))
          • Player - For (Picked player), turn Shared vision On toward (Owner of (Attacked unit))
          • Player - For (Owner of (Attacked unit)), turn Alliance (non-aggression) On toward (Picked player)
          • Player - For (Owner of (Attacked unit)), turn Shared vision On toward (Picked player)
      • Player Group - Pick every player in allies_of_attacked_unit and do (Actions)
        • Loop - Actions
          • Player - For (Picked player), turn Shared vision Off toward (Owner of (Attacked unit))
          • Player - For (Picked player), turn Alliance (non-aggression) Off toward (Owner of (Attacked unit))
          • Player - For (Owner of (Attacked unit)), turn Shared vision Off toward (Picked player)
          • Player - For (Owner of (Attacked unit)), turn Alliance (non-aggression) Off toward (Picked player)
      • Unit - Set life of (Attacked unit) to 10000.00
      • Unit Group - Order (Units within 800.00 of (Position of (Attacked unit))) to Stop
oh and Huurka sorry, totaly forgot the thing hehe ^^
just edit the values that need to be edited. Tell me, did it work?
 
Last edited:
Level 19
Joined
Sep 4, 2007
Messages
2,826
I don't really get your triggers to work. I've also tried modifying them but still nothing.
Edit: Your triggers did the same thing as mine did so no change... :(
Edit2: Your trigger makes it only possible to capture 1 player. The problem is the same.
The problem is that when the team grows they won't get allied with each other but only the one who actually turned them into the team.
Could someone please help me fix it?
 
Level 4
Joined
Jun 8, 2008
Messages
87
it seemed to work for me just fine. I tried it in my map. worked exaktly as intended
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
It only works to capture 1 player but not any more than that. Though the ones you've captured won't be allied with each other only you.
You don't need to use Set Aspect Of Alliance. Instead us this:
  • Conqure Player
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Attacked unit) is A town-hall-type unit) Equal to True
          • (Life of (Attacked unit)) Less than or equal to ConqureHitpoint
    • Actions
      • Unit - Set life of (Attacked unit) to 99999.00
      • Player - Change color of (Owner of (Attacked unit)) to (Color of (Owner of (Attacking unit))), Changing color of existing units
      • Player Group - Pick every player in (All allies of (Owner of (Attacked unit))) and do (Actions)
        • Loop - Actions
          • Player Group - Add (Picked player) to allies_of_attacked_unit
      • Player Group - Pick every player in (All allies of (Owner of (Attacking unit))) and do (Actions)
        • Loop - Actions
          • Player Group - Add (Picked player) to enemies_of_attacked_unit
      • Player Group - Pick every player in allies_of_attacked_unit and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Attacked unit)) as an Enemy
          • Player - Make (Owner of (Attacked unit)) treat (Picked player) as an Enemy
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Attacked unit)) as an Ally with shared vision
          • Player - Make (Owner of (Attacked unit)) treat (Picked player) as an Ally with shared vision
The problem hasn't been solved yet.
 
Level 4
Joined
Jun 8, 2008
Messages
87
here it is, i tried it and it WORKED evrything worked all the issues you mentioned SURELY doesnt exist in this one :) (that a promise)
  • Team Switch
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Life of (Attacked unit)) Less than or equal to 150.00
          • ((Attacked unit) is A town-hall-type unit) Equal to True
    • Actions
      • Player Group - Pick every player in (All allies of (Owner of (Attacked unit))) and do (Player Group - Add (Picked player) to Allies_of_attacked_unit)
      • Player Group - Pick every player in (All enemies of (Owner of (Attacked unit))) and do (Player Group - Add (Picked player) to enemies_of_attacked_unit)
      • Player Group - Pick every player in enemies_of_attacked_unit and do (Actions)
        • Loop - Actions
          • Player - For (Picked player), turn Alliance (non-aggression) On toward (Owner of (Attacked unit))
          • Player - For (Picked player), turn Shared vision On toward (Owner of (Attacked unit))
          • Player - For (Owner of (Attacked unit)), turn Alliance (non-aggression) On toward (Picked player)
          • Player - For (Owner of (Attacked unit)), turn Shared vision On toward (Picked player)
      • Player Group - Pick every player in Allies_of_attacked_unit and do (Actions)
        • Loop - Actions
          • Player - For (Picked player), turn Shared vision Off toward (Owner of (Attacked unit))
          • Player - For (Picked player), turn Alliance (non-aggression) Off toward (Owner of (Attacked unit))
          • Player - For (Owner of (Attacked unit)), turn Shared vision Off toward (Picked player)
          • Player - For (Owner of (Attacked unit)), turn Alliance (non-aggression) Off toward (Picked player)
      • Unit - Set life of (Attacked unit) to 10000.00
      • Unit Group - Order (Units in (Playable map area)) to Stop
      • Player Group - Pick every player in enemies_of_attacked_unit and do (Player Group - Remove (Picked player) from enemies_of_attacked_unit)
      • Player Group - Pick every player in Allies_of_attacked_unit and do (Player Group - Remove (Picked player) from Allies_of_attacked_unit)
      • Player - Change color of (Owner of (Attacked unit)) to (Color of (Owner of (Attacking unit))), Changing color of existing units
here is a map that already got it inside, i tested it here and it worked ^^
 

Attachments

  • This_works.w3x
    244.1 KB · Views: 33
Level 19
Joined
Sep 4, 2007
Messages
2,826
It still doesn't work. Blue and teal still fight...
 

Attachments

  • -.-.jpg
    -.-.jpg
    49.4 KB · Views: 119
Level 4
Joined
Jun 8, 2008
Messages
87
oh and you remembered to change the variables to something else? because i got it to work perfectly in my test map. heres the replay
 

Attachments

  • im totaly sure about it!.w3g
    32.5 KB · Views: 57
Level 4
Joined
Jun 8, 2008
Messages
87
oh DAMN i just tested your map and saw that players start alone and then form teams... stupid me ill fix it right away
 
Level 4
Joined
Jun 8, 2008
Messages
87
Heyer proudly present: YOUR TRIGGER
  • Team Switch
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Life of (Attacked unit)) Less than or equal to 150.00
          • ((Attacked unit) is A town-hall-type unit) Equal to True
    • Actions
      • -------- Remember to change these variables: "Allies_of_attacked_unit" "enemies_of_attacked_unit" --------
      • Player Group - Add (Owner of (Attacking unit)) to enemies_of_attacked_unit
      • Player Group - Pick every player in (All allies of (Owner of (Attacking unit))) and do (Player Group - Add (Picked player) to enemies_of_attacked_unit)
      • Player Group - Pick every player in (All allies of (Owner of (Attacked unit))) and do (Player Group - Add (Picked player) to Allies_of_attacked_unit)
      • Player Group - Pick every player in enemies_of_attacked_unit and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Attacked unit)) as an Ally with shared vision
          • Player - Make (Owner of (Attacked unit)) treat (Picked player) as an Ally with shared vision
      • Player Group - Pick every player in Allies_of_attacked_unit and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Attacked unit)) as an Enemy
          • Player - Make (Owner of (Attacked unit)) treat (Picked player) as an Enemy
      • Unit - Set life of (Attacked unit) to (Max life of (Attacked unit))
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Order (Picked unit) to Stop)
      • Player - Change color of (Owner of (Attacked unit)) to (Color of (Owner of (Attacking unit))), Changing color of existing units
      • Player Group - Pick every player in Allies_of_attacked_unit and do (Player Group - Remove (Picked player) from Allies_of_attacked_unit)
      • Player Group - Pick every player in enemies_of_attacked_unit and do (Player Group - Remove (Picked player) from enemies_of_attacked_unit)
 
Last edited:
Level 4
Joined
Jun 8, 2008
Messages
87
IMPOSSIBLE, can you send me the map?

oh and you did remember to edit the variables right?
 
Level 4
Joined
Jun 8, 2008
Messages
87
hehe nice! ill get on it RIGHT away

oh and evry player starts alone right?

here i fixed it for you. you copy paste it into your map and remake the variables. by the way im gonna be busy for around 3 hours starting now. just remember to change the variables into the SAME thing ^^ oh and i removed the extra trigger you made. it isnt neccesary its already inside the "team switch" trigger"

nevermind that i can stay on for around 25 minutes more

tell me how it went ;)

i just tested the map... i think i know whots wrong (something about emptieng the variable) oh and i cant imagine how the heck that delay got in. i dont think i can work more on it for today. sadly but tomorow i got the whole day. see if you can find out whots causing that delay (its one of the bugs) and see if its the variable thats the problem. cya tomorow. ^^ i know it must be FUCKIGN ANOYING to have to wait... but i cant do anymore
 

Attachments

  • Emptinized.(works)..[1].w3x
    187.5 KB · Views: 44
Last edited by a moderator:
Level 4
Joined
Jun 8, 2008
Messages
87
HAHAHAHHA i found out the problem!!! there is NO problem ^^ it was just because at the test, teal started as a user, but in tests only blue turns into a computer. heres the proof (points at attachment). inside the game the trigger WILL work. to make it work in tests. just make teal start as an computer instead of user :) (already did that in this map) well this is the end! i hope the new version of your map will be good ;)
 

Attachments

  • Emptinized.(works)..[1].w3x
    187.6 KB · Views: 31
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
Is this so hard to make ?
  • Bla bla bla
    • Events
      • Whatever
    • Conditions
      • Whatever
    • Actions
      • Set Attacker = (Owner of (Attacking unit))
      • Set Attacked = (Owner of (Attacked unit))
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Current_Player = (Player((Integer A)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current_Player is an ally of Attacker) Equal to True
            • Then - Actions
              • Player - Make Attacked treat Current_Player as an Ally with shared vision
              • Player - Make Current_Player treat Attacked as an Ally with shared vision
            • Else - Actions
              • Player - Make Attacked treat Current_Player as an Enemy
              • Player - Make Current_Player treat Attacked as an Enemy
And using those 3 variables instead of getting all the time the attacker/attacked/corrent player is rather suggested for speed improvment.
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
Is this so hard to make ?
  • Bla bla bla
    • Events
      • Whatever
    • Conditions
      • Whatever
    • Actions
      • Set Attacker = (Owner of (Attacking unit))
      • Set Attacked = (Owner of (Attacked unit))
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Current_Player = (Player((Integer A)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current_Player is an ally of Attacker) Equal to True
            • Then - Actions
              • Player - Make Attacked treat Current_Player as an Ally with shared vision
              • Player - Make Current_Player treat Attacked as an Ally with shared vision
            • Else - Actions
              • Player - Make Attacked treat Current_Player as an Enemy
              • Player - Make Current_Player treat Attacked as an Enemy
And using those 3 variables instead of getting all the time the attacker/attacked/corrent player is rather suggested for speed improvment.
Omg... Why did I not think of that? Thanks wulfy! :thumbs_up:
 
Level 4
Joined
Jun 8, 2008
Messages
87
well problem solved! have a nice day evrybody (redmarine it would have worked in your map, but i suggests you use Ghostwulfs ;)

oh and wolf thanks ^^ i actualy learned something from that trigger you made
 
Level 4
Joined
Jun 8, 2008
Messages
87
np just say it in this thread if you get any further problems whit it ^^ *Heyer disappears in a dustcloud*
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
np just say it in this thread if you get any further problems whit it ^^ *Heyer disappears in a dustcloud*

Lol... I can't figure it out. This trigger fuses the attacked team with the attacker's.
  • Conqure Player
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Attacked unit) is A town-hall-type unit) Equal to True
          • (Life of (Attacked unit)) Less than or equal to 2000.00
    • Actions
      • Set Attacker = (Owner of (Attacking unit))
      • Set Attacked = (Owner of (Attacked unit))
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Current_Player = (Player((Integer A)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current_Player is an ally of Attacker) Equal to True
            • Then - Actions
              • Player - Make Attacked treat Current_Player as an Ally with shared vision
              • Player - Make Current_Player treat Attacked as an Ally with shared vision
              • Player - Change color of Attacked to (Color of Attacker), Changing color of existing units
            • Else - Actions
              • Player - Make Attacked treat Current_Player as an Enemy
              • Player - Make Current_Player treat Attacked as an Enemy
 
Level 4
Joined
Jun 8, 2008
Messages
87
well, i couldt figure out wolfs method (im quite new at arrays) so if you can find ANY other solution you can use this
  • Team Switch
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Life of (Attacked unit)) Less than or equal to 2000.00
          • ((Attacked unit) is A town-hall-type unit) Equal to True
    • Actions
      • Player Group - Add (Owner of (Attacking unit)) to enemies_and_allies_of_attacked[1]
      • Player Group - Pick every player in (All allies of (Owner of (Attacking unit))) and do (Player Group - Add (Picked player) to enemies_and_allies_of_attacked[1])
      • Player Group - Pick every player in (All allies of (Owner of (Attacked unit))) and do (Player Group - Add (Picked player) to enemies_and_allies_of_attacked[2])
      • Player Group - Pick every player in enemies_and_allies_of_attacked[1] and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Attacked unit)) as an Ally with shared vision
          • Player - Make (Owner of (Attacked unit)) treat (Picked player) as an Ally with shared vision
      • Player Group - Pick every player in enemies_and_allies_of_attacked[2] and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Attacked unit)) as an Enemy
          • Player - Make (Owner of (Attacked unit)) treat (Picked player) as an Enemy
      • Unit - Set life of (Attacked unit) to (Max life of (Attacked unit))
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Order (Picked unit) to Stop)
      • Player - Change color of (Owner of (Attacked unit)) to (Color of (Owner of (Attacking unit))), Changing color of existing units
      • Player Group - Pick every player in enemies_and_allies_of_attacked[1] and do (Player Group - Remove (Picked player) from enemies_and_allies_of_attacked[1])
      • Player Group - Pick every player in enemies_and_allies_of_attacked[2] and do (Player Group - Remove (Picked player) from enemies_and_allies_of_attacked[2])
only new thing i did is the array, i truly do apologize put this is as far, as my skills go at the moment :sad:
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
well, i couldt figure out wolfs method (im quite new at arrays) so if you can find ANY other solution you can use this
  • Team Switch
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Life of (Attacked unit)) Less than or equal to 2000.00
          • ((Attacked unit) is A town-hall-type unit) Equal to True
    • Actions
      • Player Group - Add (Owner of (Attacking unit)) to enemies_and_allies_of_attacked[1]
      • Player Group - Pick every player in (All allies of (Owner of (Attacking unit))) and do (Player Group - Add (Picked player) to enemies_and_allies_of_attacked[1])
      • Player Group - Pick every player in (All allies of (Owner of (Attacked unit))) and do (Player Group - Add (Picked player) to enemies_and_allies_of_attacked[2])
      • Player Group - Pick every player in enemies_and_allies_of_attacked[1] and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Attacked unit)) as an Ally with shared vision
          • Player - Make (Owner of (Attacked unit)) treat (Picked player) as an Ally with shared vision
      • Player Group - Pick every player in enemies_and_allies_of_attacked[2] and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Owner of (Attacked unit)) as an Enemy
          • Player - Make (Owner of (Attacked unit)) treat (Picked player) as an Enemy
      • Unit - Set life of (Attacked unit) to (Max life of (Attacked unit))
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Order (Picked unit) to Stop)
      • Player - Change color of (Owner of (Attacked unit)) to (Color of (Owner of (Attacking unit))), Changing color of existing units
      • Player Group - Pick every player in enemies_and_allies_of_attacked[1] and do (Player Group - Remove (Picked player) from enemies_and_allies_of_attacked[1])
      • Player Group - Pick every player in enemies_and_allies_of_attacked[2] and do (Player Group - Remove (Picked player) from enemies_and_allies_of_attacked[2])
only new thing i did is the array, i truly do apologize put this is as far, as my skills go at the moment :sad:
It's ok. You can look up some nice tutorials in the tutorial section.
That trigger is almost like the old one. Instead of 2 player group variables you've used 1 player group variable with 2 array(layer).
 
Level 4
Joined
Jun 8, 2008
Messages
87
thats how i learned about arrays :) well are you gonna use the trigger? or find something more optimized?
 
Status
Not open for further replies.
Top