Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Vault15 on Sat 20/10/2012 01:55:41

Title: (SOLVED) Code for detecting that an item is selected (to move around)?
Post by: Vault15 on Sat 20/10/2012 01:55:41
When you select an item in your inventory what is the code that basically does the function of "iSMG.selected == true". And by detected I mean in eModeInteract you grab the item and you can move it around.

Better yet, is there a code that reads whether ANY item is currently selected? As in the cursor mode is not any of the defaults or listed in the "cursors" section of AGS.


The reason I need to know this is for dragging the item into a different character's inventory. I have 3 inventories for specific functions such as what is in the player's right or left hand. Eventually I'll make another one for an Armor slot. Anyway, more of that can be seen in my previous post. I managed to get all 3 up at once and I'm still messing with code and looking around since I'm lost.

If I use the code "cEgo.ActiveInventory == iSMG" does that detect if the item is in my inventory at all or is this for if I select the item? I'm looking for the code for when the item is selected and "picked up".

Anyone out there  :)?
Title: Re: Code for detecting that an item is selected (to move around)?
Post by: Khris on Sat 20/10/2012 12:37:49
Code (ags) Select
  if (mouse.Mode == eModeUseinv) ...

The InventoryItem* is player.ActiveInventory.
Title: Re: Code for detecting that an item is selected (to move around)?
Post by: Vault15 on Sat 20/10/2012 14:54:49
Quote from: Khris on Sat 20/10/2012 12:37:49
Code (ags) Select
  if (mouse.Mode == eModeUseinv) ...

The InventoryItem* is player.ActiveInventory.

Sometimes it's the simple things that get me...thanks again Khris. I'm sure you might literally be staring at the screen with a gun ready from my last post. I think I was asking for too much  :=