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

Prevent air units from using waygate?

Status
Not open for further replies.
Level 6
Joined
Oct 25, 2010
Messages
203
I first tried creating 2 regions and setting some triggers to move units, but that didnt seem to do anything

It seems like the only way to teleport units from 1 region to another is by using the waygate ability?

I was trying to get caves setup to work in place of waygates, so I placed a circle of power in the caves and gave the circle of power the waygate ability, and it works fine

but the only way to prevent air from entering is if I use pathing blockers, and I cant really fit them all inside the cave along with the circle of power, cause I have doodads all around the area making it kinda difficult to rely on pathing blockers lol

I even tried shrinking the circle of power, but that made it harder for units to access the right spot

Thanks!
 
Last edited:
I first tried creating 2 regions and setting some triggers to move units, but that didnt seem to do anything
This is certainly possible. You might have done something wrong there, you can definitely move units with triggers, and you can check their unit classification to see if they're flying units.
 
Level 6
Joined
Oct 25, 2010
Messages
203
Im a big newbie at triggers, but a friend of mine helped me set these up:

unknown.png


I originally didnt use the "temppoint" or customscripts, my friend added that but idk what Im doing wrong that it wont work... it only works for me by using a building with the waygate ability (which ignores the trigger either way)
 
Level 19
Joined
Feb 27, 2019
Messages
590
Im a big newbie at triggers, but a friend of mine helped me set these up:

unknown.png


I originally didnt use the "temppoint" or customscripts, my friend added that but idk what Im doing wrong that it wont work... it only works for me by using a building with the waygate ability (which ignores the trigger either way)
Change Unit - Move (Triggering unit) instantly to TempPoint to Unit - Move (Triggering unit) instantly to RegionPoint and see if that helps
Because TempPoint is not set anywhere it may send your units to the center of the map or not do anything at all. RegionPoint gets set though so using that should work if center of region CaveBL1 is where you want to send them.

Setting the point then removing it with the custom script is to remove point leaks. Too many leaks can cause the game to lag. A leak is created because the point is stored in the memory and if not removed this way it will be kept in the games memeory through the entire game. Dont ask me why.

You can read more about leaks here Things That Leak
 
Last edited:
Level 6
Joined
Oct 25, 2010
Messages
203
perfect, that was so easy I wonder if my friend had just misclicked cuz he usually knows his stuff lol :p

but now Im having a big problem! its looping and then crashing because i want the region to work both ways, like the unit can go in one side and come out the other and then they should also be able to return through the same portal from where they came

how do I prevent it from looping when they are first teleported to the new region?
 
Level 19
Joined
Feb 27, 2019
Messages
590
I thought that could happen. Try to turn off the other trigger then turn it on after you have moved the unit. Make sure to do it for both triggers.

It should look something like this:
  • CaveTL1
    • Events
      • Unit - A unit enters CaveTL1 <gen>
    • Conditions
      • ((Triggering unit) is A ground unit) Equal to True
    • Actions
      • Set VariableSet RegionPoint = (Center of CaveBL1 <gen>)
      • Trigger - Turn off CaveBL1 <gen>
      • Unit - Move (Triggering unit) instantly to RegionPoint
      • Trigger - Turn on CaveBL1 <gen>
      • Custom script: call RemoveLocation(udg_RegionPoint)
 
perfect, that was so easy I wonder if my friend had just misclicked cuz he usually knows his stuff lol :p

but now Im having a big problem! its looping and then crashing because i want the region to work both ways, like the unit can go in one side and come out the other and then they should also be able to return through the same portal from where they came

how do I prevent it from looping when they are first teleported to the new region?
^Alternatively, create a unit group for each region which contains units that should not be moved by that region.
Add a condition for each region checking that the unit is not in its respective unit group.
Before moving a unit, add it to the unit group of the target region. Remove units from the unit group when they leave that region.
 
Status
Not open for further replies.
Top