Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Inventory Pro - uGUI - Performance - Mobile support & More

Discussion in 'Assets and Asset Store' started by jorisshh, Mar 8, 2015.

?

What should I build next?

  1. New currency system

    13.4%
  2. Improved serialization / saving for web

    11.0%
  3. Better properties for items (percentages, base values, etc)

    27.0%
  4. Controller support

    14.9%
  5. Unity 5.1 networking (multiplayer)

    37.2%
  6. More modular build to simplify extending

    25.4%
  7. UFPS Multiplayer (Asset integration)

    11.8%
  8. Core GameKit (Asset integration)

    4.2%
  9. Dialogue system (Asset integration)

    21.2%
  10. Wordpress integration (Asset integration)

    4.2%
Multiple votes are allowed.
  1. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    There isn't currently any timing function build in, although it wouldn't be very hard to add.

    But there's another solution, if you add a Canvas Group to the root of your tooltip and disable the Interactable and Block Raycasts dragging won't be interrupted when the tooltip is shown :)


    If you still want to add the timing function, you could do so by overriding the InfoBoxUI component and override the HandleInfoBox(), simply call a coroutine, wait for 2 seconds, and check if you're still hovering the same object, if so show the dialog ^^
     
    hopeful likes this.
  2. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    UMA Update

    All Inventory Pro items can now handle as many UMA equipment items as you like. As demonstrated below a single item that equips both pants and shoes in a single Inventory Pro item. Useful when you want to mix and match :)

     
    TRoNDaNeflin, Teila and hopeful like this.
  3. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,182
    Happy to see the UMA integrations moving along. Eventually we'll get that guy fully dressed! lol
     
    twobob, TRoNDaNeflin and Teila like this.
  4. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Someday..
     
    hopeful likes this.
  5. TRoNDaNeflin

    TRoNDaNeflin

    Joined:
    Mar 26, 2014
    Posts:
    67
    Again, another awesome improvement! :) Multi UMAslots per INV item is indeed a very powerful feature. Thank you!
     
  6. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    And another one that's commonly requested :D

    Hit that button, select your type using the type picker (same as creating a new item), and your item will be converted :). All values will be copied, except of course those in the "Item specific" box, as they're, well specific to that item type :)
     
    TRoNDaNeflin and hopeful like this.
  7. Techips

    Techips

    Joined:
    Jun 9, 2013
    Posts:
    238
    Getting some errors with UMA Integration with setup wizard
     
  8. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    i have some mission scenes, without inventory manager ( i load it in first scene )
    in mission logic i have: public List<InventoryItemBase> lootForReward = new List<InventoryItemBase> ();
    but because the scene do not have manager i cannot add items event if i drag and drop the prefab items. is there a solution for this problem ?
     
  9. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    Hi - I had already tried the canvas group, it makes no difference. Let me rewind a bit. This was working fine in the first version of inv pro, I upgraded to 2.2, I followed your tutorial on upgrading.

    Straight after the upgrade, I noticed the tooltip was behind the inventory window, being hidden, it seems the order of the canvas items changed and now inventorywindow panel moves to last place. I always had the tooltip panel last, but now on hitting play, the order of the canvas dynamically changes (I instantiate characters using the myplayerspawner script).

    Moving the tooltip to last place makes no difference, hitting play moves the invwindow back to last. To get around this, I moved the tooltip panel to the last part of the inventorywindow ie a child of invwindow - it worked, the tooltip now is in front of the inv window as before - ( to be clear, even before moving tooltip into invwindow when it was behind, it still interrupted the moving of items when the tooltip disappeared.), I just wanted to give you the full background of the upgrade.

    I see on bitbucket you have an item 'Instantiation tutorials + demo scripts' - I wonder if this is just a weirdness of the spawner as it is now; it doesn't feel an elegant solution at the moment, so I look forward to you reworking this component. I am very far from having any type of working game, so I think I'll leave it and come back to it another time.

    Thanks

    update: - I just grabbed your entire demo 8 scene, hacked it around and merged it all into my own game scene, the issue is no longer there. hmm, never mind then, I'll redo everything again at some point, guess it was a big upgrade lots of changes, :)
     
    Last edited: Aug 26, 2015
    hopeful likes this.
  10. TimeCastle

    TimeCastle

    Joined:
    Jan 12, 2015
    Posts:
    32
    I'm trying to set the current position of my different weapons and I'm running into an error.

    InvalidOperationException: Operation is not valid due to the current state of the object
    System.Linq.Enumerable.First[InventoryItemRarity] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
    System.Linq.Enumerable.First[InventoryItemRarity] (IEnumerable`1 source, System.Func`2 predicate)
    Devdog.InventorySystem.Editors.InventoryItemBaseEditor.OnCustomInspectorGUI (Devdog.InventorySystem.Editors.CustomOverrideProperty[] extraOverride) (at Assets/InventorySystem/Scripts/Items/Editor/InventoryItemBaseEditor.cs:213)
    Devdog.InventorySystem.Editors.EquippableInventoryItemEditor.OnCustomInspectorGUI (Devdog.InventorySystem.Editors.CustomOverrideProperty[] extraOverride) (at Assets/InventorySystem/Scripts/Items/Editor/EquippableInventoryItemEditor.cs:132)
    Devdog.InventorySystem.Editors.InventoryEditorBase.OnInspectorGUI () (at Assets/InventorySystem/Scripts/Other/Editor/InventoryEditorBase.cs:33)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1162)
    UnityEditor.DockArea:OnGUI()

    The error pops up like 4 times each time I play the scene.
     
  11. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Going to need a bit more information than that please :) what errors exactly?
     
  12. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The reason the tooltip is falling behind the windows is because in version 2.2 I've added focusable windows. This feature is embedded in the DraggableWindow component and can of course be disabled. The reason this happens is because the UI is rendered based on the hierarchy (top to bottom), and the focusable windows move within that hierarchy to get on top.

    These windows have a max index ( the max hierarchy position, counting from the top ), limiting this will avoid windows from overlapping the InfoBox / tooltip.

    Another way to fix this would be to create an empty object and place all focusable windows inside this, that way they won't interfere with other UI elements.
     
    twobob likes this.
  13. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Hm.. I've been thinking about the current setup of the item databases as well, currently one has to be present in the scene, which can be rather annoying, plus things can get messy really quickly if you mix items between databases.

    So here's my question, do people use multiple databases in their setup, or would 1 already suffice?

    I could the developer to select a database once, and use it from thereon out (like setting a state using a editor pref). That way you'll select a database once, won't have to go through the "Select a database" every time you open the editor, and you'd be able to use it in scenes where there are no item managers available.

    Not sure if this is something worth implementing, it basically depends on how the databases are used.
     
  14. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The item you're trying to place has an undefined rarity set on it, you can fix this by creating a rarity in the editor and assigning it to the item. I've fixed this in the next version, not forcing you to assign a rarity.
     
  15. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,182
    Can you use additive scenes, and would that solve the problem?
     
  16. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    you could add database selection on the item list, when we click to add an item, it first provide list of database, we select one then select object. but yes one database is enough
     
  17. TimeCastle

    TimeCastle

    Joined:
    Jan 12, 2015
    Posts:
    32
    I was wondering if you have some way to change the animator of a parent game object, when specific weapons are attached. For example if you have 2 daggers, you want it to play a different animator then you would for a 2 handed sword.
     
  18. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    There isn't a build in solution for this, but the easiest way to handle this would be to override the Equippable item type and override the Equip and UnEquip methods. Then assign some extra behavior like swapping the animator controller.

    OR --
    You could also use the item's event such as OnEquipped and OnUnEquipped

    A thing to note, in the current version Equip / Unequip aren't called when an item is dragged as opposed to right clicked. This will be fixed in the upcoming version though (eta ~10 days)
     
  19. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    Hi, about saving currencies via easysave.

    you wrote:
    (A thing to note:
    Because of the new currency system currencies are no longer serialized (saved / loaded). This will be re-supported in a future update.)

    When is this going in, or is there another way to save the currency and reload it when back in game.

    Cheers
     
  20. TimeCastle

    TimeCastle

    Joined:
    Jan 12, 2015
    Posts:
    32
    Is there a way to manually define the slots on the skill bar?
    Like, i want there to be 3 spots, one for a rifle, one for a handgun, and one for a grenade, and I only want the player to be able to put the specific type of weapon in each spot. I also want to be able to chose where each spot is on my screen (not important though)
     
  21. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep sure you could, but perhaps it would make more sense to make the skillbar your equip collection? Instead of using the skillbar simply set the characterUI at the bottom of the screen and make it visible.

    If you want to do a skillbar that only accepts certain items in certain slots you'll have to write some custom code though :) You could do this by creating a custom wrapper or a custom collection.
     
  22. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Editor workflow Improvement
    Sick and tired of this lovely screen? Starting in the next version this will be removed and the selected database will be remembered automatically.


    To avoid mistakes you'll be warned when you're editing a different scene than is set in the current scene.


    So in short, if you're only using 1 database it's a 1 time configuration and you'll be done, if you're using multiple you can easily switch, just like before :)
     
    julianr, TRoNDaNeflin and hopeful like this.
  23. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    i encountered a nasty bug last night> in editor go to Items editor then Item category editor, delete one category, back to item list, crash. in fact of you delete one category that your item currently used it will crash all the editor.
     
  24. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Created an issue in bitbucket, consider it fixed for the next version :)
     
    julianr and hopeful like this.
  25. riquid

    riquid

    Joined:
    Mar 18, 2015
    Posts:
    20
    Maybe this is one of those things that is completely obvious to everyone but me however, I cannot seem to figure out how I access a certain blueprint in order to enable the blueprint via script. Got any hints for me?
     
  26. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    76
    Everytime I try to pick up some items, I get this message "inventory is full" but it's not full, what I'm I missing?
     
  27. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    lelon, your player need "InventoryPlayer.cs" then you need to add reference to the window you use.
     
  28. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    76
    Thank for the reply, I already have that setup and I still get the same notice message. hmm.
     
  29. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You can do so by grabbing a reference from the database.

    Code (CSharp):
    1. var blueprint = ItemManager.instance.craftingCategories.First(o => o.name == "myCategoryName").blueprints.First(o => o.ID == myBlueprintID);
    2.  
    3. blueprint.playerLearnedBlueprint = true;
    (Note that blueprints aren't currently serialized)
     
  30. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    76
    @jorisshh

    I have the inventory player scrip on my character and everything else as in the controller demo, but I still get "Inventory is full" message, and items are not picked up. What could be causing this? Thanks.
     
  31. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    76
    @jorisshh What does "Is shared collection" toggle box do? I have that on the inventory UI script. Thanks.
     
  32. vinurd

    vinurd

    Joined:
    Aug 27, 2015
    Posts:
    14
    all very nice and customizable, but without transferring to the global variables from the inventory into the playmaker he lies dormant. Really looking forward to the updates on the playmaker.Used the subject he passed the value to a global variable in playmaker. INT and Bool.
     
  33. CalaveraX

    CalaveraX

    Joined:
    Jul 11, 2013
    Posts:
    131
    [SOLVED]
    - i'm amazed with the amount of time i had lost for this..
    It was i've created the loot window and didnt overrided the item button prefab for the one item_loot....



    Somebody that uses this asset?

    I'm struggling since yesterday with this.

    I've created a Loot window, populated with some items with the basicGenerator

    Code (CSharp):
    1. BasicItemGenerator generator = new BasicItemGenerator();
    2. generator.SetItems(ItemManager.instance.items);
    3. lootItems = generator.Generate(2, 7);
    4. InventoryManager.instance.loot.SetItems(lootItems,true,true);
    I have my screen with my character inventory window opened, my loot window opened but i cant loot the items.
    if i drag them, i see the drag icon, but when droping it on my inventory nothing happens.

    also i added a "lootAll" button to the loot windows and i get a casting error

    Exception:
    InvalidCastException: Cannot cast from source type to destination type.

    Devdog.InventorySystem: LootUI.TakeAll()
    InventorySystem/Scripts/Modules/Looting/LootUI.cs: line 77


    I would Really appreciate any help with this

    Thanks in advance!
     
    Last edited: Sep 11, 2015
  34. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The Is shared collection shares the collection between all players. For example, if you have 2 players and each player has 1 inventory that's specifically for the player you disable the "Is shared collection". If you'd like to create 1 inventory for all players ( like a shared box ) you can enable the "Is shared collection".

    Also, if you get an error that the inventory is full even though you've set one up, make sure it's attached to the InventoryPlayer component on your player.
     
  35. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Better PlayMaker support is on it's way, including events, storing in temp variables and stats manipulation. ( More info at: http://hutonggames.com/playmakerforum/index.php?topic=11118.0 )
     
  36. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've added some checks to the LootUI so warnings are shown if an invalid wrapper type is used.
     
  37. CalaveraX

    CalaveraX

    Joined:
    Jul 11, 2013
    Posts:
    131
    Jorish, one quick question, i dragged the prefab of vendor window to my scene, linked it on the manager, and created UI button with the vendor trigger.

    Wich trigger or method should i call to show my vendor? i dont seem to get how to show a vendor screen.
    Thanks in advance!
     
  38. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    All screens can be shown by using the UIWindow / UIWindowInteractive actions. Simply call UIWindow.Show() or UIWindow.Hide or UIWindow.Toggle(). You can also call these methods using the Unity actions on a button (without writing code).
     
  39. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    little bug on interactive window, if we set first bool "hide on start" = false & "reset position on start" = true position is not reset
     
  40. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Fixed :)
     
  41. vinurd

    vinurd

    Joined:
    Aug 27, 2015
    Posts:
    14
    as an example of how to do it-I don't quite understand how
     
  42. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You can trigger windows using the UI buttons like so :)

    1. Create a button
    2. Add an OnClick() action
    3. Set an object that contains a UIWindow
    4. Go to -> UIWindowInteractive / UIWindow and select the method ( Toggle, Show or Hide )
     
  43. vinurd

    vinurd

    Joined:
    Aug 27, 2015
    Posts:
    14
    probably I incorrectly stated the idea. But with a cool button - also helped-thank you. I need for example: the hero drank the elixir and the value of this elixir was passed in a global variable of a playmaker. And in it I would create a conflict which takes this variable. I can't pass the values of the objects used in global playmaker.
     
  44. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The current playmaker integration is a bit clunky all actions work separately but can't really be used to send to other actions. I'm working on a better integration with events that will be available soon.

    I've also created several new actions to get / set / update the player's stats using PlayMaker actions, which should help out a lot as well.
     
    hopeful and twobob like this.
  45. vinurd

    vinurd

    Joined:
    Aug 27, 2015
    Posts:
    14

    is it possible for me to do now such as to make the fuel consumption of a ship and item fuel/ whatever while driving my ship's fuel ran out and I was able to fill it up? The movement of the vessel is carried out using playmaker
     
  46. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Not at the moment, but this is covered in the next version. Using the PlayMaker ChangeStat action you can reduce the stats either every frame or use delays to reduce at every interval. Any UI will auto. repaint :)
     
    TRoNDaNeflin likes this.
  47. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    224
    I may have completely missed this - if I have multiple "characters" in a game (each spawned via another script into the game world) each with a unique character equip window... What is best way to select which character I'm equipping, or viewing the stats of? I could have anywhere from one character to 20 or more. A character in my game is an individual unit which could be a space ship, a vehicle, a troop, or other various unit each with its own unique characteristics (and each will be controlled by its own AI or directly by player if selected).

    Is there an already created window that populates with each selectable "character", and if not, what would be best way to create one to best sync up with Inventory Pro?

    Another related question: does Inventory Pro store the list of live "currently instantiated" equipable characters, including the states of equipped item slots per character? So that changing scenes or leaving game and later re-starting game, all the characters have each slot remembered and equipped? Example: 3 characters - one has a sword equipped, one has a two-handed sword, and one has a bow. I leave the game, (in code trigger a "save player" function?), and then a day later I start the game again -those 3 characters are loaded and each of their individual equipment slots are reloaded and the equipment models are instantiated already in their last saved "hands"?

    Possibly a good topic for an intermediate or advanced tutorial? :)

    Loving this system! Once I delve deeper into this, and figure out best way to save the inventory, character list, and character respective equipped items, I plan to hook that into saving as CML data to save/load to a database on the web. I have already dabbled with storing data this way (CML data), and it works beautifully! Integrating it seamlessly with the above functionality using Inventory Pro will be the biggest hurdle but most important one for my game.

    Keep up the excellent work! I'm following this thread every chance I get, and the evolution of this asset is insanely cool! :)
     
  48. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The ItemManager actions handle the currently set (loot to) collections. When a player is assigned his collections ( inventory, skillbar & characterUI ) are assigned to the ItemManager.

    1. The player is created
    2. The player assigns itself to the ItemManager
    3. ItemManager grabs the player's collections and uses them for future actions ( AddItem, GetItemCount, etc )

    When you switch a player (more below), the previous player's collections are removed and the new player's collections are added. Hence, from that point on, all actions done in the ItemManager will reflect on the new player.

    To set the current player you can call InventoryPlayerManager.instance.currentPlayer = myPlayer; // myPlayer obviousyl being your player (anything that inherits from InventoryPlayer).

    Alright, that said to save each player (which should be possible in the next version, although I haven't tested it yet) you'd have to name each collection (CharacterUI) uniquely; Next assign a save / load component to it ( renewed in next version ). The save / load all data and refresh the stats once the items were equipped. Just make sure that the players are instantiated before the save / load finishes ( you can change the script execution order in Edit > Project settings > Script execution order ).

    And all of that, should do the trick :)
    ( The instantiated players are not saved, this is up to you to manage, the associated collections however, can be saved. )

    I've created a task at bitbucket to add a demo scene ( https://bitbucket.org/jjahuijbregts/inventorypro/issues/112/multi-player-demo-scene )
     
  49. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,182
    @jorisshh - I'm not entirely sure I followed that (above), but I look forward to the demo. :)

    I take it this would cover the Dungeons & Dragons type game situation where the player might be running multiple characters simultaneously in a turn-based scenario - like Tom the halfling thief, Sally the paladin, and Minsc the barbarian - each with their own separate weapons, stats, and inventory.
     
  50. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,148
    Hi Jorissh, so does this mean a new file/database or reference is created for each player so their items are stored unique to their name?

     
unityunity