Specifying Inventory to use

Started by barefoot, Sat 05/12/2009 20:36:26

Previous topic - Next topic

barefoot

Hi

Can someone tell me the best way to script on how to select specific inv items to use on character??

if you have a few items in inv then i need each to do a specific task..

With the UseInv it only gives ()

many thanks
barefoot



I May Not Be Perfect but I Have A Big Heart ..

monkey0506

You should be able to use the player's active inventory such as:

Code: ags
function cWally_UseInv() {
  if (player.ActiveInventory == iKey) {
    player.Say("Wally doesn't need the key.");
  }
  else if (player.ActiveInventory == iHat) {
    cWally.Say("Ah, you found my hat!");
  }
  else {} // you may want to put a call to unhandled_event or something here
}

barefoot

Hi Monkey

thanks for that.. 

If i have say 4 items in inventory i want each one to do a specific thing when used on the main character.. which is Redpant and the inv item i want to use is yhat.. so using inv yhat on Redpants gets Redpants to do certain things..

If I use gun on Redpants  then that would give a different set of things.. etc etc

:)
barefoot

I May Not Be Perfect but I Have A Big Heart ..

Lufia

Well, monkey gave you the way to do that. What's the problem ?

barefoot

Well,   

ive only just got up to speed... and yes, he did, once my brain woke up and I finally realised ;)

Anyhow, it takes a little time to work things out, especially coming straight from 2.6..

You're never to old to learn....(im 54) lol

cheers
barefoot
I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk