scripting help

Have trouble running Legend of Grimrock 2 or do you have questions about the purchasing options? Look for help here.
Posts: 77
Joined: Fri Jan 10, 2020 1:13 am

Re: scripting help

Post by ratman » Tue Jan 21, 2020 11:57 pm

I also tried in a new project and same warning

User avatar
Posts: 2949
Joined: Fri Mar 02, 2012 10:02 pm

Re: scripting help

Post by Isaac » Wed Jan 22, 2020 12:34 am

That's very peculiar that I don't get an error with mine, but yours does.

Okay, try this variation on the script:

Code: Select all

altar_1.surface:addConnector('onAcceptItem',, "itemSwap")
function itemSwap(surface, item)
	local checkItem = "rock"
	local itemReplacement = "figure_skeleton"
		if item.go.item:getStackSize() == 1 and == checkItem then
			--optional effect 
			return false
This one gives me no errors, but handles things slightly different than before; based on a hunch. The original script did have a bug—though it didn't crash for me. This version fixes that bug.

Posts: 77
Joined: Fri Jan 10, 2020 1:13 am

Re: scripting help

Post by ratman » Wed Jan 22, 2020 12:50 am

that works thank you. :D

Posts: 66
Joined: Sat Jul 05, 2014 3:08 pm

Re: scripting help

Post by billb52 » Tue Feb 18, 2020 5:17 pm

Hi Issac
Tried using your variation of the script but when you place the rock on the altar I end up with 2 'skeleton figurines' every time
and the particle system does not fade out, any ideas?

Post Reply