Lootable world objects
Summary
Created by Misoru
This guide will teach you how to turn a world object into a lootable container.
Requirements
Working .streamingsector with the object you want to make lootable (if you haven't done this yet, follow this guide)
Step 1: Create your loot table
Before making your object lootable, we first need to create the lootTable
that we'll later reference in our .streamingsector
, and add it to our Tweak .yaml
. Below is an example:
Search "LootTables" in Tweak Browser for more examples and methods.
Step 2: Verify your object's components
Open the .ent
for the object you want to make lootable and verify its components
include entries like gameInventory
, gameinteractionsComponent
, and GameplayRoleComponent
. These components
are all commonly included in .ent
files for base game containers and
Step 3: Identify your object in your .streamingsector
Open the .streamingsector
containing your object and find its nodes
entry.
If you're having difficulty determining which nodes
entry corresponds to the object you want to make lootable, use World Inspector to identify.
Under instanceData
, create handles for LootContainerObjectAnimatedByTransform
, then add the lootTable
we created in Step 1 and define the persistentState
to LootContainerObjectAnimatedByTransformPS
. Leave everything else default.
Notice that lootTables
is an array, so you can add multiple lootTables
if needed!
You're done!
Your object should now be a lootable container. Load up your mod and test it out. If it's not working, verify you defined your lootTable
correctly (or use a base game lootTable
for testing) and edited the correct .streamingsector
nodes
.
Last updated