Detect that item is food?
Posted: Mon Jul 01, 2013 10:39 pm
I've just started working on my very first LoG custom maps, and I've hit a snag. I want to create an alcove that requires food to be placed on it before the party is able to progress through my map; however, I can't find a way to see if an item has a nutritionValue!
I know I can do this
I want to do this (or something like it to detect food)
Any Ideas?
Thanks in advance!
I know I can do this
Code: Select all
function itemPuzzle()
-- iterate through all contained items on alcove, checking for a matching name
for i in itemPuzzleAlcove:containedItems() do
if i.name == "pitroot_bread" then
-- do something like open a door or activate a counter
break
end
end
end
Code: Select all
function itemPuzzle()
-- iterate through all contained items on alcove, checking for a matching name
for i in itemPuzzleAlcove:containedItems() do
if i.nutritionValue then
foodCounter:increment()
break
end
end
end
Thanks in advance!