This run from anywhere, would move the script_entity to 14,14 on level 1:kelly1111 wrote:How do you move the script entity (teleportDest) ingame (via for example a floor trigger) .. what script would do that?
Code: Select all
teleportDest:setPosition(14,14,1,0,1)Here is a neat trick to do with this horn. Place this function in the teleportDest script_entity, and connect several pressure plates to it; [hidden or otherwise]. Set them all to 'onDeactivate'.
The function moves the script to the location of the calling pressure plate, and so the plates act like milestone markers. The last plate the party stepped on, is where the horn will take them.
Code: Select all
last_call = nil
function waypoint(caller)
if caller.go.id ~= last_call or last_call == nil then
last_call = caller.go.id
local recall = {}
recall[1], recall[2],recall[3],recall[5] = caller.go:getPosition()
recall[4] = caller.go.elevation
teleportDest:setPosition(unpack(recall))
end
end