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

[General] Portal moving ability

Status
Not open for further replies.
So I have a unit with an ability that is triggered. It moves one of the two portals on the location of ability being cast. The portals are units that have gateway ability. On start, the portals are on default location with their regions. But when I use the ability, the portal changes location, but when you click on it to use it the unit starts for the old location of the portal and teleports from there. My question is how to fix this?
  • portals
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arcane Gateway (Time Warper)(R)
    • Actions
      • Set Portal_Loc = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Portal Equal to False
        • Then - Actions
          • Unit - Move Portals[2] instantly to Portal_Loc
          • Region - Center Portal 1 <gen> on Portal_Loc
          • Set Portal = True
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Portal Equal to True
        • Then - Actions
          • Unit - Move Portals[1] instantly to Portal_Loc
          • Region - Center Portal 2 <gen> on Portal_Loc
          • Set Portal = False
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Portal_Loc)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The region events are registered when the map initializes. If you move a region, the event still has the old parameter as the event, not the new ones.

What kind of a conflict do you mean? Do you mean teleporting back and forth as the first move action then trigger another trigger and so on? You might want to put teleported units into a unit group for a second or two before being able to teleport again.
 
Yes it does. So, since it has conflict I made timer. But with 'unit comes in range' the old location remains again. So, I decided to make an ability on the portal that when you click it to teleport units in range to the other portal. However the unit is neutral passive, so I need to know a way to make that ability being able to be clicked by any player!

edit: NVM, I used select unit :)
 
Ok, I tried this trigger. The units are changing location, maybe the points too, but the wwaygate thing still not working. They remain the old ones. I'm confused with this one.
  • portals
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arcane Gateway (Time Warper)(R)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Portal1 Equal to True
        • Then - Actions
          • Custom script: call RemoveLocation(udg_Portals_Loc[1])
          • Set Portals_Loc[1] = (Target point of ability being cast)
          • Unit - Move Portals[1] instantly to Portals_Loc[1]
          • Neutral Building - Set Portals[1] destination to Portals_Loc[2]
          • Set Portal1 = False
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Portal1 Equal to False
        • Then - Actions
          • Custom script: call RemoveLocation(udg_Portals_Loc[2])
          • Set Portals_Loc[2] = (Target point of ability being cast)
          • Unit - Move Portals[2] instantly to Portals_Loc[2]
          • Neutral Building - Set Portals[2] destination to Portals_Loc[1]
          • Set Portal1 = True
        • Else - Actions
 
Level 10
Joined
Jun 6, 2007
Messages
392
Hmm.. are the points initialized correctly? Try to remove target regions from waygate properties, and do following in the initialization trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Portals[1] = u1
      • Set Portals[2] = u2
      • Set Portals_Loc[1] = Position of (Portals[1])
      • Set Portals_Loc[2] = Position of (Portals[2])
      • Neutral Building - Set Portals[1] destination to Portals_Loc[2]
      • Neutral Building - Set Portals[2] destination to Portals_Loc[1]
u1 and u2 are the preplaced portals.
 
I disabled "waygate active" from waygates. And saw some variable mistakes. But anyway, they don't even work now. Then again put waygate active, but not a change. Still goes to old location.
  • Set Portals[2] = Arcane Gateway (Time Warper)(2) 0606 <gen>
  • Set Portals[1] = Arcane Gateway (Time Warper)(1) 0012 <gen>
  • Set Portals_Loc[1] = (Position of Arcane Gateway (Time Warper)(2) 0606 <gen>)
  • Set Portals_Loc[2] = (Position of Arcane Gateway (Time Warper)(1) 0012 <gen>)
  • Neutral Building - Set Portals[1] destination to Portals_Loc[2]
  • Neutral Building - Set Portals[2] destination to Portals_Loc[1]
I think these triggers for neutral building are not working...
 
Level 12
Joined
May 22, 2015
Messages
1,051
Regions can't be Moved. I really don't know why, but for me it never does. Anyway, Why use Waygates when you can Use Triggers? Unless AI...
Regions CAN be moved. I have done it many times lol. I'm pretty sure it says in the editor that you have to assign the region to a variable first. Though it is just a small bit of text when you choose the "move region" function.

EDIT:
Basically, set up a trigger like this:
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set region1 = Region 1 <gen>
    • Set region2 = Region 2 <gen>
    • ...
And then use the region1 or region2 variable for when you want to use Region 1 <gen> and Region 2 <gen> (respectively) in other triggers.
 
You think that by putting regions in variable will work? No... I tried - regions can't be moved. There is a trigger that says it moves it, but it actually doesn't.

Edit: I made it working with triggers and a no-target ability on the portal. This thing with the regions and waygate ability is freaking me out. However, with the triggers you create two special effect from which I only need the birth animation. Since you would say there would be leak, how do I destroy the effects after their birth animation?
 
Level 12
Joined
May 22, 2015
Messages
1,051
You think that by putting regions in variable will work? No... I tried - regions can't be moved. There is a trigger that says it moves it, but it actually doesn't.

Things in my map literally wouldn't work if I couldn't move regions. Did you try it with a variable? If not, then you likely did not do it properly. I will post screen shots later when I have access to the editor. It would be bad if everyone tells everyone that you can't move them when you actually can.
 
Status
Not open for further replies.
Top