1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Prevent air units from using waygate?

Discussion in 'World Editor Help Zone' started by severed, Oct 18, 2020.

  1. severed

    severed

    Joined:
    Oct 25, 2010
    Messages:
    198
    Resources:
    0
    Resources:
    0
    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: Oct 18, 2020
  2. loktar

    loktar

    Model Reviewer

    Joined:
    Nov 2, 2004
    Messages:
    1,473
    Resources:
    47
    Models:
    20
    Icons:
    20
    Packs:
    1
    Tools:
    3
    Spells:
    2
    Tutorials:
    1
    Resources:
    47
    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.
     
  3. severed

    severed

    Joined:
    Oct 25, 2010
    Messages:
    198
    Resources:
    0
    Resources:
    0
    Im a big newbie at triggers, but a friend of mine helped me set these up:

    [​IMG]

    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)
     
  4. [db]east

    [db]east

    Joined:
    Feb 27, 2019
    Messages:
    128
    Resources:
    0
    Resources:
    0
    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: Oct 18, 2020
  5. severed

    severed

    Joined:
    Oct 25, 2010
    Messages:
    198
    Resources:
    0
    Resources:
    0
    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?
     
  6. [db]east

    [db]east

    Joined:
    Feb 27, 2019
    Messages:
    128
    Resources:
    0
    Resources:
    0
    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)
     
  7. loktar

    loktar

    Model Reviewer

    Joined:
    Nov 2, 2004
    Messages:
    1,473
    Resources:
    47
    Models:
    20
    Icons:
    20
    Packs:
    1
    Tools:
    3
    Spells:
    2
    Tutorials:
    1
    Resources:
    47
    ^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.
     
  8. severed

    severed

    Joined:
    Oct 25, 2010
    Messages:
    198
    Resources:
    0
    Resources:
    0
    awesome :) thanks so much guys! I will try and look into this a bit more later tonight