Forum rules - please read before posting.

Litlle question about stackable items

Hi, i tried to search in the forum without luck. I'm using drang and drop system to use inventory items on hotspots. i have a stackable item (coins) and would like to drag and drop a quantity of coins that player chose on target, but do not know how to do it. I tried All, single and stack as option but last two choices make no difference, always one will be selected. What's the best practice to achieve this result? Should create a custom UI menu with input and an associated variable for quantity?
Thanks

Comments

  • "Stack" works by increasing the count each time the item is clicked - so it's not compatible with drag-and-drop.

    You can affect the quantity through script - by calling the selected item instance's AddStack function:

    AC.KickStarter.runtimeInventory.SelectedInstance.AddStack ();
    
  • Thanks. But actually i'm really e newbie and would not know how to do it :(

  • What's the exact behaviour you're aiming for?

  • I did it like this: Created a UI menu with input field that stores the chosen number in a variable (the quantity of coins is related to a quiz) then removed the quantity with the proper action list command. Luckily is a fixed number (the correct answer) so did not have to use a variable (and a script to do it)

  • I'm not clear on how you'd have an input field work with drag-and-drop inventory - do you need it like this? I'd imagine an easier way would be to use e.g. the mouse scrollwheel to increase/decrease the stack once the player holds the mouse over an item to select it.

  • Will be an Android game for children. When i drop coins on npc, a menu with input field appear. You choose amount, and only one option is correct, so i do not need fortunately turther programming :D

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.