teleporting to object ingame

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

teleporting to object ingame

Post by kelly1111 »

Hello,

I was wondering if it is possible to teleport the party to an object ingame (presure plate connected to a script)
For intance another presure plate or something like floor_dirt_23 ?

And how would you do that?
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: teleporting to object ingame

Post by MrChoke »

A teleporter component has a teleport target you can set, either via the editor or in a LUA script:

setTeleportTarget(level, x, y, elevation)

If you want to teleport to an object, just set the teleport target values to the location of the object. Even easier, in the editor you can click the "?" next tot select target and click on the object you want to teleport too.

Now, if the object moves and you want to always teleport to it, you have to set the teleport target to that of the object's current X, Y, level and elevation every time it moves. Of course, if you use the teleporter and teleport on top of some objects, like a monster for example, you will tele-frag him!
Post Reply