Error in demo Inventory

plutonmania

Member
I have TCP V3 for unity 2021_3. I installed inventory
. It all works well, except this error when I click more than 2 to 3 times on the same slots to assign the weapons. In play mode when I put myself item action panel it works.
Like this he didn't want to put it when I start play.
 

Attachments

  • 1.PNG
    1.PNG
    361.8 KB · Views: 16
  • 2.PNG
    2.PNG
    338.3 KB · Views: 14
  • 3.PNG
    3.PNG
    385 KB · Views: 14
Last edited:
You do not know why, it has a problem as soon as I select the same slot again?
And I saw that the image remains white when it should suppose again become the basic color as in my image.
I do not want to implement in my scene the time inventory that I am not sure that the demo and functional at 100% so as not to make a mistake during my changes.
I have install UltimateInventorySystem_Unity_2019_4 1
and i have install integration for Third controller and not Ultimate . Is good ? i have tcp v3
 

Attachments

  • h.PNG
    h.PNG
    29.6 KB · Views: 1
Last edited:
I think the 3 slot below left are shortened for weapons. But when I use it 1 time it assigns well, but when I click another time it removes the weapon of "assigns" but that makes the bug. and no longer wants to re assigns when I recall on it and makes the game in break
 
Last edited:
When would you give a demo intergation and a clean update version? Even "Character Raw Image" does not work
or can you purpose an pack with Tcp v3 with inventory ? not 2 versionwith integration
 
Last edited:
Hi plutonmania,
Thank for letting us know.

1)
The first bug in the first two screenshots, is a bug in the Inventory System that we found at the start of the week. Please replace this function in the ItemSlotCollection.cs script:

Code:
/// <summary>
/// Returns the slot where the item is set.
/// </summary>
/// <param name="item">The item that is in the collection.</param>
/// <returns>The slot where the item is equipped. -1 indicates no slot.</returns>
public int GetItemSlotIndex(Item item)
{
    var stackableEquivalentItemIndex = -1;
    for (int i = 0; i < m_ItemSlotSet.ItemSlots.Count; i++) {
        var itemSlot = m_ItemSlotSet.ItemSlots[i];
        if (itemSlot.Category != null && !itemSlot.Category.InherentlyContains(item)) {
            continue;
        }
        if (m_ItemsBySlot[i] == null) { continue; }
        
        if (m_ItemsBySlot[i].Item == null) { continue; }
        if (m_ItemsBySlot[i].Item == item) { return i; }
        if (m_ItemsBySlot[i].Item.StackableEquivalentTo(item)) {
            stackableEquivalentItemIndex = i;
        }
    }
    return stackableEquivalentItemIndex;
}

We'll update the Inventory System soon.


2)
I can't seem to replicate the bug in the third screenshot about the Item Action Panel / Button.
It seems one of the ItemViewSlot or ItemView is null, but that doesn't make any sense.

Could you please copy paste the full error message, and explain in detail the steps to replicate that bug?

3)
I think the 3 slot below left are shortened for weapons. But when I use it 1 time it assigns well, but when I click another time it removes the weapon of "assigns" but that makes the bug. and no longer wants to re assigns when I recall on it and makes the game in break
As you say that does seem to be a problem.

There was another bug in ItemSlotCollection. Please replace this function:
Code:
/// <summary>
/// Simple remove of an item from a specific item stack.
/// </summary>
/// <param name="itemInfo">The item Info to remove.</param>
/// <param name="removed">The amount already removed.</param>
/// <param name="itemStackToRemove">The item stack to remove the amount from.</param>
/// <returns>The amount removed (includes the amount previously removed).</returns>
private int SimpleInternalItemRemove(ItemInfo itemInfo, int removed, ItemStack itemStackToRemove)
{
    var remainingToRemove = itemInfo.Amount - removed;
    var newAmount = itemStackToRemove.Amount - remainingToRemove;
    if (newAmount <= 0) {
        // Remove the item from the item collection.
        itemStackToRemove.Item?.RemoveItemCollection(this);
        
        removed += itemStackToRemove.Amount;
        itemStackToRemove.Reset();
        itemStackToRemove.Initialize(ItemAmount.None, this);
        if (m_ItemStacks.Contains(itemStackToRemove)) {
            m_ItemStacks.Remove(itemStackToRemove);
        }
        
    } else {
        removed += remainingToRemove;
        itemStackToRemove.SetAmount(newAmount);
    }
    return removed;
}
The Item was not being removed properly from the slot collection so when it was added back to the default itemCollection it was given a new ID, causing the Hotbar to lose reference to it.

4)
The Camera for the "Character Raw Image" was missing. I'm not sure when that happened. I must have deleted it by mistake.
Here are the settings you want:
1680170004623.png

You'll aslo need to set the Layer for Body, Head and Arms to "Character".
1680170080003.png


