Rotating the party
Rotating the party
Perhaps the most famous dungeon-crawler "puzzle" is having the party randomly turned around.
So, how do I do this..?
- Party.facing is read-only
- I tried a teleporter with setChangeFacing(true), but I can't change a teleporter's .facing either
So... am I stuck with having to create 4 teleporters on one square, and activating the one that I need in order to turn the party in a specific direction..? Sounds like terrible overkill for me...
So, how do I do this..?
- Party.facing is read-only
- I tried a teleporter with setChangeFacing(true), but I can't change a teleporter's .facing either
So... am I stuck with having to create 4 teleporters on one square, and activating the one that I need in order to turn the party in a specific direction..? Sounds like terrible overkill for me...
Re: Rotating the party
This has definitely been mentioned on the forums before. I think it may have been in the EOB thread - viewtopic.php?f=14&t=3350&start=50&hilit=waterdeep
but there are 11 pages and with a cursory glance I can't just find it.
I think if I were going to try scripting it I would use hidden pressure plates at each entrance that destroy the existing teleporter and spawn a new one with the appropriate facing.
e.g. something like:
but there are 11 pages and with a cursory glance I can't just find it.
I think if I were going to try scripting it I would use hidden pressure plates at each entrance that destroy the existing teleporter and spawn a new one with the appropriate facing.
e.g. something like:
Code: Select all
rotator_teleporter:destroy()
spawn("teleporter",level,x,y,facing,"rotator_teleporter")
:setTriggeredByMonster(false)
:setTriggeredByItem(false)
:setTeleportTarget(x,y,facing)
:setChangeFacing(true)
:setInvisible(true)
:setSilent(true)
:setScreenFlash(false)
Last edited by Grimwold on Fri Oct 19, 2012 1:37 pm, edited 1 time in total.
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Rotating the party
You also want the teleporter to only work for an extremely short period of time or else the player won't be able to move!
Finished Dungeons - complete mods to play
Re: Rotating the party
I didn't realise this was an issue.. I thought, like falling, a teleporter wouldn't activate if you entered it from another teleporter.Komag wrote:You also want the teleporter to only work for an extremely short period of time or else the player won't be able to move!
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Rotating the party
Ah, yes you're right about single teleporters, my mistake. The problem occurs if you loop two or more teleporters, then you can't get out.
Finished Dungeons - complete mods to play
Re: Rotating the party
Ah, that makes sense. Thanks.Komag wrote:Ah, yes you're right about single teleporters, my mistake. The problem occurs if you loop two or more teleporters, then you can't get out.
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Rotating the party
Just tested it, and this worked well for me:
* Create 4 plates and name them plate_N; plate_E; plate_S and plate_W
* Link all 4 plates to a script entity with the above code and the action replaceTeleport
* Place a teleporter and name it turner_teleporter
* Change the co-ordinates of the spawn location and teleport target to suit.
This setup rotates the party clockwise... for other combinations, change the Tfacing values.
Code: Select all
function replaceTeleport(plate)
-- hudPrint(plate.id)
if plate.id == "plate_N" then
Tfacing = 3
elseif plate.id == "plate_E" then
Tfacing = 0
elseif plate.id == "plate_S" then
Tfacing = 1
elseif plate.id == "plate_W" then
Tfacing = 2
else
Tfacing = 0
end
turner_teleporter:destroy()
spawn("teleporter",1,22,8,Tfacing,"turner_teleporter")
:setTriggeredByMonster(false)
:setTriggeredByItem(false)
:setTeleportTarget(22,8,Tfacing)
:setChangeFacing(true)
:setInvisible(true)
:setSilent(true)
:setScreenFlash(false)
end
* Link all 4 plates to a script entity with the above code and the action replaceTeleport
* Place a teleporter and name it turner_teleporter
* Change the co-ordinates of the spawn location and teleport target to suit.
This setup rotates the party clockwise... for other combinations, change the Tfacing values.
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Rotating the party
Hummm. I guess it would work then...
function rotateParty(facing)
spawn("teleporter",party.level,party.x,party.y,facing,"turner_teleporter")
:setTriggeredByMonster(false)
:setTriggeredByItem(false)
:setTeleportTarget(party.x,party.y,facing)
:setChangeFacing(true)
:setInvisible(true)
:setSilent(true)
:setScreenFlash(false)
end
end
... and later just remove it.
Hum, is it just me, or is there no "Activated" hook on a teleporter..?
function rotateParty(facing)
spawn("teleporter",party.level,party.x,party.y,facing,"turner_teleporter")
:setTriggeredByMonster(false)
:setTriggeredByItem(false)
:setTeleportTarget(party.x,party.y,facing)
:setChangeFacing(true)
:setInvisible(true)
:setSilent(true)
:setScreenFlash(false)
end
end
... and later just remove it.
Hum, is it just me, or is there no "Activated" hook on a teleporter..?
Re: Rotating the party
do you mean to test if it is activated, likeSinusPi wrote: Hum, is it just me, or is there no "Activated" hook on a teleporter..?
Code: Select all
turner_teleporter:isActivated()
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Rotating the party
I mean the moment a party/monster/item gets teleported, if I were to make - say - a teleporter that only works under certain conditions, or only teleports certain items thrown at it, and lets others through.