Page 1 of 2

portal like teleport

Posted: Fri Jun 19, 2015 6:20 pm
by Granamir
Hi everyone,
anyone has any idea how to make a portal act like a teleporter? (problem is how to set destination in "onArrival = function()")
TY

Re: portal like teleport

Posted: Fri Jun 19, 2015 6:49 pm
by minmay
You can't really make it work for objects other than the party. For the party just use party:setPosition() in the onArrival hook.

Re: portal like teleport

Posted: Fri Jun 19, 2015 7:07 pm
by Granamir
Thak you minmay, just saw another post like mine.
Btw, is there a way to set dynamically destination coords? (as far as i know in teleport object destination setting is hardcoded and in portal there is not that function).

Re: portal like teleport

Posted: Fri Jun 19, 2015 7:31 pm
by minmay
use a connector

Re: portal like teleport

Posted: Wed Jun 24, 2015 12:12 am
by Isaac
Granamir wrote:Thak you minmay, just saw another post like mine.
Btw, is there a way to set dynamically destination coords? (as far as i know in teleport object destination setting is hardcoded and in portal there is not that function).
Do you mean to dynamically change the portal's destination, on the fly?

Make a onArrival connector to a script_entity function, and make that function set the party's position using the script_entity's own location and facing. The portal will send the party to wherever the script entity is; and you can control that with :setPosition().

Re: portal like teleport

Posted: Wed Jun 24, 2015 11:51 pm
by Eleven Warrior
Hi all I don't know if anyone else has found this but it's very funny. When you walk through the Portal it will take you to the Script Entity Location.

Thxs to Issac for helping me with this script, although the move bit is strange and was hoping AH would be able to help out here.

1 - Put this code into script entity name does not matter. place in it one square of your choice (NOT WALL) floor.
2 - Put a portal on the map named: portal_1.
3 - Walk through the portal, when the fade finishes, press the ( h ) key and move in any direction. Now we are on the Moon walking Slow Mo lol.

Code: Select all

portal_1:removeComponent("portal")
         portal_1:createComponent("Portal")
            :addConnector("onArrival", self.go.id, "arrivalHook");

 function arrivalHook()      
         party:setPosition(self.go.x, self.go.y, self.go.facing, self.go.elevation, self.go.level)
         GameMode.fadeIn(0xffffff,1)  --Fade in from white, over a 1 second duration.
               GameMode.setGameFlag("DisableMovement",false) --added this Issac lol--
 end

Re: portal like teleport

Posted: Thu Jun 25, 2015 12:07 am
by Isaac
It certainly has something to do with the game speed in the dungeon. Pressing H allows for the slow motion creep... Which could be cool to implement into Stealth. Resting after pressing H, does reset the speed to normal (just like it always does).

Re: portal like teleport

Posted: Thu Jun 25, 2015 9:36 am
by bongobeat
funny thing! :lol:

Re: portal like teleport

Posted: Fri Jun 26, 2015 4:55 am
by Eleven Warrior
Issac imam going to add a delayed call to force party to rest for 0.01 seconds and see what happens :)

Re: portal like teleport

Posted: Fri Jun 26, 2015 6:12 am
by Isaac
Eleven Warrior wrote:Issac imam going to add a delayed call to force party to rest for 0.01 seconds and see what happens :)
Didn't work by the console...

What works, is to define a copy of the portal object, but without the portal component, and with placement = "floor".
Then simply place a teleporter on the same tile and set its destination. Uncheck the particle effect for the teleporter.

Either have the teleporter active, for instant transport; or use a floor_trigger and script for a delayed transport, with optional fade out & fade in.

*The portal will need one or more secret doors placed on its left and right, if not between walls; uncheck their model components to make them invisible.