Re: Inventory
Status: Alpha
Brought to you by:
cwalther
From: NigeC <nig...@gm...> - 2008-07-17 13:46:08
|
With Aidan help i now have the inventory and items removed from nodes.. (thanks :) ) I've managed to get a key working on a door using the demo as reference but i need to fine tune it a bit, currently the door unlocks an i go to the next node with the key.. i'd like the door to unlock and the key stay there, and the user click on the handle to leave, the key turn is animated key2.jpg to key5.jpg a message if the door is locked or unlocked > slide { "door.jpg" } > local locked = sound { "doorlocked.ogg" } > local open = sound { "dooropen.ogg" } > local key > hotspotmap "hotspot.png" > hotspot { target = 7, effect = { pipmak.dissolve, 2 }, cursor = > pipmak.hand_back, } > > --key actions > hotspot { > onmousedown = function() > if key:isvisible() then > local k = 4 > pipmak.schedule( > 0, > function() > k = k - 1 > if k > 0 then > key:setimage("key"..k..".jpg") > return 0.05 > else > key:setvisible(false) > inventory:message("pickup", "key") > > end > end > ) > elseif state.inventory[state.inventory.carried] == "key" then > local k = 1 > inventory:message("drop") > key:setimage("key.jpg") > pipmak.overlaynode(100):message("write","the door is > unlocked",{size=20,delay=4,posy=-30}) > open:play() > > key:setvisible(true) > pipmak.schedule( > 0.05, > > function() > k = k + 1 > key:setimage("key"..k..".jpg") > > if k < 4 then return 0.05 end > > pipmak.dissolve(2) > pipmak.setviewdirection(270,0) > pipmak.gotonode(1) > end > ) > end > end > } > onleavenode ( function() if key:isvisible() then > inventory:message("pickup", "key") end end ) > key = patch { x = 522, y = 207, visible = false, image = "key2.jpg" } > > thanks in advance Nige ----- http://nigecstudios.co.uk NigeC Studios -- View this message in context: http://www.nabble.com/Inventory-tp18454898p18508798.html Sent from the pipmak-users mailing list archive at Nabble.com. |