# [Trigger]Moving way gate

#### Erkowich

Level 6
I need both ideas and possible solutions to a problem i encountered, which is that i want a flying ship to be able to land and then act as a waygate to the interior of the ship.

The layout of the whole thing is that i have a "dungeon" acting as the interior of the ship. The dungeon is just an enclosed area on the map where the only entrance is a waygate which is always stationary. The region under this waygate is also always stationary.

Then i have this airship that you can move, which also can land, turning it into a waygate so you can unload the units you have in the dungeon/interior of the ship. It's not hard to move the region to where the ship landed, but i am having problems making the waygates work.

Right now the ship have the storm crow ability to make it do a nice landing, and the alternate form of the ship, which is the landed ship, have the waygate ability. But the problem is, i can't seem to make the waygates connect, as i don't know how to enable the waygate on a unit that do not exist at the start of the game.

So i need either help fixing a trigger for this, or if some one have a good idea how to solve this problem in any other way.

If you do NOT understand what i am asking for, or if you want more information, feel free to ask and i will try to explain further.

#### Elvendan

Level 5
You may for example make a dummy way gate unit, which moves to that ship every time it lands and returns back (to somewhere you could not find it) when it goes up. And also you can make a trigger that moves a unit which comes close enough to the landed ship to the interior instantly.

#### CrueIIntentions

Level 9
You can have the airship and the waygates pre placed before initialization, then set it so that:
• Events
• Unit - A unit comes within 256.00 of AirShip(YOUR UNIT)
• Conditions
• Actions
• Set temploc = (Position of (WayGate(YOUR WAYGATE)))
• Unit - Move (Triggering unit) instantly to temploc
• Custom script: call RemoveLocation(udg_temploc)
Otherwise, you have to set that bad boy and your waygates, if applicable, to a variable. Then simply do a periodic check every x seconds to see if there is a unit close to your variabled unit. Like this:
• Airship Move
• Events
• Time - Every 0.50 seconds of game time
• Conditions
• Actions
• Set AirLoc = (Position of (Variabled Airship))
• Set temploc = (Position of (WAYGATE))
• Set tempgroup = (Units within 256.00 of AirLoc)
• Unit Group - Pick every unit in tempgroup and do (Actions)
• Loop - Actions
• Unit - Move (Picked unit) instantly to temploc
• Custom script: call RemoveLocation(udg_AirLoc)
• Custom script: call RemoveLocation(udg_temploc)
• Custom script: call DestroyGroup(udg_tempgroup)
That should just about sum it up. If you want it done in Jass its a little easier. Create a global unit and basically do the same as mentioned above. Hope that helps.

#### Erkowich

Level 6
Also thought about that thing with teleportation via triggers, but problem is that you might not want to enther the ship, as it can be dangerous. Right now i came up with an idea on my own with having the ship use an ability, and then it get's ensnared when it uses that ability. Once it's ensnared the waygate ability is activated. If waygates work when units are ensnared.

#### defskull

Level 33
I have attached a test map
When the Airship lands (once every 10 second interval between Land and Fly), go to the Airship as near as possible and it will teleport you to the "dungeon"
Press the ESC button to escape from the dungeon (this is for repetitive tests)
The teleport only works when the Airship lands

#### Attachments

• Simple Moving Teleport System.w3x
16 KB · Views: 52

#### Erkowich

Level 6
I have attached a test map
When the Airship lands (once every 10 second interval between Land and Fly), go to the Airship as near as possible and it will teleport you to the "dungeon"
Press the ESC button to escape from the dungeon (this is for repetitive tests)
The teleport only works when the Airship lands

Actually i figuered it out on my own. I used a dummy ability that caused the ship to be ensnared. And then via triggers it's connected to the dungeon and the other way around when you use another dummy ability to let it fly agian.

#### defskull

Level 33
Well, there's no harm to download and test my test map, is it ?

#### Erkowich

Level 6
No, but it sounded as if you were using triggers to move the units. Which means you will instantly teleport if you get to close. I am trying to stay away from that, so you don't accidentally get teled into the dungeon.

#### defskull

Level 33
Explain to me by "accidentally" ?
I've used BOOLEAN type variable so it won't be accidentally teleport the unit if the airship is in the air

#### Dr Super Good

Spell Reviewer
Level 63
Can you not set waygate targets via triggers?

Replies
4
Views
424
Replies
10
Views
764
Replies
3
Views
552
Replies
6
Views
638
Replies
2
Views
798