edited January 2023 in ORK Support
I am attempting to integrate my custom inventory system with ORK framework (amazing product by the way!), but I am having trouble understanding how to access loot tables when an enemy has died, how the loot should appear on the ground, how to generate the items contained within. I have no problem coding a lot of the logic in C# since I have a lot of custom integrations that I either bought or designed, but the scripting documentation and node documentation itself for the schematic nodes doesn't really have much in terms of *how* to use them so I can integrate everything.

Anyway, I am using the real-time battle system, but I am using a different way of handling loot. Only movement & behavioral AI is handled by my character controller (Ultimate Character Controller). Everything else is handled by ORK and a combo of custom nodes/functions to tie in the various systems I am using such as a custom inventory system which is the hardest one to get integrated with ORK. However, I am having trouble accessing loot tables and understanding how to access items themselves contained within the ORK Framework to get this process started.

I am using a custom inventory system that is grid-based (see below). Each item takes up a certain amount of cells. These items are scriptable objects which the item data is contained within a script that generates the type of item (belt, ring, body armor, etc) and the data it requires using a base prefab. IE: How many cells it takes up on the grid, what type it is, what is the UI image it uses in the inventory, and etc. These items are nothing but UI elements just for viewing within the inventory and loot containers (loot bags, chests, shops etc). All item equipping, model handles, purchasing items, handling loot, and etc will be done by ORK. No item models will ever be spawned in the world apart from equipment being viewed on the player model when equipped. All item drops are contained within a loot bag or chest that houses an item grid. This is for performance reasons and these items will only be UI elements that the player can interact with.

I am assuming if I am able to access the item data contained within ORK itself (UI Sprite, Item name, and etc) and use that data to fill the data needed for the Inventory system that should work, but I am unsure of how to access this item data to begin with and how ORK keeps track of the items interacted with or spawned.

Sample Inventory:
https://imgur.com/a/ogy1fO9

Base Item PreFab:
https://imgur.com/a/BByM8Ib

I am assuming just like with character spawning, ORK must also spawn the items for it to know which is which right?

If so, how can I go about spawning the items and tying it in with the above?



Below is the logic flow of how I am and want to handle loot dropped by enemies. This uses the same items generated as above:

1: Player enters dungeon and all enemies are spawned.
2: Per each enemy a loot bag prefab is spawned is parented under the enemy and the bag is disabled.
3: Loot is generated using a random loot table and parented under the bag in the child LootContent gameobject (see below). This is an grid-based item container. These items generated are UI elements just like above.
4: When the player defeats the enemy the lootbag appears at the location of the defeated enemy and the player can interact with the lootbag to take the loot.

Loot:
https://imgur.com/a/PGZK7KL

The problem I have is with #2 and #3. I am not using item boxes or containers within ORK to handle loot. All loot is always contained within a chest or lootbag which is an item grid of a certain size.

How can I do the following?

1: Access a loot table contained within ORK either via API or by node.
2: Access the items contained within the loot table itself (this is to tie in the inventory system with the loot system).
3: How to ensure ORK knows which item is which. For example, when the player places the item in the inventory (the custom one described above) and when the player equips/uses the item.


Post edited by PirateBridges on
  • 1) Via the asset the loot table's data is stored in (LootAsset).
    All of ORK's data assets have the Settings property that gives access to it's settings and functions.

    2) The Loot class that holds the loot tables (accessed via the Settings property of the asset) has functions to get the items for a combatant. Otherwise you'll have to manually go through the loot tables and their items.

    3) You'll need to implement a way to identify it, e.g. via the index or GUID of the ORK item - or just use the ORK item/equipment assets in your custom items as a field and assign them like any other asset.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.