• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 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 72
Joined
Aug 10, 2018
Messages
7,800
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: 13
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