portal like teleport
portal like teleport
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
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
You can't really make it work for objects other than the party. For the party just use party:setPosition() in the onArrival hook.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: portal like teleport
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).
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
use a connector
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: portal like teleport
Do you mean to dynamically change the portal's destination, on the fly?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).
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().
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: portal like teleport
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.
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
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
funny thing! 

- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: portal like teleport
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
Didn't work by the console...Eleven Warrior wrote:Issac imam going to add a delayed call to force party to rest for 0.01 seconds and see what happens
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.