Page 2 of 2

Re: Scripting Help: Item Placement on Two Alcoves

Posted: Sat Oct 20, 2012 11:57 am
by SpiderFighter
Komag wrote:spam cleaned up
Komag, don't you ever sleep? ;)

Re: Scripting Help: Item Placement on Two Alcoves

Posted: Sat Oct 20, 2012 12:00 pm
by SpiderFighter
Decayer wrote:

Code: Select all

function checkItems(caller)
	for i in caller:containedItems() do
		if i.name == "skull" then
			counter_1:decrement()
			return
		end
	end
	
	counter_1:increment()
end
Add a counter and change its ID to counter_1 (or change counter_1 in the code to its ID). Set it to have an initial value of 2 and to toggle your door when it receives "any" event. Link your alcoves to the script entity with an "any" event and make sure that 'Activate Always' is unchecked.
Ohhhhhhhhh.....now I see. I was looking for a statement "if i.name [is not equal to] "item name here"
As usual, I'm overthinking. Thanks for such an elegant lesson, Decayer.