[Script] - Party teleport script

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

[Script] - Party teleport script

Post by Xanathar »

Hi all,
I wrote this script to allow the teleportation of the party at a given location.
SpoilerShow

Code: Select all


-- Create a scripting entity in level 1 with the name "partygate".
function teleport(x, y, dir, lvl)
	-- spawn the teleporter
	temporary_teleporter = spawn("teleporter", party.level, party.x, party.y, party.facing, "temporary_teleporter")
		:setInvisible(true)
		:setSilent(true)
		:setTriggeredByParty(true)
		:setTriggeredByItem(false)
		:setTriggeredByMonster(false)
		:setTeleportTarget(x, y, dir, lvl)
		:activate()

	if (temporary_pressureplate ~= nil) then
		temporary_pressureplate:destroy()
		temporary_pressureplate = nil
	end
	
	temporary_pressureplate = spawn("pressure_plate_hidden", lvl, x, y, dir, "temporary_pressureplate")
		:setTriggeredByParty(true)
		:setTriggeredByMonster(false)
		:setTriggeredByItem(false)
		:setActivateOnce(true)
		:setSilent(true)
		:addConnector("activate", "partygate", "cleanup")
end

function cleanup()
	if (temporary_teleporter ~= nil) then
		temporary_teleporter:destroy()
		temporary_teleporter = nil
	end
end


Usage:
  • Create a script entity in level 1 (or wherever) and call it "partygate"
  • From any other script entity call partygate.teleport(<x>, <y>, <facing>, <level>)
  • Example: partygate.teleport(30, 10, 1, 1)
Let me know of any bug or if it is a duplicate.

Added to wiki: http://grimwiki.net/wiki/Teleport_Party
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: [Script] - Party teleport script

Post by msyblade »

So, this is like a recall, or portal home? I mean : you're down in level 5, beat up, with 2 ppl dead, you cast this and it takes you back up to the temple and shop everytime? and if so, can we work it into a spell? AND IF SO, can we give it a return function, to the spot you recalled from? anyone else following me here or do i sound like a raving loon? Cant it be both ;)
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: [Script] - Party teleport script

Post by Xanathar »

Currently it's just a function you can call to teleport the party, not a spell. It can be used to implement EOB-style gates, Mark/Recall UO-style teleport spells (or other teleport spells), puzzles of various kind, etc.

In my case I've developed it to implement some variant of the EOB-style gates.

Personally, I would recommend against doing teleport spells as they complicate all the puzzles and makes making dungeons much harder to design in order to make them "stuck-proof".
For example imagine a classic room with a portcullis which closes behind and you have to fight the boss to gain a key item (as a side note, this is like half of the zelda games :D ). If you teleport out after the portcullis is closed you have no chance to reenter and gain the item and thus you are stuck and have to reload. Not funny.

Note that this can't happen with gates, as the gates are in specific parts of the dungeon and thus are little more than an additional - cool - pair of stairs.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: [Script] - Party teleport script

Post by Xanathar »

Ok, I have read too late about your part regarding "teleporting back to the previous location". That should solve the "stuck" problem, but regardless of that I think the teleport could be easily unbalancing.

Tomorrow I'll try to work out a spell script of some kind.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: [Script] - Party teleport script

Post by msyblade »

Oh man, the balance thing, you are absolutely right. The dungeon would have to be GRUELING to warrant it.But an impossibly difficult entire dungeon, with ability to place a marker at say, the store and healing stone on level 1 (store uses some currency that can only be found deep down, like, the deeper ya get, the more powerful items you can buy....sorry just brainstorming here...would need the ability to place a marker freely, and auto-place upon recall. Not sure how difficult auto placing upon casting could be, will check it out.
I think its an awesome idea, overall.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Post Reply