Page 1 of 1

One more Daemon Eyes topic...

Posted: Mon Nov 05, 2012 3:45 pm
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?

Re: One more Daemon Eyes topic...

Posted: Mon Nov 05, 2012 4:37 pm
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

Re: One more Daemon Eyes topic...

Posted: Tue Nov 06, 2012 9:47 am
by Brainer
You have my gratitude.