• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Move units if all 4 heroes are in region

Status
Not open for further replies.
Level 1
Joined
Aug 14, 2022
Messages
2
Hey, sorry if that thread already is. I spent so many time to find and do my simple action.

I need action that will be occured when heroes owned by Player1, Player2, Player 3 and Player 4 will be in specific region in that same time.

So: All 4 heroes enters a region 1 and then they will be move to region 2 and only when all 4 are in. Additionally units of players will be teleported to region 2 without their presence in region 1. And when units of player will be in region 1 that they will not trigger this action.

Sorry for my bad english :)
This is one of my many attempts. And it teleports all 4 heroes even when for example Player 2 hero aren't in region 1 but unit (not hero) is in region 1. (Even if I can change Unit-type to Hero instead of Triggering unit, I don't know if it will help me. Additionally i don't know how to do this).
Please help me, I really need this for my map :)
btw. in my map, Player 3 is Player 6 and Player 4 is Player 7. You can use Player 3 and Player 4 :)
Action.PNG
 

Uncle

Warcraft Moderator
Level 58
Joined
Aug 10, 2018
Messages
5,841
Use an Integer variable to track how many Heroes have entered the Region:
  • Events
    • Unit - A unit enters Drzwi Lich Boss <gen>
  • Conditions
    • (Triggering unit) is A Hero) Equal to True
  • Actions
    • Set Variable EnterCounter = EnterCounter + 1
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • EnterCounter Equal to 4
      • Then - Actions
        • // move the units
      • Else - Actions
If a Hero leaves the Region then subtract 1 from the Integer:
  • Events
    • Unit - A unit leaves Drzwi Lich boss <gen>
  • Conditions
    • (Triggering unit) is A Hero) Equal to True
  • Actions
    • Set Variable EnterCounter = EnterCounter - 1

Note that you're leaking a lot of Unit Groups / Points. This won't prevent your trigger from working but it's something worth looking into if you're concerned about game performance.

Also, unless it was recently fixed, Regions have an issue where their collision size is slightly off which causes Region related Events and Conditions to sometimes fail. Fortunately, there's a fix for this which you can find in the attached map. You simply copy and paste the Region Fix folder from the Trigger Editor into your map and then follow the instructions in the Fix Regions trigger.
 

Attachments

  • Fix Regions.w3m
    16.7 KB · Views: 8
Last edited:
Level 1
Joined
Aug 14, 2022
Messages
2
Hey, I very very very thx you for your help! :) It works! =) I didn't know it was that simple! :D I also used your fix regions :) I wish you a very good day c: I'm glad there are people like you who help :)
 
Status
Not open for further replies.
Top