How to teleport?

Share your best strategies and tactics with other players by posting them here.

Moderator: MOD_Command

Post Reply
Rongor
Posts: 451
Joined: Tue Mar 25, 2014 7:35 am
Contact:

How to teleport?

Post by Rongor »

Hey guys,
what would be the most convenient to relocate a unit in a running scenario by a script? What LUA functions would be used for that?
Only idea I came up with so far is to kill the present unit and than spawn (addunit) it anew at the desired location. Is that the (only) way to go here?
In particular, I want to teleport docked units out of their pier facility to a location anywhere at sea around the globe.
User avatar
Gunner98
Posts: 5940
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: How to teleport?

Post by Gunner98 »

An event with 3 actions and triggered with either a 'unit enters area' or 'unit remains in area' trigger.


Before you set up the actions create another 'side' which is blind and not aligned to anyone. Go to that side with 'Gods Eye' on.

Set up an area across the globe in that blind side.

Actions:

Teleport: The unit in question to the area on the blind side
Lua: Change the unit to that blind side

ScenEdit_SetUnitSide({side='original side', name='of unit', newside='blind side'})

Message: to tell the player that it happened

B

Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Rudd
Posts: 468
Joined: Wed Jul 10, 2013 10:34 am

RE: How to teleport?

Post by Rudd »

Curious why you change the unit to the 'blind side'?
USSInchon
Posts: 40
Joined: Mon Feb 17, 2014 2:43 pm

RE: How to teleport?

Post by USSInchon »

ORIGINAL: Rudd

Curious why you change the unit to the 'blind side'?

so that it is hidden on the map and not distracting to the player wondering why there is this object on the far side of the globe.
User avatar
Gunner98
Posts: 5940
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: How to teleport?

Post by Gunner98 »

Exactly. And in your message you can tell whatever story you like and it's more believable. Also this is better (in my mind) than Lua Delete unit, because it makes it easier to return the unit into play if you like at a later point (i.e. a minor stay in dry dock for several days etc).

Thinking about the original post. Lua Delete would be quickest: ScenEdit_DeleteUnit({side='original side', name='of unit'})

B

Edit: I am not a Lua Guru, if you need help I would check with CK, Kushan or Baloogan and probably a few others.

B
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Rudd
Posts: 468
Joined: Wed Jul 10, 2013 10:34 am

RE: How to teleport?

Post by Rudd »

Got it, I see what you guys are saying and agree. I just didn't see that intent in the OP, just sounded like a simple teleport to me when I read it[:)]
Post Reply

Return to “The War Room”