Page 1 of 2

Spikes that stay out

Posted: Thu Aug 20, 2015 3:31 pm
by Emera Nova
I'd like to set it up so that there will be spikes in a path forward and you have to figure out which way to go. If you dig on the spike it will get trigger and will stay up. Is there a way to force the spikes to stay out of the stone once they've been triggered?

Also I'd like to create a stone that you can teleport to when needed. Basically you can place it down in one room and then at any time call on an action to teleport you back to it.

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 5:14 pm
by Emera Nova
I managed to make it so the spikes will stay out after they have been triggered, I now need help on making it so I can use my shovel inside a dungeon.

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 5:24 pm
by THOM
How did you manged it having the spikes staying out?

To get tilesets diggable you have to add in the tile-definition the line

diggable = "true",

(not sure at the moment if with or without quotationmarks).

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 6:18 pm
by Isaac
THOM wrote:diggable = "true",

(not sure at the moment if with or without quotationmarks).
Without. It's a boolean value, not string data.

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 6:38 pm
by Isaac
Emera Nova wrote:Also I'd like to create a stone that you can teleport to when needed. Basically you can place it down in one room and then at any time call on an action to teleport you back to it.
Unlimited?

Code: Select all

defineObject{
	name = "horn_of_recall",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/horn.fbx",
		},
		{
			class = "Item",
			uiName = "Horn of Recall",
			gfxIndex = 297,
			weight = 1.0,
			primaryAction = "blow",
			description = "This horn has a burnt electrical smell.",
		},
		{
			class = "ItemAction",
			name = "blow",
			uiName = "Blow Horn",
			cooldown = 4,
			onAttack = function(self)
				hudPrint("The party is teleported.")
				local recall = {15,15,0,0,1}
				party:setPosition(unpack(recall))
				playSound("blow_horn")
			end,
		},
	},
}

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 7:05 pm
by THOM
Be careful with items like that. Players can throw this thing over - let's say - a pit and can enter this way an area, that they are not supposed to enter...

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 7:20 pm
by Azel
THOM wrote:Be careful with items like that. Players can throw this thing over - let's say - a pit and can enter this way an area, that they are not supposed to enter...
Those are called "easter eggs" :P

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 7:25 pm
by Isaac
THOM wrote:Be careful with items like that. Players can throw this thing over - let's say - a pit and can enter this way an area, that they are not supposed to enter...
That's not how it works. You use the horn, and it teleports the party. If you throw it away, you can't use it.

(Originally I had it setup to BE the balance spell, and that worked fine, but only a living spell caster could cast it; so I changed it to the horn.)
_____________

An alternate definition of the above item:
This one requires that you place a script entity named teleportDest at the desired teleport destination; and that's where they teleport. This not only makes it easy to see the destination in the editor, but it allows you to change the destination during the game, by moving the location of the script entity.

Code: Select all

defineObject{
	name = "horn_of_recall",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/horn.fbx",
		},
		{
			class = "Item",
			uiName = "Horn of Recall",
			gfxIndex = 297,
			weight = 1.0,
			primaryAction = "blow",
			description = "This horn has a burnt electrical smell.",
		},
		{
			class = "ItemAction",
			name = "blow",
			uiName = "Blow Horn",
			cooldown = 4,
			onAttack = function(self)
				hudPrint("The party is teleported.")
				 local recall = {}
				 recall[1], recall[2],recall[3],recall[5] = teleportDest:getPosition()
				 recall[4] = teleportDest.elevation
				party:setPosition(unpack(recall))
				playSound("blow_horn")
			end,
		},
	},
}

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 7:34 pm
by Emera Nova
Currently at work so I'll read more in depth what everyone has posted so far.

This is the line of code I used to stop the animation of the spikes.

Code: Select all

function test()
floor_spike_trap_1.animation:stop()	
end
I attach a trigger to a timer set for .3 seconds and the same trigger to start the spike traps. This causes it to shot up but then get frozen with the spikes still out. Tho you are able to walk through the spikes when it is like this so if you don't want that you'd have to block it or something.

Also new question Any idea on how to make a warg follow a line of silverfish? I'm wanting to make it so you have to make a warg step on a pressure plate and you have to slowly lead him there using fish.

Re: Spikes that stay out

Posted: Thu Aug 20, 2015 11:20 pm
by kelly1111
An alternate definition of the above item:
This one requires that you place a script entity named teleportDest at the desired teleport destination; and that's where they teleport. This not only makes it easy to see the destination in the editor, but it allows you to change the destination during the game, by moving the location of the script entity.


How do you move the script entity (teleportDest) ingame (via for example a floor trigger) .. what script would do that?