function iKey_Interact() ; problem interacting with inventory item(SOLVED)

Started by jpcr, Fri 14/11/2008 22:09:36

Previous topic - Next topic

jpcr

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

jpcr

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

Trent R

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
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk