Spikes that stay out

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Spikes that stay out

Post 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.
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Re: Spikes that stay out

Post 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.
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Spikes that stay out

Post 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).
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Spikes that stay out

Post 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.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Spikes that stay out

Post 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,
		},
	},
}
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Spikes that stay out

Post 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...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Spikes that stay out

Post 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
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Spikes that stay out

Post 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,
		},
	},
}
Emera Nova
Posts: 146
Joined: Wed Jun 11, 2014 1:31 am

Re: Spikes that stay out

Post 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.
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

Re: Spikes that stay out

Post 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?
Post Reply