Re: Counting items in an alcove
Posted: Sat Oct 27, 2012 2:33 am
Oaoh!!!Grimwold wrote:There is a way to do it with just counters, but you'd need to have 5 of them... 1 counter for each alcove initial value 1 which decrement when the alcove has an item inserted, and increment when the item is removed. Each of the 4 counters is linked to the 5th counter with decrement and increment events. the 5th counter has initial value 4 and when it reaches 0 the door opens.. if it deactivates then close the door.
To do the same puzzle with scripts all you need is to check alcove:getItemCount() ~= 0 for each one. e.g.Code: Select all
function checkAlcoves() if alcove_1:getItemCount() ~= 0 and alcove_2:getItemCount() ~= 0 and alcove_3:getItemCount() ~= 0 and alcove_4:getItemCount() ~ 0 then temple_alcove_door:open() else temple_alcove_door:close() end end
Soooooooo easy as I can't believe it XDDDDDD To use different counters refering to a 5th one!!!
One more time, Grimwold saving our modding-based lives
Thaaaaaanks man