Page 1 of 1

Item for teleport use

Posted: Thu Feb 14, 2013 3:00 pm
by Ulwaen
Hello everyone!
To finalize the dungeon I'm working on, I need an item (scroll/object, ect) that allows me to teleport the party to a predefined coordinates.
In fact, in the dungeon there is a labyrinth, wich switch of way any time we use a new lever inside it. So just after the first lever, we can't leave the labyrinth until to reach the exit (a little frustrating...)

I toke a look to this posts:
viewtopic.php?f=14&t=4883&p=52292&hilit ... oll#p52292
viewtopic.php?f=14&t=4629&hilit=learn+spell&start=10
but it's talking about spell which uses runes, instead of a simple "right clic on the item", like the magic scroll in Baldur's Gate
(Ok in Baldur the magic scroll may be use one time, no matter what skills the wizard requires, but that's not the point ^^(it may inspire brillant modder here ;) )

So, doest it exist a way to teleport the party by just right clicking on an item?

Re: Item for teleport use

Posted: Thu Feb 14, 2013 6:01 pm
by Ryeath_Greystalk
This is a bit over my skill level, but a suggestion might be to have the item spawn a teleporter to the party location.

So maybe clone a rock (to steal the hearthstone idea from World of Warcraft) that has the ability to call a Lua script that can spawn a teleporter at party.loc(x,y,z) and maybe add a timer to remove the portal after 1 second or something.

Of course one of the knowledgeable modders would need to step in here and determine if that would work. I'm just throwing a guess out there.

Re: Item for teleport use

Posted: Thu Feb 14, 2013 6:10 pm
by Neikun
Oh we had an item like that come up once before. Successfully made. Who made it though, I can remember. Maybe Diarmuid or P.Ferguso?

Was it Lark, maybe?

Re: Item for teleport use

Posted: Thu Feb 14, 2013 6:22 pm
by Ryeath_Greystalk
Looking through the scripting reference I find the party.setPosistion(x,y,facing,level) function. You could probably use that a forget what I said about spawning a portal.

Now just need to figure out how to get the item to trigger it.

I also remember seeing talk of the scroll of safe return in the frankendungeon thread. Mayby there's a clue in there somewhere.

Re: Item for teleport use

Posted: Thu Feb 14, 2013 6:29 pm
by Sutekh
Maybe something like this?

viewtopic.php?p=32303#p32303

Re: Item for teleport use

Posted: Thu Feb 14, 2013 6:31 pm
by Xanathar
Try defining this item:

Code: Select all

	defineObject{
		name = "tome_teleport",
		class = "Item",
		uiName = "Tome of Maps",
		model = "assets/models/items/tome.fbx",
		description = "The cover of this book says 'go where you wanna go with our kind service - dial 1-800-TOMEOMAP for details'",
		skill = "spellcraft",
		requiredLevel = 7,
		gfxIndex = 30,
		weight = 1.0,
		gameEffect = "Teleports you somewhere else meh",
		onUseItem = function(self, champion)
			party:setPosition(4,3,2,1)
			return false
		end,
	}
Not tested.

Re: Item for teleport use

Posted: Thu Feb 14, 2013 6:59 pm
by Komag
This thread just game me the idea that it would be possible to have a fully functional magic map using a lot of scripting and a lot of gui hook stuff
- recreate the function of the automap (keep track of every explored x/y coordinates)
- graphically display it with gui render hook (when player uses map object in inventory)
- set up so clicks on opened walkways will teleport player there

Re: Item for teleport use

Posted: Thu Feb 14, 2013 7:40 pm
by Ulwaen
Thank you all for your speed answers ;)
Xanathar > I tried but there is an error when I open the scene in the editor :/
The Montis's technic work just fine^^, thanks Sutekh