One more Daemon Eyes topic...

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Brainer
Posts: 2
Joined: Sun Nov 04, 2012 1:34 pm

One more Daemon Eyes topic...

Post by Brainer »

Only a little question about multiple objects in one script:

So, I have a puzzle. Four heads of four gods. And there are gems of certain colors for each one. Two of gods are one-eyed, one is fully eye-capable, and one is blind. Only one combination of gems with heads activates the portal.

The problem is: which kind of function is needed? I've tried something like this:

function fourportalactivate()
if firegodright:hasred_gem() or
firegodleft:hasred_gem() and
///the same one with the ice one
earthgodright:hasgreen_gem() and
earthgodleft:hasgreen_gem()
///air god is the blind one, yeah
then
fourportal:activated()
end
end

And I'm getting an error of "unknown type of function". "Has" function, to be precise. Am I supposed to use item NAME, or ID is needed?
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: One more Daemon Eyes topic...

Post by msyblade »

Ill show you a similar code I use for item checks in objects, It's only one object but it should help you with the syntax

Code: Select all

function gemcheck()
	
	for i in shopaltar:containedItems() do
		if i.name == "red_gem" then
			shopdoor: open()
			teleporter_44: activate()
	
		end
	end
end
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Brainer
Posts: 2
Joined: Sun Nov 04, 2012 1:34 pm

Re: One more Daemon Eyes topic...

Post by Brainer »

You have my gratitude.
Post Reply