How to make AI Agent use UIS instead of UCC Inventory

FadelMS

Member
Hi,
How can I make the enemy character use the Ultimate Inventory System instead of the Inventory of Ultimate Character Controller?
 
Hi,
Neither UIS or UCC has any enemy AI logic.

Would you mind give more detail on this, are you using other assets?
 
Sorry, I wasn't clear. I'm still learning and it is tough. I mean by enemy the AI Agent. When I use the Integration in the UIS for the Player, it adds Character Inventory Bridge . But when I try to use the same procedure to the AI Agent, the Character Inventory Bridge of the AI Agent generates errors as shown in the screen shot: My question is: the player (Nolan) uses the UIS, but the AI Agent uses the UCC inventory: How can I make them both use the UIS?

1623412745451.png
 
Ah I think I understand now, You mean that you created a character in the Character Manager Editor with the "AI Agent" option ticked on.

This essentially creates a character without an Input component and some other minor differences.

I believe the error you have is related to one of the "Common Errors" pointed out in the documentation: https://opsive.com/support/document...oller/integrations/ultimate-inventory-system/

Common Errors​

Here are some common errors that users have reported and how to fix them.

Equip Unequip Ability has a Category with ID 3636…. that cannot be found​

This errors happens if you setup a new character with built-in abilities preconfigured from the Character Controller Demo.

CategoryError-300x281.png


The easiest way to fix it is to go through each Equip/Unequip Ability, within the Character Locomotion script under Item Abilities, and re-selecting the item set category to force the category ID to be serialized.

CategorySolution-282x300.png
In the video tutorial there's also a quick passage that shows the same fix, Here is the video at the relevant time step:

I hope that fixes your issue.

Let me know if it does not and I'll look at this in more. If that is the case make sure to send me the exact reproduction steps such that I can reproduce it easily and constantly.
 
Thanks for your reply.
I did what you suggested but I got the same errors with different Category IDs. There is a waring complaining about Duplicate ID for Nolan. I think there is conflict between the Player and the AI Agent.
What I did to create the AI Agent is as follows:
1. I Used the Character Manager with AI Agent checked and it added the components shown in the screen shot:

1623418207984.png
2. I used the Character Setup in the Integrations of the Inventory Manger:
1623418401515.png
3. The Integration replaced some components (Inventory and Item Set Manager) and added more components to AI Agent:

1623418649198.png
 
Thank you for the reproduction steps.

"WARNING: Dupplicate ID '1' found"
This warning points out that you have two Inventory Identifiers that have the same ID. The ID needs to be Unique. The Character Setup simply adds the component without checking for existing ones.
If you plan to make the Enemy into a prefab then most likely you will not want an Inventory Identifier. So Remove the "Inventory Identifier" component from your Enemy character.

That will prevent the first error from happening. That error was causing all the other errors.

I changed the code, such that the warning prevents the error from happening, this way the game won't break if you have a dupplicate Inventory ID, it just won't register the second one.

If the Category errors remain, then the fix I mentioned above should fix those.
I'm sorry for the confusion, I hope this helps.

PS: I added a section in the documentation explaining the issue and how to solve it, which will help a lot of other new users, thank you for bringing this to my attention.
 
Last edited:
Definitely I'm doing something wrong. After following the steps mentioned earlier, now the Item Abilities of Nolan have repeated entries for the Equip items:
1623422112884.png
 
Thanks for your patience. The errors have disappeared after deleting the extra Equip items and the Inventory Identifier.
 
Last edited:
Top