Anvil altar for smashing things

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Lupe Fenrir
Posts: 25
Joined: Sun Oct 07, 2012 7:42 am
Location: Sweden

Anvil altar for smashing things

Post by Lupe Fenrir »

I made a script for an altar that you can put a gem on and then smash with a hammer to reveal a key.
I hope someone other than me will find it useful. :)

Code: Select all

cloneObject{
	name = "grimforge_anvil",
	baseObject = "waltar", -- should work with any alcove or altar variant
	onInsertItem = function (self, item)
		if item.name == "ogre_hammer" then
			for i in self:containedItems() do
			  if i.name == "blue_gem" then
					playSound("impact_blunt") 
					playSound("lightning_bolt_hit")
					playSound("level_up")
					i:destroy()
					self:addItem(spawn("gold_key"))
				 break
			  end
			end
		end
		return item.name == "blue_gem" and self:getItemCount() == 0
	end,
}
Uses the "waltar" found here, but it will work the same if you change the word "waltar" to "altar" or "Alcove, I just think it looks better this way. :P


Also, if anyone knows how to make it "activate" only when you break something on it, as opposed to when you add something to or remove something from it, please tell me.
My name is Torsek in some places
User avatar
Kuningas
Posts: 268
Joined: Wed Apr 11, 2012 10:29 pm
Location: Northern Finland

Re: Anvil altar for smashing things

Post by Kuningas »

I'm thinking smashing rocks to find gems myself -- I may incorporate it to a puzzle in my main dungeon.

Also, I like the way you've put the sounds in as well, makes for a lot more anvil-like experience. : D
BASILEUS
User avatar
Lupe Fenrir
Posts: 25
Joined: Sun Oct 07, 2012 7:42 am
Location: Sweden

Re: Anvil altar for smashing things

Post by Lupe Fenrir »

I'm happy you liked it. :D
My name is Torsek in some places
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: Anvil altar for smashing things

Post by crisman »

Nice idea!! I'm working on the same waltar, but mine is a heated waltar, for creating some special chemical compound by placing flasks with the starting mixture on it. I'll script it this evening, right now I'm just write on paper the puzzle itself :D
Post Reply