Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Our response to Improbable’s blog post (and why you can keep working on your SpatialOS game). Read more here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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.7%
  2. Improved serialization / saving for web

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

    27.1%
  4. Controller support

    14.8%
  5. Unity 5.1 networking (multiplayer)

    38.1%
  6. More modular build to simplify extending

    24.4%
  7. UFPS Multiplayer (Asset integration)

    11.8%
  8. Core GameKit (Asset integration)

    4.1%
  9. Dialogue system (Asset integration)

    21.6%
  10. Wordpress integration (Asset integration)

    4.4%
Multiple votes are allowed.
  1. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Probably a couple of weeks at the least. I'll be going on vacation starting tomorrow, so my time will be very limited. I know a lot of people would love to see this integration, so I'll prioritize it for when I get back :)
     
    wood333 and julianr like this.
  2. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,061
    Awesome thanks! Have a great vacation.
     
    jorisshh likes this.
  3. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    513
    Hi, Sorry if this has been already asked... I'm wondering if there is a way I can not have to equip ammo for each weapon, wondering if its possible to use the ammo from the inventory instead...
    This is for UFPS :D

    Thank you
     
  4. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,061
    Are you back yet ? ;)
     
  5. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    There's no built-in solution, but you could use the OnAddedItem and OnRemovedItem events to sync them to UFPS.

    Not even close :oops: Backpacking through Asia for 3 months; I'll be back by the end of July (currently in Cambodia)
     
    llJIMBOBll, julianr and TeagansDad like this.
  6. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Hello,

    I'd like to request a way to turn items by 90° in inventory manually as well as automatically if necessary when picking up a item if that's possible to add somehow. For example search for Deus Ex inventory. That way the inventory would be allowed to hold more items and use it's space efficiently if you for example have a 5x5 inventory and 3 items with 2x3 normally you would only be able to hold 2 items but with making that possible 3 would fit in the inventory.

    Thank you :)
     
  7. YCE2010

    YCE2010

    Joined:
    Jan 23, 2013
    Posts:
    25
    Hello
    I´m using Third Person Motion Controller by ootii integrated with InventoryPro. I was using for the integration a package named MC_InventoryPro that works well. Now with new version of InventoryPro that package don´t works and I´m trying to integrate them making a new package. The author of MC_InventoryPro to handles the equipment use ItemChildEquipmentHandler class. In the documentation I saw that this class is used to create custom equipment handler. Now the new version of InventoryPro don´t has that class and I don´t found in the documentation how handle the Equipment (Equip and UnEquip) with new version of InventoryPro to create the package.
    Best regards
     
  8. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    202
    The remove Action for Playmaker, all 3 remove Aktions will not work.
     
  9. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    39
    Sorry if this has been asked before, but I just imported Inventory Pro into a completely clean project using Unity 5.6.0f3 and the demo scene (8.AllDone) does not work. I can only pick up fruits No weapons and once in awhile if it does pick up something other than fruit it does not show in the Inventory window. Everything is default NOTHING else in the project other than inventory pro. The weird part is that the (instantiatedPlayer) demo scene seems to work fine and can pick up all items as well as see them in the inventory. Does anyone have any suggestions on what may be wrong in the 8.AllDone demo scene that I may be missing?
    Thank you very much in advance for any suggestions and help.
     
  10. lorddanger

    lorddanger

    Joined:
    Aug 8, 2015
    Posts:
    52
    Hello,
    I am new here is it possible to populate the inventory from DB like In MMORPG and also is it possible to change the UI
     
  11. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    529
    I dropped in a lightweight menu creation program - Easy Menu - system, to a project with Inventory Pro in the assets, but not implemented, and got these errors. Can you suggest where the conflict may lie? Errors General Relevancy.JPG
     
    Last edited: Jun 8, 2017
  12. whatbus2000

    whatbus2000

    Joined:
    Nov 21, 2014
    Posts:
    51
    Anyone help with an issue I am having.
    ItemTriggerUFPS.cs(32,39): not all code paths return a value

    I have clean project with UFPS installed first and then Inventory pro

    I have added [return null;] at the end of the function which fixes the error but I don't know what this does or why the error is there in the first place.
     
    Last edited: Jun 2, 2017
  13. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    290
    Does it support exce/jsonl import? You had said that there was a plan in the future
     
  14. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
  15. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Yes and yes;

    To populate the database yourself make sure you do this before the initialization of the rest of the system (before deserialization). Or, if you're using your own deserialization you can do this later.

    Yes, you can change the UI to anything you like it to be. For example, the sci-fi design uses the underlying types, just like the demo interface. Additional code can be written to make your own UI more flexible, add animations, etc.
     
    lorddanger likes this.
  16. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Please refer to the code at: http://forum.devdog.io/viewtopic.php?f=24&t=1835&start=20#p7930
    This is a bug that will be addressed in a future update.
     
  17. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Inventory Pro does not support XML/JSON import, however, this would be fairly trivial to create yourself if you'd feel so inclined. The items, are prefabs and linked to the database, so you can deserialize your own JSON / XML and create prefabs accordingly.
     
  18. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    105
    Hello.
    I have a question
    Inventor pro and Quest System Pro works with ICECreatureControlor or integration is needed. If so, is there such integration in the plan?
    Sorry if you already asked, the search gave nothing.
    Thank you.
     
  19. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    What kind of integration would you be looking for? You can use the quest OnDestroyed trigger for monsters / creatures and you could use write a tiny little script to enable the LootableObject when a monster dies; These are the only 2 connections that come to mind.
     
  20. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    105
    thanks a lot for the answer. I dont have these assets, I plan to buy them. also I ask a question of possible problems. it is very good that it is together easy to use them. thanks.
     
    jorisshh likes this.
  21. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,207
    It looks like your video tutorial is out of date or something is wrong. If I follow the Easy Setup steps, when I run the Check Issues function, mine shows a bunch of issues whereas the video tutorial shows no issues. Yet I did exactlywhat the video tutorial said to do. Here is what I get:

    upload_2017-6-24_13-42-12.png
     
  22. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,207
    I can't get the startup window to go away in Unity 5.6.2. Every time I run the game in editor the window pops up. There is a checkbox to turn it off, but you can see that the UI is messed up and if I try to click it, it just opens up the Integrations window.

    upload_2017-7-1_11-12-14.png
     
    jorisshh likes this.
  23. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Thanks for letting me know, I'll be looking into this.
     
    magique likes this.
  24. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    If you open settings window it correctly hides open windows like inventory but it doesn't prevent you from using keys to open up the other windows again. Anything I missed about this ?
     
  25. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Correct; This is the 'intended' behavior. Right now no other windows are blocked, but this could be added easily by avoiding the event propagation in the input handlers, or by just disabling the input handlers of the windows.

    I'll see if I can add this to the next version of Inventory Pro; It could be useful for other people also :)
     
    TeagansDad likes this.
  26. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Ah ok thanks. Well I would have expected it to get blocked but not block every other window if something is needed of course. ^^ Hmmh. Maybe it would make sense to have some additional checkbox for those windows as well where you can set if that windows can open when in Settings Menu already ? Would just be good to have an example what's a good way to solve this without loosing other funcionality.
     
  27. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Right now the UIWindow class has no dependency on Inventory Pro at all (it's used in various Devdog products). So adding a direct dependency on the settings window is a bit of a no-go. It could, however, work the other way around. The settings window could disable the input on some windows and re-enable them if needed.

    Another option would be to create a small input handler that wraps the Unity input system and allows the consumption of input events. That way we could prevent them from propagating to the other windows. I was hoping to use the new Unity input system for this; But it hasn't been released yet.

    For now I think the disabling of other windows is the easiest and most suitable option (also a 1 way dependency from the settings menu to the other windows). I'll see if I can squeeze this one into the next update :)
     
  28. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Thanks for the infos. Guess I better ask before I start disabling and activating windows. Having this done in some of the next updates is of course even better.
     
  29. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Got another question. Can the stats of an item be changed at runtime as well. Like having item durability or add some additional damage type for example flaming damage, from a spell. If that's possible is there some example somewhere and if not can you add that funcionality in future update ? :)
     
  30. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    120
    @jorisshh I'm integrating Inventory Pro into my game. I'm impressed by the rich functionality if offers, although there is a lot to learn. The first thing I'm trying to learn is how to integrate Inventory Pro with Rewired. I know Inventory Pro has a Rewired integration, but I could find no documentation describing how to integrate the two assets. I saw two demo scenes for the integration, but they're broken with missing prefabs.

    Which scripts do I need to attach to which objects? Which settings do I need to change? Thank you for your help.
     
  31. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    This isn't part of the core at the moment, but would be simple to add. Right now the damage system is just a list of stat mutations; You could create a new item type, attach your damage type (some class of your own), and modify the stats of your item based on the damage type; such as fire. Does that make sense?
     
  32. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Did you enable the integration in the integrations wizard? Please see: http://devdog.io/unity-assets/inventory-pro/documentation/2.5p/integrations/integrations-general - Once enabled you may have to reimport the Assets/Devdog folder, due to a unity bug not recompiling correctly after changing comiple directives.
     
    Dwight_Everhart likes this.
  33. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    120
    Yes, I enabled the integration. That was one of the first things I did. I did not reimport, however. I will give that a shot. Thanks.

    Is there any documentation for the integration, or are the demo scenes the documentation?
     
  34. Azarock35

    Azarock35

    Joined:
    Nov 20, 2012
    Posts:
    12
    Please add PLUGIN/Addon for
    Third Person Controller - Melee Combat Template !.....
     
  35. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    306
    @jorisshh i just imported Inventory Pro in my project. I get an error "Assets/Devdog/InventoryPro/Scripts/Modules/Crafting/CraftingWindowBase.cs(13,6): error CS1614: `HelpURL' is ambiguous between `HelpURL' and `HelpURLAttribute'. Use either `@HelpURL' or `HelpURLAttribute'"
    (Unity 2017.1.0f1)
     
  36. Dwight_Everhart

    Dwight_Everhart

    Joined:
    May 11, 2014
    Posts:
    120
    I re-imported into a new project, and the demos worked. No more missing prefabs. But I'm still unclear about how to integrate with Rewired. The Rewired demos don't respond to key presses, only to clicks. So I'm not sure they're working correctly. Having some documentation on which components to apply to which objects would be very helpful.
     
  37. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    513
    Added so you can craft using fuel system

    The way this works is it will enable a bool if you have fuel, and with the bool you can enable the craft button.

    The fuel script will remove the fuel item you selected over time (fuelBurnTime) and also add a new item from the depleted fuel (e.g.. burning wood as fuel could give you charcol back)

    You can also add particle fx and audio easily.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Devdog.General;
    5. using Devdog.InventoryPro;
    6.  
    7. public class Jims_CraftWithFuel : MonoBehaviour
    8. {
    9.    //Item to be used as a Fuel
    10.    public InventoryItemBase fuelItem = null;
    11.    //e.g.. If wood if the fuel than charcol would be the depleted item
    12.    public InventoryItemBase fuelDepletedItem = null;
    13.    //Collection belongs to
    14.    public ItemCollectionBase m_Collection = null;
    15.  
    16.    //Temp list to store the total amount of fuel
    17.    //[HideInInspector]
    18.    public int m_fuelItemAmount;
    19.  
    20.    //Time 1 fuel item lasts for
    21.    public float fuelBurnTime = 10f;
    22.    private float m_fuelBurnTime;
    23.  
    24.    //If we have fuel then CanCraft = true; //This will be moved to the Crafting Window UI once its working
    25.    [HideInInspector]
    26.    public bool CanCraft = false;
    27.  
    28.  
    29.    protected void Awake ()
    30.    {
    31.       m_fuelBurnTime = fuelBurnTime;
    32.    }
    33.  
    34.    protected void Update ()
    35.    {
    36.       //Check to see if the collection has fuel
    37.       m_fuelItemAmount = m_Collection.FindAll (fuelItem.ID).Length;
    38.  
    39.       //If we have have fuel than we can craft
    40.       if (fuelItem != null && m_fuelItemAmount >= 1 && fuelBurnTime > 0) {
    41.  
    42. //         //Start the timer to deplete the fuel over time
    43.          fuelBurnTime -= 1 * Time.deltaTime;
    44.  
    45.          if (fuelBurnTime <= 0)
    46.             RemoveSomeFuel ();
    47.  
    48.          //It's true, we can now craft :)
    49.          CanCraft = true;
    50.  
    51.       } else {
    52.  
    53.          //We dont have any fuel so we can craft anything :( //Also that particle system you spent ages making can't be seen, come on get some more fuel man!
    54.          CanCraft = false;
    55.       }
    56.    }
    57.  
    58.    protected void RemoveSomeFuel ()
    59.    {
    60.       //Remove some fuel from the collection
    61.       if (fuelItem != null) {
    62.          uint FuelItemToRemove = m_Collection.RemoveItem (fuelItem.ID, 1);
    63.       }
    64.  
    65.       //Adds the depleted item burnt from the fuel
    66.       if (fuelDepletedItem != null) {
    67.          m_Collection.AddItem (fuelDepletedItem);
    68.       }
    69.  
    70.       //Reset Timer
    71.       fuelBurnTime = m_fuelBurnTime;
    72.    }
    73.  
    74.  
    75. }
    I plan to modify the Crafting Window UI, to enable the craft button something like this

    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using System.Collections;
    4. using UnityEngine.UI;
    5. using System.Collections.Generic;
    6. using Devdog.General.ThirdParty.UniLinq;
    7. using Devdog.General;
    8. using Devdog.General.UI;
    9. using Devdog.InventoryPro.UI;
    10. using Devdog.InventoryPro;
    11. using UnityEngine.Assertions;
    12.  
    13. public partial class Jims_CraftingFuel : CraftingWindowStandardUI
    14. {
    15.    [Header("Craft Station Require Fuel?")]
    16.    public bool RequireFuel = false;
    17.  
    18. public Jims_CraftWithFuel m_Fuel = null;
    19.  
    20.    protected override void OnCraftButtonClicked()
    21.    {
    22.       if (RequireFuel == false) {
    23.          CraftCurrentlySelectedBlueprint (GetCraftInputFieldAmount ());
    24.       }
    25.       else if (RequireFuel == true) {
    26.  
    27.          if(m_Fuel.CanCraft == true)
    28.          CraftCurrentlySelectedBlueprint (GetCraftInputFieldAmount ());
    29.       }
    30.    }
    31.  
    32. }
     
    Last edited: Jul 24, 2017
    hopeful and Dwight_Everhart like this.
  38. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    513
    This is an updated version with other scripts needed, also I added audio and fx.
    This is setup so when i instantiate a campfire/furnace or what ever it will setup the windows its using.

    The system will now also cancel crafting if the user turns on the crafting station(e.g... turns off the campfire), also will cancel if the user removes the fuel and the audio/ fx will stop too.

    In the Ignition switch you can enable to remove 1 fuel item as soon as its switched on.

    Feel free to use and modify how you like :D

    Edit! - Also need to say that each of my craft stations has their own inventory ui, and that's basically what 'm_Collection' in Jims_InventoryFuel.cs is. You can also add a separate reward collection easily.

    First need a reference script that will store info needed! (This is Placed on the Player)
    Jims_ReferenceManager.cs
    Code (CSharp):
    1. [Header("Inventory System!")]
    2.     public  UIWindowField FurnaceWindow = null;
    3.     public  UIWindowField WorkbenchWindow = null;
    4.     public  UIWindowField AdvancedWorkbenchWindow = null;
    5.     public  UIWindowField CampfireWindow = null;
    6.     public  UIWindowField StorageWindow = null;
    7.  
    8.     [Header("Inventory Fuel!")]
    9.     public  ItemCollectionBase FurnaceCollection = null;
    10.     public  ItemCollectionBase CampfireCollection = null;
    This is a modified script of CraftingWindowStandardUI.cs (This is Placed in your crafting UI page instead of CraftingWindowStandardUI.cs)
    Jims_CraftingFuel.cs
    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using System.Collections;
    4. using UnityEngine.UI;
    5. using System.Collections.Generic;
    6. using Devdog.General.ThirdParty.UniLinq;
    7. using Devdog.General;
    8. using Devdog.General.UI;
    9. using Devdog.InventoryPro.UI;
    10. using Devdog.InventoryPro;
    11. using UnityEngine.Assertions;
    12.  
    13. public partial class Jims_CraftingFuel : CraftingWindowStandardUI
    14. {
    15.     [Header("Craft Station Require Fuel?")]
    16.     public bool RequireFuel = false;
    17.  
    18.     [Header("Inventroy Fuel Componment!")]
    19.     public Jims_InventoryFuel m_Fuel = null;
    20.  
    21.     protected override void OnCraftButtonClicked()
    22.     {
    23.         if (RequireFuel == false) {
    24.             CraftCurrentlySelectedBlueprint (GetCraftInputFieldAmount ());
    25.         }
    26.         else if (RequireFuel == true) {
    27.  
    28.             if(m_Fuel.CanCraft == true)
    29.                 CraftCurrentlySelectedBlueprint (GetCraftInputFieldAmount ());
    30.         }
    31.     }
    32.  
    33. }
    34.  
    This is the main Fuel script, I placed on the crafting station prefab (This is Placed on the Prefab (e.g.. Campfire))
    Jims_InventoryFuel.cs
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using Devdog.General;
    5. using Devdog.InventoryPro;
    6. using Devdog.InventoryPro.Demo;
    7.  
    8. //[ExecuteInEditMode]
    9. public class Jims_InventoryFuel : MonoBehaviour
    10. {
    11.     [Header ("Main Componments!")]
    12.     Jims_ReferenceManager JimsRef = null;
    13.     Jims_SetupUIWindow JimsUI = null;
    14.  
    15.     [Header ("Turn Craft Station On/Off")]
    16.     public bool StationIsOn = false;
    17.  
    18.     [Header ("Audio & FX!")]
    19.     public AudioSource m_Audio = null;
    20.     public MeshRenderer m_Mesh = null;
    21.     public Material m_Material = null;
    22.     public GameObject Effect = null;
    23.  
    24.     [Header ("Setup Inventory Items!")]
    25.     //Item to be used as a Fuel
    26.     public InventoryItemBase fuelItem = null;
    27.     //e.g.. If wood if the fuel than charcol would be the depleted item
    28.     public InventoryItemBase fuelDepletedItem = null;
    29.     //Collection belongs to
    30.     public ItemCollectionBase m_Collection = null;
    31.  
    32.     //Temp list to store the total amount of fuel
    33.     [HideInInspector]
    34.     public int m_fuelItemAmount;
    35.  
    36.     [Header ("Fuel Burning Time")]
    37.     //Time 1 fuel item lasts for
    38.     public float fuelBurnTime = 10f;
    39.     private float m_fuelBurnTime;
    40.  
    41.     //If we have fuel then CanCraft = true; //This will be moved to the Crafting Window UI once its working
    42.     [HideInInspector]
    43.     public bool CanCraft = false;
    44.  
    45.     //Store References PARTA!
    46. [HideInInspector]
    47.     public Jims_CraftingFuel standard = null;
    48.  
    49.     //So the message wont repeat every frame!
    50.     private bool HasDisplayedMessage = false;
    51.  
    52.  
    53.     protected void Awake ()
    54.     {
    55.         //Setup up Collection Auto! For instancing during gameplay
    56.         JimsRef = FindObjectOfType<Jims_ReferenceManager> ();
    57.         if (JimsUI == null)
    58.             JimsUI = GetComponent<Jims_SetupUIWindow> ();
    59.    
    60.         if (JimsUI != null && JimsRef != null) {
    61.             if (JimsUI.isFurnace)
    62.                 m_Collection = JimsRef.FurnaceCollection;
    63.             else if (JimsUI.isCampfire)
    64.                 m_Collection = JimsRef.CampfireCollection;      
    65.         }
    66.  
    67.         if (m_Mesh != null)
    68.             m_Material = m_Mesh.material;
    69.  
    70.         //Store References PARTA!
    71.         standard = m_Collection.GetComponent<Jims_CraftingFuel> ();
    72.  
    73.         //Store default BurningTime
    74.         m_fuelBurnTime = fuelBurnTime;
    75.     }
    76.  
    77.     public void OnEnable ()
    78.     {
    79.         //Setup CraftingWindowUI (Jims_CraftingFuel is modified version!) reference to this Instance of the Jims_InventoryFuel class!
    80.         standard.m_Fuel = this;
    81.  
    82.     }
    83.  
    84.     protected void Update ()
    85.     {
    86.         //Check to see if the collection has fuel
    87.         m_fuelItemAmount = m_Collection.FindAll (fuelItem.ID).Length;
    88.  
    89.         //Only if we have turned the Craft Station On!
    90.         if (StationIsOn == true) {
    91.        
    92.             //If we have have fuel than we can craft
    93.             if (fuelItem != null && m_fuelItemAmount >= 1 && fuelBurnTime > 0) {
    94.  
    95.                 //Start the timer to deplete the fuel over time
    96.                 fuelBurnTime -= 1 * Time.deltaTime;
    97.  
    98.                 if (fuelBurnTime <= 0)
    99.                     RemoveSomeFuel ();
    100.  
    101.                 //It's true, we can now craft :)
    102.                 CanCraft = true;
    103.  
    104.                 //Enable Audio & FX!
    105.                 ShowParticles ();
    106.  
    107.                 HasDisplayedMessage = false;
    108.  
    109.             } else {
    110.  
    111.                 //We dont have any fuel so we can craft anything :( //Also that particle system you spent ages making can't be seen, come on get some more fuel man!
    112.                 CanCraft = false;
    113.  
    114.                 //cancel crafting if fuel is removed
    115.                 standard.progressContainer.CancelActiveCraftAndClearQueue ();
    116.  
    117.                 //Display Message saying it requires fuel
    118.                 if (HasDisplayedMessage == false)
    119.                     StartCoroutine (HaveNoFuelMessage ());
    120.  
    121.                 //Disable Audio & FX!
    122.                 HideParticles ();
    123.  
    124.                 HasDisplayedMessage = true;
    125.             }  
    126.  
    127.         } else {
    128.  
    129.             //Crafting Station isn't Turned On!
    130.             CanCraft = false;
    131.  
    132.             //Disable Audio & FX!
    133.             HideParticles ();
    134.         }
    135.     }
    136.  
    137.     protected void RemoveSomeFuel ()
    138.     {
    139.         //Remove some fuel from the collection
    140.         if (fuelItem != null) {
    141.             uint FuelItemToRemove = m_Collection.RemoveItem (fuelItem.ID, 1);
    142.         }
    143.  
    144.         //Adds the depleted item burnt from the fuel
    145.         if (fuelDepletedItem != null) {
    146.             m_Collection.AddItem (fuelDepletedItem);
    147.         }
    148.  
    149.         //Reset Timer to Defaults!
    150.         fuelBurnTime = m_fuelBurnTime;
    151.     }
    152.  
    153.     protected void HideParticles ()
    154.     {
    155.         if (Effect != null && Effect.activeInHierarchy != false)
    156.             Effect.SetActive (false);
    157.  
    158.         if (m_Audio != null && m_Audio.enabled != false) {
    159.             m_Audio.enabled = false;
    160.             m_Audio.Stop ();
    161.         }
    162.  
    163. //(This is used on my furnace, I use Uber shader and this makes a nice lava effect!)
    164.         if (m_Mesh != null) {
    165.             m_Material = m_Mesh.material;
    166.             m_Material.SetFloat ("_WetnessLevel", 0f);
    167.         }
    168.     }
    169.  
    170.     protected void ShowParticles ()
    171.     {
    172.         if (Effect != null && Effect.activeInHierarchy != true)
    173.             Effect.SetActive (true);
    174.  
    175.         if (m_Audio != null && m_Audio.enabled != true) {
    176.             m_Audio.enabled = true;
    177.             m_Audio.Play ();
    178.         }
    179.  
    180. //(This is used on my furnace, I use Uber shader and this makes a nice lava effect!)
    181.         if (m_Mesh != null) {
    182.             m_Material = m_Mesh.material;
    183.             m_Material.SetFloat ("_WetnessLevel", 0.8f);
    184.         }
    185.     }
    186.  
    187.     IEnumerator HaveNoFuelMessage ()
    188.     {
    189.         yield return new WaitForSeconds (0.5f);
    190.  
    191.         InventoryManager.langDatabase.HaveNoFuelMessage.Show (0);
    192.  
    193.         yield return new WaitForSeconds (0.5f);
    194.     }
    195.  
    196.  
    197. }
    Code (CSharp):
    1.  public void OnEnable ()
    2.     {
    3.         //Setup CraftingWindowUI (Jims_CraftingFuel is modified version!) reference to this Instance of the Jims_InventoryFuel class!
    4.         standard.m_Fuel = this;
    5.     }
    This part needs work on, basically I need it to only use the craft station im using, case I have e.g.. multiple campfires, not sure how to do this yet so I might only make it so the user can only have 1.

    Then create a button to turn it off and on (This is Placed in your crafting UI page)
    Jims_InvFuelIgnitonSwitch.cs
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using System.Collections;
    4. using System.Collections.Generic;
    5. using Devdog.General;
    6. using Devdog.InventoryPro;
    7.  
    8. public class Jims_InvFuelIgnitonSwitch : MonoBehaviour
    9. {
    10.     [Header("Fuel Ignition Switch")]
    11.     //Turn On Colour
    12.     public Color inactiveColor = Color.gray;
    13.     //Turn Off Colour
    14.     public Color activeColor = Color.white;
    15.  
    16.     //UI Button to turn on / off
    17.     public Button m_IgnitionButton = null;
    18.     public Text m_IgnitionText = null;
    19.  
    20.     //Main Refernences
    21.     public Jims_CraftingFuel standard = null;
    22.     //Fuel system, reference onenable incase of multiple craft stations
    23.    [HideInInspector]
    24.     public Jims_InventoryFuel M_Fuel = null;
    25.  
    26.     public bool RemoveOneFuelOnIgnition = true;
    27.     private bool IsOn = false;
    28.  
    29.     protected void OnEnable()
    30.     {
    31.         M_Fuel = standard.m_Fuel;
    32.     }
    33.  
    34.     public void WeHaveIgnition()
    35.     {
    36.         if (IsOn == false) {
    37.  
    38.             //Remove some fuel from the collection when you first turn it on
    39.             if (RemoveOneFuelOnIgnition == true) {
    40.                 if (M_Fuel.fuelItem != null) {
    41.                     uint FuelItemToRemove = M_Fuel.m_Collection.RemoveItem (M_Fuel.fuelItem.ID, 1);
    42.                 }
    43.             }
    44.        
    45.             M_Fuel.StationIsOn = true;
    46.  
    47.             m_IgnitionButton.image.color = activeColor;
    48.  
    49.             m_IgnitionText.text = "TURN OFF";
    50.  
    51.             IsOn = true;
    52.        
    53.         } else {
    54.        
    55.             M_Fuel.StationIsOn = false;
    56.  
    57.             m_IgnitionButton.image.color = inactiveColor;
    58.  
    59.             m_IgnitionText.text = "TURN ON";
    60.  
    61.             //cancel crafting if fuel is removed
    62.             standard.progressContainer.CancelActiveCraftAndClearQueue ();
    63.  
    64.             IsOn = false;
    65.        
    66.         }
    67.     }
    68.  
    69. }
    70.  
    This set's up the Trigger windows.(This is Placed on the Prefab with Trigger script)
    Jims_SetupUIWindow.cs
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Devdog.InventoryPro;
    5. using Devdog.InventoryPro.Demo;
    6. using Devdog.General;
    7.  
    8. public class Jims_SetupUIWindow : MonoBehaviour
    9. {
    10.     public Trigger m_Trigger = null;
    11.     public Jims_ReferenceManager JimsRef = null;
    12.  
    13.     public bool isFurnace = false;
    14.     public bool isWorkbench = false;
    15.     public bool isAdvWorkbench = false;
    16.     public bool isCampfire = false;
    17.     public bool isStorage = false;
    18.  
    19.     void Start ()
    20.     {
    21.         if (JimsRef == null)
    22.             JimsRef = FindObjectOfType<Jims_ReferenceManager> ();
    23.  
    24.         if (m_Trigger == null)
    25.             m_Trigger = GetComponent<Trigger> ();
    26.      
    27.         if (m_Trigger != null && JimsRef != null) {
    28.             if (isFurnace)
    29.                 m_Trigger.window = JimsRef.FurnaceWindow;
    30.             else if (isWorkbench)
    31.                 m_Trigger.window = JimsRef.WorkbenchWindow;
    32.             else if (isAdvWorkbench)
    33.                 m_Trigger.window = JimsRef.AdvancedWorkbenchWindow;
    34.             else if (isCampfire)
    35.                 m_Trigger.window = JimsRef.CampfireWindow;
    36.             else if (isStorage)
    37.                 m_Trigger.window = JimsRef.StorageWindow;
    38.         }
    39.     }
    40.  
    41.  
    42. }
    43.  
     
    Last edited: Jul 25, 2017
    hopeful and Dwight_Everhart like this.
  39. anomas

    anomas

    Joined:
    Jul 3, 2016
    Posts:
    13
    Perhaps you could work something together, since the creator said he was trying to create this integration.
     
  40. Slamerz

    Slamerz

    Joined:
    Feb 23, 2017
    Posts:
    1
    So I've been trying to get a character Equipment screen going, but I get an error every-time I drag an equipable item to the slot.

    NullReferenceException: Object reference not set to an instance of an object
    Devdog.InventoryPro.EquippableInventoryItem.NotifyItemEquipped (Devdog.InventoryPro.EquippableSlot equipSlot, UInt32 amountEquipped) (at Assets/Devdog/InventoryPro/Scripts/Items/EquippableInventoryItem.cs:75)
    Which looks like it means that my item isn't an item. Or at least it's not seeing the type of equipable item it is, or the item. I've tried to equip several items, all with their own category, and handlers built through the main editor. I don't really know what I'm doing wrong and I can't seem to find any documentation of this problem.

    To clarify the item works perfectly outside of equipping it. When I start the game it is on placed on the ground where I placed it, when I pick it up it displays its stats correctly, as well as shows the correct icon. When I drop the item it properly drops it back into the world with it's prefab.

    Anyone have any ideas?
     
    Braza likes this.
  41. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    It looks like the item gets equipped as expected, however, the character collection doesn't have a character reference, or, no stats collection (unlikely).
     
  42. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    513
    I got auto ammo equip for ufps working Kinda!

    works first time you equip a weapon but when you unequip and re-equip the ammo is gone until you re-equip the weapon again.

    i modified EquippableUFPSInventoryItem.cs

    Add to top
    //enter the id of the ammo used, from main inventory manager editor you can see the number number next to the item
    Code (CSharp):
    1. public uint ammoID;
    2. public bool IsMelee = false;
    Then in public override void NotifyItemEquipped(EquippableSlot equipSlot, uint amountEquipped)

    under the code already there
    Code (CSharp):
    1. var ammo = InventoryManager.Find (ammoID, false);
    2.      
    3. if(ammo != null && IsMelee == false)
    4.                 ammo.Use ();
    5.  
    Hope someone can help make it work

    I think we need to un-equip the ammo slot when we un-equip the weapon, can someone help with this part? I'm not sure what I have to call. Then I think it should work


    EDIT!
    Finally got it to work, and was much easier than I fort :D, had me thinking about it removes when i load the weapon again it removed the ammo, so I thought it had to do with 'Use()' which turned out to be the fact :D
    Like the above code then in the public override void NotifyItemUnEquipped (ICharacterCollection equipTo, uint amountUnEquipped)

    Code (CSharp):
    1. public override void NotifyItemUnEquipped (ICharacterCollection equipTo, uint amountUnEquipped)
    2.         {
    3.             base.NotifyItemUnEquipped (equipTo, amountUnEquipped);
    4.  
    5.             var ammo = InventoryManager.Find (ammoID, false);
    6.             if(ammo != null && IsMelee == false)
    7.                 ammo.Use ();
    8.  
    9.             var item = ufpsInventory.GetItem (itemType) as vp_UnitBankInstance;
    10. ...............
    Edit! Found a bug with melee weapons, I've updated code above, check the bool to true if the weapon is melee weapon or doesn't use ammo
     
    Last edited: Aug 7, 2017
    jorisshh and Dwight_Everhart like this.
  43. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    529
    Forgive me if I am wrong, but your web site does not contain the upgrade notes for your version 2.5.8, though your upgrade notice directs us there.
     
    jorisshh and hopeful like this.
  44. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    You're absolutely right; Unity was very quick accepting the update onto the store this time, so I hadn't gotten to it yet. Updating now, thanks :)
     
    wood333 and llJIMBOBll like this.
  45. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Here's the release notes for 2.5.8 :)

    • [FIX] Getting started editor issue fixed in 2017.1
    • [FIX] EquippableInventoryItem stats not increasing issue fixed
    • [FIX] CustomInventoryItemBaseDrawer for NodeCanvas updated to reflect new API
    • [FIX] Updated agent.Stop() to isStopped for Unity 2017.1+
    • [FIX] Fixed Debug not found in playmaker actions
    • [FIX] ItemTriggerUFPS error for UFPS singleplayer fixed.
    • [FIX] General cleanup of code.
    • [NEW] Added remove item from collection playmaker action.
    • [NEW] Add, Remove and Resize slots for PlayMaker (fixes #248)
    • [NEW] Play audio when currency on Inventory changes (fixes #250)
     
    wood333 likes this.
  46. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    513
    Hi jorisshh, I'm wondering how I can do a check to see if there are any items in the players inventory before dropping the bag. This is so the player can drop all items from the inventory, like sort items.

    This is my code which I call from another script.
    Code (CSharp):
    1. public virtual void DropAllItems()
    2.     {
    3.         InventoryPlayer m_InvPro = PlayerManager.instance.currentPlayer.inventoryPlayer;
    4.  
    5.         //Check if any item first
    6.         if (m_InvPro) {
    7.  
    8.             //Drop bag of items
    9.             var Pos = Camera.main.transform.forward * 1 + Camera.main.transform.up * 1 + Camera.main.transform.position;
    10.             m_InvPro.NotifyPlayerDied (true, true, true, Pos);
    11.  
    12.         }
    13.     }
    I noticed that 'Vector3 dropPosition' on NotifyPlayerDied in InventoryPlayer.cs doesn't get called and the bag gets set at transform.position. So I changed the code and it works.
    Code (CSharp):
    1. dropObj.transform.position = dropPosition;
    2.                         dropObj.transform.rotation = Quaternion.identity;
    But it also seems to do a check for items first, but still if I click to drop the bag it will drop an empty bag.
    Code (CSharp):
    1.  if (itemsInCols.Count > 0 || currencies.Count > 0)
    2.                 {
    Thanx alot, Jim
     
    Last edited: Aug 24, 2017
  47. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    513
    I got it to work :D do you think it's ok? If you know a better way to search tho all the inventory collections, that would be helpful. I'm not to clued up on the whole i = 0; stuff :D Thank You

    Code (CSharp):
    1. public virtual void DropAllItems()
    2.     {
    3.         InventoryPlayer m_InvPro = PlayerManager.instance.currentPlayer.inventoryPlayer;
    4.  
    5.         var itemsCnt = m_InvPro.inventoryCollections[0].GetEmptySlotsCount();
    6.  
    7.         //Check if any item first
    8.         if (itemsCnt != m_InvPro.inventoryCollections[0].initialCollectionSize) {
    9.  
    10.             //Drop bag of items
    11.             var Pos = Camera.main.transform.forward * 1 + Camera.main.transform.up * 1 + Camera.main.transform.position;
    12.             m_InvPro.NotifyPlayerDied (true, true, true, Pos);
    13.  
    14.         }
    15.     }
     
  48. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,519
    Looking good :), I would recommend using collection.items.Length instead of initialCollectionSize. Initial collection size is used to initialize the collection to that specific size. If you're using AddSlots() or RemoveSlots() the collection can grow or shrink, so it might no longer be its initial collection size.

    If you want to get the exact amount you could also use:

    var col = m_InvPro.inventoryCollections[0];
    var occupiedSlotsCount = col.items.Length - col.GetEmptySlotCount();

    if(occupiedSlotsCount > 0)
    {
    // There's occupied slots
    }
     
    hopeful and llJIMBOBll like this.
  49. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    789
    How are the items serialized? I read somewhere that one could change stats on an item at runtime so it will be serialized. Are the levels on a stat serialized as well (with the item) or can I add levels later on if I see that there are not enough?
     
  50. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    62
    Hi,

    I upgraded from Inv pro 2.5.4 to 2.5.8 and when I start the game, the character stats remain at 0, the character items load onto the character fine. If I add a new item, the stats are reflected fine, when I remove an item that loaded when the game started, the stats go to minus.

    I get no errors/warnings in console. I loaded back up 2.5.4 and the issue is not present. The game loads the collections ok, and saves them ok when quiting.

    Unity 5.6.0f3

    edit - updated to unity 2017.1.0f3 - same issue

    fyi there were console errors asbout some of your scripts; helpurl, needed to be changed to @helpurl
     
    Last edited: Aug 28, 2017