edited March 2018 in ORK Support
Hi,
What I did was create new project, imported ORK demo and followed this tutorial. http://orkframework.com/tutorial/howto/shortcut-slot-system/

Afterwards I set the the Inventory Add items type to Add so it would not autostack items, and I added a second copy of Magic potion with different quantity, so now In inventory I have two instances of Magic potion. (Qnt 5 & Qnt 3).

Now when I tried to assign the second instance of magic potion (Quantity 3) to skill bar, it assigned the first instance of magic potion (Quantity 5) instead.

Is there some setting I missed, or is slot system limited to first instance of item in inventory?
Post edited by hellwalker on
  • How did you assign it, e.g. drag+drop?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Yes with drag and drop In demo.

    Well actually at first I tried this with code on custom UI. Something like this:
    void AssignShortcut(UI_Cell _Cell, IShortcut _Item)
    {
    ShortcutSlotAssignment _ShortcutSlotAssigment = new ShortcutSlotAssignment();
    _ShortcutSlotAssigment.slot.index = _Cell.CellID;
    _ShortcutSlotAssigment.slot.SetShortcut(ORK_UIManager.instance.SelectedCombatant, _Item);
    }

    Where IShortcut _Item is shortcut taken from

    List<IShortcut> _CombatantInventory = ORK_UIManager.instance.SelectedCombatant.Inventory.GetContent(false, true, true, true, -1, false);


    When this kept assigning only first instance of item, I tried it in vanilla demo/new project and same thing happened.
  • Will do some tests, might be that the checks if the item is still available cause it to be replaced with the other stack.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • @gamingislove Thanks!
    This is not related, but is there any way to copy source code directly to unity project and run that instead of built .dll?
  • @hellwalker - I haven't tried it yet, but with the assembly definition files in Unity 2017.3, you should be able to use the source files instead of the DLL without killing your compile times.
  • @Keldryn So far It gives me tons of errors to move source files to project.
  • edited March 2018
    Using source code in an existing ORK project will pretty much break it. Adding the source files and removing the DLL leads to breaking all links between assets, components and game objects and their ORK scripts, you'd have to manually reassign the correct script files afterwards.

    I don't know if what @Keldryn is talking about helps with that, but probably not :)
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • @gamingislove - No, assembly definition files won't help with that. :-)

    I was thinking back to something you once write about it being possible to use the source code files instead of the DLLs, the main issue with that being that it would significantly increase compilation time.

    At least that's what I remember you writing. ;-)

    Kind of forgot about losing the references to ORK components on existing prefabs and gameobjects though. My bad.
  • @hellwalker
    Next update will check if the assigned shortcut instance is in the inventory and prioritize using it instead of finding a suitable matching data.
    So, it should be fixed with the next update - if you have beta access on patreon, you can test it with the latest ORK beta version.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • @gamingislove
    Awesome thanks!

    will it differentiate between same type of items in inventory?
    For example if I have healing potion stack 1 and healing potion stack 2?
  • Yes, at least it should. Stack 1 and stack 2 would be separated instances, i.e. assigning one of the stacks will use that stack as the shortcut - however, when the stack is removed from the inventory, the shortcut will be replaced by the next stack of that item it can find.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.