5)
Both of the bugs you experienced were caused by the last update we made. We made a big change to ItemSlotCollection to allow a fixed slot count, but that allowed null items which we had to deal with. I should have done a better job testing all use cases before making the update live, and for that I apologize.

Hopefully we'll update the Inventory and the integration very soon.
 
So thank you for answering me!
For the 3rd screen capture that I had made it not take into account, I had placed it manually to see and it was my example that it worked when I clerically.
So I did the import and the integration again and aplicate your changes.

When I matter the integration it puts a mistake. (photo 1) for item view for shop Afterwards :

- I have made your corrections.

-I have a double "audio" problem error at the launch of the demo. (photo 2)

- The character now appears in the inventory! - Weapons assigned, now works well and no longer gives me mistakes.
- -> Except for the grenade which puts a mistake and puts the game on pause. (photo 3). This one disappears from the inventory and does not give it to me in hand or in the assigned slot
 

Attachments

  • 3.PNG
    3.PNG
    328.1 KB · Views: 7
  • 2.PNG
    2.PNG
    174.8 KB · Views: 7
  • 1.PNG
    1.PNG
    203.6 KB · Views: 7
1)
The first error seems like something got messed up without me noticing. Thank you for letting me know
I'll fix it for the next update.
If you want to fix it yourself it's possible but takes a few steps.

- Duplicate a "Multi Currency View Small" prefab from the RPG schema
- Remove the broken "Currency UI Small" reference and replace with your new "Multi Currency View Small"
- Press the Button to fix the currency references to match your own database on the "Multi Currency View Small" MultiCurrencyView component
- On The "Item View For Shop" drag and drop the Multi Currency View Small in the CurrencyItemView component

1680189488902.png


2)
The double audio is from adding the camera you added on the character. Remove the AudioListner (for some reason Unity adds one by default on all cameras)
1680188946989.png

3)
It seems there was another bug with the ItemSlotCollection.cs script:
Please replace this function

Code:
/// <summary>
/// Returns a slot that is suitable for the item provided.
/// </summary>
/// <param name="item">The item that needs a slot.</param>
/// <returns>The desired slot. -1 indicates no slot.</returns>
public int GetTargetSlotIndex(Item item)
{
    if (m_ItemSlotSet == null || m_ItemSlotSet.ItemSlots == null) {
        Debug.LogWarning("Item Slot Collection is missing an Item Slot Set.");
        return -1;
    }
    var matchingCategoryUsedSlot = -1;
    var matchingCategoryEmptySlot = -1;
    for (int i = 0; i < m_ItemSlotSet.ItemSlots.Count; i++) {
        var itemSlot = m_ItemSlotSet.ItemSlots[i];
        if (!itemSlot.Category.InherentlyContains(item)) {
            continue;
        }
        matchingCategoryUsedSlot = i;
        if (m_ItemsBySlot[i] == null || m_ItemsBySlot[i].Item == null) {
            if (matchingCategoryEmptySlot != -1) { continue; }
            matchingCategoryEmptySlot = i;
            continue;
        }
        if (item.IsUnique == false && m_ItemsBySlot[i].Item.StackableEquivalentTo(item)) { return i; }
    }
    if (matchingCategoryEmptySlot != -1) { return matchingCategoryEmptySlot; }
    return matchingCategoryUsedSlot;
}


Once again I apologize for all those issues. We'll fix all of them in the next update planned next week.
If you find any other issues please do let us know before then
 
Thank you, everything is correct and it works, there is no more error.

-I also noticed for sound effects of footsteps, for the sound of the feet did not work, except when I jump :). I corrected by changing Trigger by Bodytep (Photo 2)

But otherwise everything looks good, I would test again and you would say if I find mistakes in the demo.

Last problem spot and after I think everything is good.
1: There is no action message to recover the items or to take action on the shop and the craft. Even if the Action Marche key! Maybe this is wanted?

2: The name of the random items in the cash register, but that gives a random item. Can this be wanted? (photo 1)

3: When I do "exit" on the inventory menu it works But when I rely on the ESCHAP key, I have to do it twice to close the inventory. This may also be wanted. This is not really a problem, but maybe it shouldn't be like that when you thought.

4: All the weapons appear well on the image of the player in the inventory, except the Assault rifle (photo 3)
 

Attachments

  • 2A.PNG
    2A.PNG
    174.8 KB · Views: 10
  • footspep.PNG
    footspep.PNG
    52.2 KB · Views: 7
  • assaultRifle.PNG
    assaultRifle.PNG
    113.8 KB · Views: 8
Last edited:
1)
That's normal

2)
That's another bug.
Here is the fix:
1680259900637.png


3)
That's how it Display panel works. the escape button goes back to the previous selected DisplayPanel. This is very useful when using Gamepad/keyboard only control. There is an option on the DisplayPanel component to enable "IsNonSelectablePanel":
1680260135614.png

4) This is either the UI camera is too close so it culls the weapon. Or the Assault rifle is not on the correct Layer
 
Top