Script Struggle

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
moonax
Posts: 7
Joined: Thu Jan 29, 2015 10:16 am

Script Struggle

Post by moonax »

Hi,

This my first time giving modding a go. I have a script for the activation of a teleport when an item is put in an alcove. I used a similar script elsewhere to open a gate, but some isn't working for this. Any help? Thanks.

Here's the Script

function checkItems(alcove)

if alcove.contents("blue_gem")
then teleporter_3:activate()
else
teleporter_3:deactivate()
end
end
User avatar
maneus
Posts: 246
Joined: Mon Jun 17, 2013 10:42 pm
Location: Switzerland

Re: Script Struggle

Post by maneus »

Try this:

Code: Select all

for i in nameofyouralcove:containedItems() do
		if i.name == "blue_gem" then
		   teleporter_3:activate()
			else
			teleporter_3:deactivate()
			end
			end
			end
Connect your alcove with this script on event "any".
moonax
Posts: 7
Joined: Thu Jan 29, 2015 10:16 am

Re: Script Struggle

Post by moonax »

Thanks maneus. I tried your script but it says "attempt to call method 'containedItems' (a nil value). [Note: this is for LOG 2].
User avatar
maneus
Posts: 246
Joined: Mon Jun 17, 2013 10:42 pm
Location: Switzerland

Re: Script Struggle

Post by maneus »

If your future questions are for Grimrock 2 then please post your questions in the modding section of the forum for Grimrock 2. ;)
Post Reply