ok newbie here ... ,
i searched the forum but did not found what i 'm looking for.
i have an object door ( oDoor ) and a key in my inventory (iKey)
what i want to do is simple :
i pick the key in my inventory then use it on the door.
i thought it was in the function iKey_Interact() but i'm stuck.
please help.
jp
ok i got it :
function oPorte_UseInv()
{
if ( cEgo.ActiveInventory == iKey)
{
oPorte.SetView(3);
oPorte.Animate(0, 7, eOnce, eBlock, eForwards);
}
}
but now the key remains on screen , any way to put it back in inventory after use?
another call to addInventory?
thanks
mouse.Mode==eWalkto changes the mouse mode to walking, or use any of the other mouse modes. You might consider putting a loseInventory after Animate, unless the player will use the key inventory item again. By making the player lose it (again, only if this the only time they use it) it keeps the inventory from getting cluttered.
~Trent
function oPorte_UseInv(){
if ( cEgo.ActiveInventory == iKey) {
oPorte.SetView(3);
oPorte.Animate(0, 7, eOnce, eBlock, eForwards);
player.ActiveInventory=null;//that will make the cursor back to normal.
//or
//player.LoseInventory(iKey);
//that will make the cursor back to normal, and lose item.
}
}
Un-comment anything you want to put to use, I've put them in bold to help you see what I changed.