Include Nonon Zone Inventory

CharacterController Version 5.0.0 and higher

The Nonon Zone Inventory is another Asset that can be purchased from Unity Asset Store.

The CharacterController Asset is now prepared to run with the Inventory Asset together. As soon as you purchase and install the Inventory, the CharacterController runs with the Inventory.

Integrate the inventory

With the integration of the Inventory, the Editors got an additional tab that makes it easy to add the inventory to your player.

  • Choose: Tools –> Nonon Zone –> Single Player NononZone Editor (or Multiplayer Nonon Zone Editor for Multiplayer)
  • Select the “Inventory” tab
  • Here the player prefab is already selected for you. Drag in your player if you changed that
  • If the Inventory templates are not pre-filled, press the “Find Inventory templates” button. This sould fill the area above with the UI and the template
  • At last choose “Add Inventory to player”
  • Then start the scene and press “i” to see the inventory

Extend the playground Singleplayer

If you run now the playground, you can open up the inventory by pressing “i”

The CharacterController will not pickup anymore the default loot bubbles, as you can see if you run through the bubbles. This is because the inventory needs “Ground Items” to be able to pickup the items into the Inventory.

The following preconditions need to be met:

  • An item with the “NononGroundItem” component on it needs to be added to a transform with a collider.
  • The Item on NononGround item needs to be an ItemObject from the Inventory Asset
  • The Item Object itself needs to have a prefab on the “CharacterDisplay” item on it, that has a “AWeapon” and a “IWeaponAnimatorInventory” component on it

With these preconditions the item can be picked up, equipped and used

Examples with existing ressources

Navigate to the Assets/NononInventory/Prefabs/LootBeam in the Projec Navigator and Drag and Drop the LootBeamYellow into the scene

In the hierarchy select the newly inserted LootBeamYellow and choose on the NononGroundItem the circle on the right of the item that lets you choose an ItemObject. Choose “SwordOfTheUgu”.

Select the ItemObject and the project explorer will show you the right location in the project: Assets/NononInventory/Scripts/Item Assets/SwordOfTheUgu. Choose the ItemObject.

In the Inspector click on the circle on the “CharacterDisplay” and Choose “SwordBigYellowInventory” from the list.

Now you’re ready to pickup the item and use it:

Extend the playground Multiplayer

If you run the playground with the Multiplayer Inventory added to the PlayerPrefabNetwork1, you can open up the inventory by pressing “i” in multiplayer mode. It’s the exact same process, but choosing Multiplayer from the menu.

The CharacterControllerNetwork will not pickup anymore the default loot bubbles, as you can see if you run through the bubbles. This is because the inventory needs “Ground Items” to be able to pickup the items into the Inventory.

The following preconditions need to be met:

  • An item with the “NononGroundItemNetwork” component on it needs to be added to a transform with a collider.
  • The Item on NononGround item needs to be an ItemObject from the Inventory Asset
  • The Item Object itself needs to have a prefab on the “CharacterDisplay” item on it, that has a “AWeapon” and a “IWeaponAnimatorNetworkInventory” component on it

With these preconditions the item can be picked up, equipped and used

Examples with existing ressources

In this example we are gonna modify the the Sword and Dagger Loot, so that you can pickup, equip and use it with the inventory asset for multiplayer.

Be Aware: We will change here the ItemObject again. So if you need it for Single- and multiplayer, you need to create two different Item Objects.

  • Navigate to the folder “Assets/NononInventory/Scripts/Item Assets
  • Choose the ItemObject “SwordOfTheUgu” select in the CharacterDisplay the circle on the right and choose “SwordBigYellowNetworkInventory“.
  • Navigate to the folder “Assets/NononInventory/Prefabs/Loot
  • Select the “PrefabDirectory” element from the project hierarchy
  • Drag for the Element4 the Prefab “SwordOfTheUgu” inside
  • Select the “NononNetworkspawner” element from the project hierarchy
  • Change for the elements 4 the Nw Object Type to NW_OBJECT
  • Select the “NononNetworkManagerPlayground” element from the project hierarchy
  • Add 1 new entry in the NetworkPrefabs list.
  • Drag in again the SwordOfTheUgu from the Assets/NononInventory/Prefabs/Loot into the emtpy slots.

Hit run and enjoy

Include Nonon Zone Inventory

To remove the NononZoneInventory you have to do the following:

  • Delete the dircetory Assets/NononInventory
  • Goto File–>Build Settings –> Player Settings
  • Scroll down to the “Script Compilation” Section
  • Remove the entry “NONON_ZONE_INVENTORY” from the list and hit “Apply”

This compiles everything and the Inventory Asset has been removed


0 Comments

Leave a Reply

Avatar placeholder