Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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.9%
  2. Improved serialization / saving for web

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

    27.2%
  4. Controller support

    15.4%
  5. Unity 5.1 networking (multiplayer)

    37.0%
  6. More modular build to simplify extending

    25.2%
  7. UFPS Multiplayer (Asset integration)

    11.6%
  8. Core GameKit (Asset integration)

    4.1%
  9. Dialogue system (Asset integration)

    21.3%
  10. Wordpress integration (Asset integration)

    4.1%
Multiple votes are allowed.
  1. whatbus2000

    whatbus2000

    Joined:
    Nov 21, 2014
    Posts:
    65
    Great versatile product.
    Is there a way to make the lootable object receive items from the player (kind of like the bank except the object actually holds the information not the ui window). For example you open a chest and get a gun from it and you put a medical kit in it to get later.
     
  2. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,549
    This is great. Thanks for the Rewired integration. I know @guavaman will like this too.
     
    jorisshh likes this.
  3. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Sure, the bank uses a 'global' collection, so all banks will have the same items in it (as they all share the same collection). Lootable objects like chests on the other hand store their items inside the object (the chest in this case). For the loot window, the only thing stopping you from adding items is the window itself.

    I've added a demo script for this a while back called the "MyCustomCollectionTriggerer", which you can use to create what you're looking for :) - Note that you'll probably want to create your own window for this, as the loot window doesn't support placing items into it. The MyCustomCollectionTriggerer copies the items from the object into the window collection and saves them back once the window is closed / switched to another MyCustomCollectionTriggerer.
     
  4. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
  5. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Never actually got to it. Does it have high priority for you? I can look into it if you like :) - If you're not in a rush I'm sure I can keep myself busy with the quest / dialogue system
     
  6. jf3000

    jf3000

    Joined:
    Dec 31, 2013
    Posts:
    166
    Code (CSharp):
    1. You are trying to load data from a www stream which had the following error when downloading.
    2. <url> malformed
    3. UnityEngine.WWW:get_texture()
    4. Devdog.InventorySystem.UI.Editors.SciFiDesignGettingStarted:ParseProductInfo(String) (at Assets/InventoryProSciFiDesign/FirstVersion/Scripts/Editor/SciFiDesignGettingStarted.cs:183)
    5. Devdog.InventorySystem.UI.Editors.SciFiDesignGettingStarted:GetProducts() (at Assets/InventoryProSciFiDesign/FirstVersion/Scripts/Editor/SciFiDesignGettingStarted.cs:168)
    6. Devdog.InventorySystem.UI.Editors.SciFiDesignGettingStarted:.cctor() (at Assets/InventoryProSciFiDesign/FirstVersion/Scripts/Editor/SciFiDesignGettingStarted.cs:131)
    7. UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])
    Code (csharp):
    1.  
    2. You are trying to load data from a www stream which had the following error when downloading.
    3. <url> malformed
    4. UnityEngine.WWW:get_texture()
    5. Devdog.InventorySystem.Editors.InventoryProGettingStarted:ParseProductInfo(String) (at Assets/InventorySystem/Scripts/Managers/Editor/InventoryProGettingStarted.cs:181)
    6. Devdog.InventorySystem.Editors.InventoryProGettingStarted:GetProducts() (at Assets/InventorySystem/Scripts/Managers/Editor/InventoryProGettingStarted.cs:166)
    7. Devdog.InventorySystem.Editors.InventoryProGettingStarted:.cctor() (at Assets/InventorySystem/Scripts/Managers/Editor/InventoryProGettingStarted.cs:129)
    8. UnityEditor.EditorAssemblies:SetLoadedEditorAssemblies(Assembly[])
     
    Last edited: May 20, 2016
  7. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Should be all fixed now (if you restart Unity). Redirected the old website to the new site, and so the assets tried to contact the old website. It grabs some info / links to the documentation, that's it :)
     
    hopeful and jf3000 like this.
  8. MegaUltimateHD

    MegaUltimateHD

    Joined:
    Jul 1, 2014
    Posts:
    4
    Hello, I love your asset just a recommendation your video tutorials aren't that easy to follow you move very fast but in saying that your written documentation is very good and easy to understand. I have a question is there a way to save player items for a multiplayer game. I was thinking saving to an XML file (or something like that) locally and then opening that file in a way that doesn't affect other players. I'm only 13 so my idea may sound a bit out there so I'm open to your ideas.
     
    hopeful likes this.
  9. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    Yeah, this is the last step for my inventory system and weapon handling so the sooner I can get it in place, the better. I am hoping to start showing the game soon and would like to display everything you can do in the game. You might be able to just email the UFPS guys and work with them on it. That way you are not having to go out of your way researching their code more than you already have. ;)

    Thanks again for the help.
     
  10. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You can serialize entire collections to JSON if you'd like. There's a built-in component that does this for you on start and game end, but you can of course call it whenever you'd like and network this :) - Have a look at the Saving & Loading demo scene, it's all set up in there.
     
    hopeful and MegaUltimateHD like this.
  11. jf3000

    jf3000

    Joined:
    Dec 31, 2013
    Posts:
    166
    Still getting an error:

    Code (CSharp):
    1. ArgumentNullException: Argument cannot be null.
    2. Parameter name: source
    3. System.Linq.Check.SourceAndPredicate (System.Object source, System.Object predicate)
    4. System.Linq.Enumerable.Any[InventoryItemPropertyLookup] (IEnumerable`1 source, System.Func`2 predicate)
    5. Devdog.InventorySystem.Editors.InventoryProSetupWizard.<CheckDatabase>m__74 (Devdog.InventorySystem.InventoryItemBase o) (at Assets/InventorySystem/Scripts/Managers/Editor/InventoryProSetupWizard.cs:224)
    6. System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[Devdog.InventorySystem.InventoryItemBase].MoveNext ()
    7. System.Collections.Generic.List`1[Devdog.InventorySystem.InventoryItemBase].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
    8. System.Collections.Generic.List`1[Devdog.InventorySystem.InventoryItemBase]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
    9. System.Linq.Enumerable.ToArray[InventoryItemBase] (IEnumerable`1 source)
    10. Devdog.InventorySystem.Editors.InventoryProSetupWizard.CheckDatabase () (at Assets/InventorySystem/Scripts/Managers/Editor/InventoryProSetupWizard.cs:224)
    11. Devdog.InventorySystem.Editors.InventoryProSetupWizard.CheckScene () (at Assets/InventorySystem/Scripts/Managers/Editor/InventoryProSetupWizard.cs:121)
    12. Devdog.InventorySystem.Editors.InventoryProSetupWizard.DidReloadScripts () (at Assets/InventorySystem/Scripts/Managers/Editor/InventoryProSetupWizard.cs:113)
     
  12. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    This is caused due to an empty object in the item editor. If you double click the error it should open your IDE at line 224 of file InventoryProSetupWizard. If you replace line 224 with the following it will fix your issue:


    var itemsWithEmptyProperty = db.items.Where(o => o != null && o.properties != null && o.properties.Any(s => s != null && s.property == null)).ToArray();

    (Just replace the entire line).
     
  13. jf3000

    jf3000

    Joined:
    Dec 31, 2013
    Posts:
    166
    Doesn't matter I deleted the asset, keeps coming up with errors, plus whats the go with contacting home, I got the same error above when I went offline briefly. Nice asset, but will try once the error have been improved. Thanks. Good Luck.
     
  14. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    @jorisshh , I'm following you upgrade video to move to the latest release of the inventory asset. After importing the asset into a new temp project I'm facing some errors:
    Code (CSharp):
    1. - get_gameObject is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'CraftingWindowStandardUI' on game object 'CraftingWindowStandard'.
    2. - get_gameObject is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'VendorUIBuyBack' on game object 'PageBuyBack'.
    3. - get_gameObject is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'SkillbarUI' on game object 'Skillbar'
    4. - get_transform is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'InfoBoxUI' on game object 'InfoBox'.
    5. - get_isActiveAndEnabled is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'CharacterUI' on game object 'CharacterWindow'.
    6. - get_gameObject is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'InventorySettingsManager' on game object '_Managers'.
    7. - get_gameObject is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'LootUI' on game object 'LootWindow'.
    8. See "Script Serialization" page in the Unity Manual for further details.
    9. UnityEngine.UI.Graphic:OnRectTransformDimensionsChange()
    10.  
    Note that I'm using the beta 17 of Unity 5.4. Anything I can do to proceed with the upgrade?
     
  15. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Hm.. it might help to update to Beta 18. In the beta 18 release notes it says that some serialization issues have been resolved and that certain errors are no longer called.

    • Scripting: Script serialization errors are no longer triggered during serialization (saving).

    The first error claims the CraftingWindowStandardUI calls CraftingWindowStandard from a constructor, however it doesn't even have a constructor, so I'm guessing it's a bug in the beta :)
     
  16. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Updating to beta 18 did indeed solve the errors, I was able to upgrade my project to beta 18 and the new inventorysystem. Thanks.
     
    jorisshh likes this.
  17. MegaUltimateHD

    MegaUltimateHD

    Joined:
    Jul 1, 2014
    Posts:
    4
    Hello again, looked at the save load scene, all good with that. anyway, I edited the Instantiate script with Photon Unity Networking implemented into it. Instead of assigning it on the spawn spot I put it on a scripts prefab I have in the scene. I'm still working on some things but this is what I have so far ;). if you see something that I didn't please let me know.
    Code (CSharp):
    1. using System.Collections.Generic;
    2. using System.Collections;
    3. using System.Linq;
    4. using System.Text;
    5. using Devdog.InventorySystem.Models;
    6. using UnityEngine;
    7. using UnityEngine.Assertions;
    8. using UnityEngine.Serialization;
    9.  
    10. namespace Devdog.InventorySystem
    11. {
    12.     [HelpURL("http://devdog.nl/documentation/player-spawner/")]
    13.     [AddComponentMenu("InventorySystem/Player/Inventory Player spawner")]
    14.     public class InventoryPlayerSpawner : InventoryPlayerBase
    15.     {
    16.  
    17.         [InventoryRequired]
    18.         public GameObject playerPrefab;
    19.  
    20.         public bool spawnOnAwake = true;
    21.         public bool dontDestroyPlayerOnLoad = true;
    22.         public bool movePlayerToSpawnPosition = true;
    23.         public bool overrideEquipLocations = true;
    24.         public bool overridePlayerCollections = true;
    25.         public bool playerSpawn;
    26.         public GameObject standbyCamera;
    27.  
    28.         //SpawnSpots
    29.         SpawnSpot[] spawnSpots;
    30.  
    31.         /// <summary>
    32.         /// When a character is already found in the scene, should spawning be aborted?
    33.         /// </summary>
    34.         public bool forceSingleCharacter = true;
    35.  
    36.         void Start () {
    37.             spawnSpots = GameObject.FindObjectsOfType<SpawnSpot>();
    38.  
    39.         }
    40.  
    41.         protected override void Awake()
    42.         {
    43.             base.Awake();
    44.          
    45.             if (spawnOnAwake)
    46.             {
    47.                 Spawn();
    48.             }
    49.         }
    50.  
    51.         public void Spawn()
    52.         {
    53.             if(playerSpawn == true){
    54.                 if(spawnSpots == null){
    55.                     Debug.LogError ("No Spawn Spots");
    56.                     return;
    57.                 }
    58.                 SpawnSpot mySpawnSpot = spawnSpots[ Random.Range (0, spawnSpots.Length) ];
    59.  
    60.                 var playerObj =  (GameObject)PhotonNetwork.Instantiate("PlayerMinifig",
    61.                     mySpawnSpot.transform.position,
    62.                     mySpawnSpot.transform.rotation, 0);
    63.            
    64.                 standbyCamera.SetActive(false);
    65.  
    66.                 var player = playerObj.GetComponentInChildren<InventoryPlayer>();
    67.                 if (dontDestroyPlayerOnLoad)
    68.                 {
    69.                     DontDestroyOnLoad(playerObj);
    70.                 }
    71.                 var foundPlayer = FindObjectOfType<InventoryPlayer>();
    72.                 if (forceSingleCharacter && foundPlayer != null)
    73.                 {
    74.                     //Debug.Log("Inventory Pro player already found in scene, enforcing singel player.");
    75.                     if (foundPlayer.isInitialized == false)
    76.                     {
    77.                         foundPlayer.Init();
    78.                     }
    79.  
    80.                     if (movePlayerToSpawnPosition)
    81.                     {
    82.                         foundPlayer.transform.position = transform.position;
    83.                     }
    84.                     return;
    85.                 }
    86.  
    87.  
    88.                 player.transform.root.gameObject.name = playerPrefab.name;
    89.                 player.transform.position = transform.position;
    90.                 player.transform.rotation = transform.rotation;
    91.  
    92.                 if (overridePlayerCollections)
    93.                 {
    94.                     player.characterCollection = this.characterCollection;
    95.                     player.inventoryCollections = this.inventoryCollections;
    96.                     player.skillbarCollection = this.skillbarCollection;
    97.                 }
    98.                 if (overrideEquipLocations)
    99.                 {
    100.                     player.equipLocations = this.equipLocations;
    101.                 }
    102.  
    103.                 player.Init();
    104.  
    105.                 transform.DetachChildren();
    106.          
    107.             }
    108.         }
    109.     }
    110. }
    111.  
     
    jorisshh and hopeful like this.
  18. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Looks pretty good to me :D

    I know networking is a commonly requested feature so I've built the quest system with networking in mind (not networked yet, but easy to add in later), and I'll start playing with some networking for Inventory Pro as well. The major problem is just, making Inventory Pro client authoritative would be a 'breeze' (as much as writing network code can be a breeze :p) and likely 'good enough' for 99% of the games. Server authoritative would be a whole other story, considering the wide range of components in Inventory Pro and would make development of new components rather complicated as well (+ change the project structure for local only projects).
     
    hopeful likes this.
  19. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Hi @jorisshh, I'm afraid I jumped to conclusion stating beta 18 was fixing the following errors:

    Code (CSharp):
    1. - 5 times : UnityException: get_gameObject is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'SkillbarUI' on game object 'Skillbar'.
    2. See "Script Serialization" page in the Unity Manual for further details.
    3. UnityEngine.UI.Graphic.OnRectTransformDimensionsChange () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:124)
    4. UnityEditor.DockArea:OnGUI()
    5. - 2 times : UnityException: GetComponentFastPath is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'SkillbarUI' on game object 'Skillbar'.
    6. See "Script Serialization" page in the Unity Manual for further details.
    7. UnityEngine.Component.GetComponent[Graphic] () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineComponentBindings.gen.cs:48)
    8. UnityEngine.UI.BaseMeshEffect.get_graphic () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/VertexModifiers/BaseMeshEffect.cs:25)
    9. UnityEngine.UI.BaseMeshEffect.OnValidate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/VertexModifiers/BaseMeshEffect.cs:56)
    10. UnityEngine.UI.Shadow.OnValidate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/VertexModifiers/Shadow.cs:27)
    11. UnityEditor.DockArea:OnGUI()
    12.  
    Whenever I open a demo scene in the temp solution (I'm trying to check-out the rewired integration by opening the delivered demo scene) I'm facing those errors and can't run the demo.

    - Windows 10 Pro with Unity 5.4 beta 18
     
  20. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Can you also check your code in the RewiredInputManager.cs class please?
    This line is throwing an error:
    Code (CSharp):
    1. InventoryInputManager.instance.objectTriggererItemInputOverrider = new RewriredInputOverrider(player, rewiredActionName);
    Tried to rename it to RewiredInputOverrider by getting no love back. Still trying to figure it out.
    (Seems like the actual RewiredInputOverrider isn't part of the package.)
     
  21. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Fairly certain this is a Unity beta error. I've just downloaded beta 19 and it has the same issue. Take for example the following error:

    get_gameObject is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'SkillbarUI' on game object 'Skillbar'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEngine.UI.Graphic:OnRectTransformDimensionsChange()

    Which is called from UnityEngine.UI.Graphic:OnRectTransformDimensionsChange -> Which is of course an internal Unity call. I'd suggest sticking with Unity stable while developing products. The beta's change so often that I can't make Inventory Pro fully compatible with it.
     
  22. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Strange thing it doesn't happen in the actual production project only in the temp project I created to update to the latest version. (I didn't copy the demo's to the production solution though).
    Can you please also have a look at the Rewired integration issue I mentioned above?
     
  23. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've Imported Inventory pro & Rewired into a new project (Unity 5.4 beta 19) and everything compiles and appears to work fine. You could try updating to beta 19.
     
  24. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Did you remove the Rewired compiler condition in the RewiredInputManager.cs? As you may note when you check that component in the unity explorer there will be a message the component can't be displayed due to a compiler issue (which isn't visible in the unity console).
    Removing the conditional compile reveals a typo (RewriredInputOverrider) but actually no overrider class is available in the package (only the reference to the Interface).
     
  25. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Didn't have to remove anything, it compiled just like it was supposed to. I've renamed the typo, but it compiled just fine to begin with. The input overrider file should be in: Assets/InventorySystem/Scripts/Integration/Rewired/
     
  26. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Ok, found the source of my Rewired integration problem: to test those unity get_gameobject errors I completely removed Inventory Pro and reinstalled. Opened the rewired demo scene and pressed play. Forgot to select the Rewired Integration in the menu though. Sorry for the inconvience I've caused.
     
  27. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    No worries, glad you got it working :)
     
  28. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
    Hi,

    Thank you for this great asset.

    I imported it to my unity 5.3.5f1 project. I created the _Managers object, adding a newly created lang and item database. When I open the Main manager I get this error repeatedly and I cannot close the window.

    upload_2016-5-30_1-48-2.png

    Any help is greatly appreciated.
     
  29. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Hm.. strange error. I've made some changes to the main editor (see attachment), hopefully this will fix the issue. Paste the file in "Assets\InventorySystem\Scripts\Managers\Editor" and override the already existing file.

    Please let me know if this does / does not fix it...
     

    Attached Files:

  30. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
    Yes it is fixed now!
    Thank you!
     
  31. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
    An error when I run the setup wizard.
     
  32. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    This should've been fixed in V2.4.2, are you still on 2.4.1 by any chance?
     
  33. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
    I think I was on the latest version. Anyway, I deleted the InventorySystem folder and reimported from the asset store, and now it is working.
     
    jorisshh likes this.
  34. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    A little heads up. Inventory Pro's price is going to be increased to $65 in a few days. So If you're considering purchasing it, now might be a good time :)
     
    Tinjaw likes this.
  35. traderain

    traderain

    Joined:
    Jul 7, 2014
    Posts:
    108
    Dear @jorisshh ,
    Thank you for your amazing work with the inventory system. It supplies everything I need but one thing.
    Is there any chance for a feature that would allow an item to take up multiple slots?(eg.: Diablo 3,Deus ex:Human revolution)
     
    jorisshh likes this.
  36. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You already can :D - In the item editor you can specify the item's size.


    Don't forget to add a 'relative layout' group to your container to visualize the items correctly :)
     
    traderain likes this.
  37. traderain

    traderain

    Joined:
    Jul 7, 2014
    Posts:
    108
    OOOOOOOOOOh that's beatufull. How did I miss that? Thank you for the reply.
     
    jorisshh likes this.
  38. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
    Hi,

    Is there a tutorial or guide on how to create a shop or merchant.

    Any help is greatly appreciated.
     
  39. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    416
    Hi! I'm more of a designer/artist, not a programmer, so I've been eyeing this asset for a while, and it looks great... but, can I make old school RPG vertical list inventories with it? Like the kind they still use in games like Persona 3-4 or most of the tales JRPG games? I ask because all the example images/videos I've seen are more suited for American RPGs (where you click an item to see its info, or double click to use)... also I've noticed most inventories in the asset store are build with mouse and keyboard in mind... but I'm going full gamepad (or keyboard only). I've already had some issues with some inventories whose highlighted item needs to be clicked once to display the Description/image. But I want the highlighted item to show it's info/image automatically (in a separate panel) as long as it's highlighted. Also, I'd like to use Tabbed Categories (like in the example image below). Can I do all that with Inventory Pro?

    By the way, here's an image of the type of inventory I mean:

     
  40. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
  41. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Most of this you can do right out of the box :)

    All items are shown using 'wrappers' these are the visual representation of the item. The wrappers are prefabs containing Unity UI elements, so they can be shown any way you'd like. So yes, also in a list :) (Using a vertical layout group + a wide item should do the trick)

    Quick example:


    The Info box (tooltip) which shows the items info on hover can also be positioned somewhere 'static'. Showing info on select is only build into the sci-fi UI design. But I don't mind sharing the script, just let me know. (The sci-fi ui also shows a 3D render as a preview of the item; Something you see a lot in JRPG's like monster hunter as well).


    Inventory Pro uses Unity UI's system, which does allow keyboard / controller input; However, I would suggest using an input system like Rewired (one I can really recommend), as it allows for far more control and makes swapping controller / keyboard / mouse input so, so much easier. Inventory Pro supports Rewired of course :)
     
  42. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    416
    Alright, I'll be giving it a try (I do use rewired too). It would really be awfully nice of you if you can share the script for that feature. Really, I don't think the inventory I have in mind would be the same without that functionality...
     
  43. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Sure thing, here you go :) (see attachment).

    You can attach the script to any object (don't create multiple instances of the script, just attach it to a single object).

    It then gives you access to 2 events:
    On current wrapper changed ( a new wrapper a.k.a. slot is selected)
    On current wrapper item cahnged ( a new wrapper is selected, but this returns the item inside the wrapper, useful for the infobox ).

    Then just reference the InfoBox's HandleInfoBox method, and voila :)
     

    Attached Files:

    hopeful, 99thmonkey and Alverik like this.
  44. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
  45. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
    Hi,

    I cannot add Inventory Window to the Inventory Manager, because Inventory Manager seems to not have a slot for inventory window in the latest version.

    I want to add to the player gold coins at startup, so I am using this code inspired from dialog system lua integration file.

    Code (CSharp):
    1. private static InventoryCurrency GetCurrencyFromID(string currencyName)
    2.     {
    3.         int itemID;
    4.         bool isItemID = int.TryParse(currencyName, out itemID);
    5.         if (isItemID)
    6.             return ItemManager.database.currencies.FirstOrDefault(o => o.ID == itemID);
    7.  
    8.         // Find by name
    9.         return ItemManager.database.currencies.FirstOrDefault(o => o.singleName == currencyName || o.pluralName == currencyName);
    10.     }
    11.  
    12. InventoryManager.AddCurrency(GetCurrencyFromID("Gold").ID, (uint)100);
    But I get this error, I guess because there is no inventory window collection connection.

    Any help is greatly appreciated.
     
  46. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    In the last version of Inventory Pro the inventory collections have to be assigned to the player. Your player has an InventoryPlayer component. On this component you can define which collections belong to that player.

    Make sure to add your inventory to this list, and that can Contain currencies is checked in the restrictions (at the bottom of the collection's settings)
     
  47. ScottSummers

    ScottSummers

    Joined:
    Jul 12, 2015
    Posts:
    27
    I'm really enjoying the asset. Thanks!

    1. Is it possible to create items in the item database by script (drawing from a spreadsheet)? (I'm thinking mainly about localization.)

    2. Is it possible to trigger multiple vendors at once?
    I'm trying to drag and drop items onto UI objects, and then cause item effects on that object. Small vendor windows with drag accepters seemed the most straight forward example for how to do that.
     
  48. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    1. Certainly possible, do make sure you've set the ItemManager.database.items before serialization (which loads items into the collections). Note that items are prefabs, which in turn are just gameObjects. So, if you wanted to load items from a spreadsheet you'd have to read the excel sheet, parse it, create the items at runtime and set the min the ItemManager.database.items; If you want to do this at editor time (load all items in from an excel sheet before building your game) you'd have to create prefabs to retain the items.

    2. There's only 1 vendor window, so you can't show it 2 times. You could of course duplicate the window; Using a window sync component you can show the 2nd window whenever the first is shown and hide it whenever the 1st is hidden.

    Note that the 2nd window won't be operational like the first window; Items are loaded into the vendor UI window when it's shown; Using 2 windows won't load the items into both windows, you'd have to write a custom script to do this.

    I presume you want to show a 2nd window next to the vendor window for the user to drag items into, or completely separate?
     
  49. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
    Thank you. I did this and it seems to work.
    However, now I have to attach Inventory player ranger helper component. But my game is not a game with player moving, rather it is more of a click RPG. I have a merchant that I call triggerer.Use(); directly on it on a certain circumstances.
    It used to work but now because I have a player with range and the player and merchant objects are not really attached to a graphic with position, it does not work.
    How can I disable range check?
     
  50. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    392
    I did that but still I get this message