EGS Name: joshuajames2
Contributors: Only me
Package Name: Treasure Lootbox
What is a Treasure Hunt if you can’t even get the treasure?
Introducing the “Treasure Loot System”, the package that is built with flexibility and accessibility in mind. Doesn’t need to modify your code, with just a couple of drag and drop you are ready to go! All the scripts are documented and all properties has a tooltip to help you keep going. Features uniform and weighted probability, single or multiple loots and sound and effect handlers for easier implementation.
Install the Treasure Lootbox package in your project.
To get you started, Go to Library>Templates place the TreasureChestExample anywhere.
Try to preview the level. Go near the chest and Interact(E) it and see what happens. This package is not limited on just opening chest it can also be used on other things like rewards,enemy loot,gacha and much more.
Now that you have an idea on what it does. Let’s try to apply it on your game. Go to Library>Templates place the LootTable as a child of an entity that you want to have a loot for. In my case, I’ll put it on the chest.
On the Treasure Chest, I want it to drop some loots when I interact with it. So, on it’s OnInteract event I’ve added the LootTable.GetLoot() function, every time I interact on the chest it will drop some loot. You can also call it via script. That’s all it need to make it work just call LootTable.GetLoot().
- This package only needs this 2 scripts to make it work. If you are wondering what does a variable do/for be sure to check the tooltips.
LootTable - This script process all the events and function to spawn a loot. Loot - Used for configuring the loot item,weight,sound and others.
Add/Change loots. The property Item requires a template. The template will be the one that will get spawn on the game.
To create a template. Go to Entity Editor then Template>Create New Template.
Duplicate one of the loot. Then at the Item property assign your newly created template.
Don’t forget to add it on the lootTable or else it won’t appear on the loots.
- Does this include the interaction and function of the loot?
-Nope, This is just purely spawning loot, this doesn’t include the pickup or inventory functionality.