TrainWreck Help

Lootable Container

How does the Looting system recognize something as lootable?

  • A handful of Inventory Component must be present on the prefab in ordre for it to be considered an "inventory".

  • Our TW_LootableInventoryComponent must be added

How to make something lootable

Setup

  1. Navigate to the prefab you want to make lootable

  2. Right click --> Override

RplComponent

If this component does not exist, add it.

If this component does exist, but is disabled - enable it.

ActionsManagerComponent

ActionsManagerComponent

How to setup ActionsManagerComponent

  1. Add at least one Action Context. This sets the positional/conditional context in how an action is presented to the player. When naming the context we have been using "default" for simplicity.

  2. Within the additional actions, make sure to select the previously created (or existing) context

  3. The UI Info class can be set, but the values here don't matter

  4. The position, for most cases can be a PointInfo class. Click on the offset value in the property editor. This should allow you to move the transform around in the editor. Note how the x/y/z values will change as you move the transform around.

  5. Update the radius to something reasonable. We found 0.8 to be a sweet spot for most things.

    For further assistance, you can right-click on the ActionsManagerComponent to enable debug drawing

    gizmo
    showcase gizmo
  6. Add an "Additional Actions", set it to SCR_OpenStorageAction

  7. Set the parent context to "default", or whichever one you want from the Action Contexts list

  8. The UI Info, again, can be set but the values here don't matter

SCR_InventoryStorageManagerComponent

This is an easy step. Just make sure it's present, and enabled. If it's not present add it! Done!

SCR_UniversalInventoryStorageComponent

Universal Inventory Storage Component
  1. Set "Attribute" to SCR_ItemAttributeCollection

  2. Set "Item Display Name" to something reasonable. This is what appears to the player when they're in the inventory screen

  3. Now we're not entirely sure if this impacts things but the following size types are what we've been using

    "Size" --> Slot 3x3

    "Slot Type" --> Slot_Any

  4. Use Capacity Coefficient --> Disable it

  5. Max Cumulative Volume --> 10000

  6. Max Weight --> 10000

TW_LootableInventoryComponent

This should be straight forward. What kind of loot do you want to spawn in here? Check the boxes to allow certain types to spawn.

15 July 2025