Hello guys:)
First i want to thanks for great job..
I try to make my own dungeon (on steamworks "Agalons") and i want to make some difficult traps and puzzles but for it i need timers and counters. Can anyone explain how it works ? Oh and also why this script doesnt work ?
-- magic pool
function whyitdontwork()
if dungeon_alcove_3:containedItems() == "orb" then
secretdoor21:open()
else
secretdoor21:close()
end
end
Yeah, using the containedItems() is a little more involved than that. Here's a script where I iterate through all the items on an alcove, checking for any daggers. You can use this with very little modifications to get what you want:
function checkAlcoveForItems()
-- change these variables to match your alcove's ID and the item you want to test for
local itemName = "dagger"
local alcoveID = dungeon_alcove_1
-- iterate through all the contained items on alcove, checking for a matching name
for i in alcoveID:containedItems() do
if i.name == itemName then
itemFound()
else
itemNotFound()
end
end
end
-- run this script _once for each item_ with a matching name
function itemFound()
playSound("level_up")
end
-- run this script _once for each item_ without a matching name
function itemNotFound()
spawn("poison_cloud", party.level, party.x, party.y, 0)
end