Forum rules - please read before posting.

How can I have a hotspot based inventory showing every inventory items ?

Hello,

I have a little inventory inside a hotspot based interface.
This interface is triggered by player vicinity so I have to set my InventoryBox to "Hotspot Based" (if I set it to default or anything else it won't work...)

I would like this inventory to show every items I'm carrying and not only items that have an interaction with the hotspot (and lunch the standard interaction if needed).

Do I have to manually create interactions for each hotspot/item combination or is there any work around ?

Thx

image

Comments

  • edited July 2015
    Ok I found the solution all by myself.

    //get item's label from the inventoryBox
    string invItemLabel = AC.PlayerMenus.GetElementWithName ("Interaction","InventoryBox").GetLabel (0,0);
    //get its position in localItems
    int invItemPos=AC.KickStarter.runtimeInventory.localItems.FindIndex(myItem => myItem.label == invItemLabel);
    //get its Id (may be different from position !!!)
    int invItemId=AC.KickStarter.runtimeInventory.localItems[invItemPos].id;
    //perform "use item on active hotspot"
    AC.KickStarter.playerInteraction.ClickButton (AC.InteractionType.Inventory,0,invItemId,AC.KickStarter.playerInteraction.GetActiveHotspot ());
  • Great job!  This is exactly the kind of thing I hope the new script reference will be able to help with.

    I wonder if this thing should be more easily do-able though, so I'll have a think about that.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.