Thanks to @anon79904173 for coming up with this, I just implemented it, she came up with this method. AFAIK this is the first time anybody has done this!
Ever wanted to spice up your map or mod by adding a loot box or crafting recipe with random results? Well here is how you can do it! Example of it in action. Mod with it implemented.
(Note this guide assumes you have basic knowledge of modding, unity, and loot tables and such - please consult official documentation if you are unsure of something)
Crafting Recipe
Set it up like this:
Blueprint_0_Type Supply
Blueprint_0_Supplies 1 //amount of input items
Blueprint_0_Supply_0_ID //input item
Blueprint_0_Supply_0_Amount 1 //amount of first input item
Blueprint_0_Products 1
Blueprint_0_Product //item being used for icon in the crafting recipe - normally you will get this in addition to the random item on crafting, but if setup correctly you will just get the random item
Blueprint_0_Rewards 1
Blueprint_0_Reward_0_Type Item_Random //set it to type random if you want a random item
//With this method you can also change it the reward type to give xp, a gun with custom attatchments (even one that wouldn't be possible like the scoped ace!), health, reputation, spawning a vehicle, or even teleporting!
Blueprint_0_Reward_0_ID //id of spawn table being used for reward - this won't be covered in this guide, it works just like a normal spawn table, check Unturned > Bundles > Spawns > Items for an example
Blueprint_0_Reward_0_Amount 1 //amount of rewards
Blueprint_0_Build 32 //sound used
Item Icon:
This item is what will be shown in the crafting recipe. I recommend making it a giant question mark called mystery item or something like that.
This can be setup like any other item in unity, give it the type supply and add the flag
Pro
in the .dat file and it won’t be obtainable, but will still show as the icon. Thanks @Renaxon!
Congratulations! You have made your first random crafting recipe!