Unturned

Unturned

Not enough ratings
Unturned - Spawn tables
By Tiway
This guide explains what are Spawn Tables and how to create and use them.
   
Award
Favorite
Favorited
Unfavorite
What are Spawn Tables?
Spawn Tables are files used by the game to determine Items, Animals, and Vehicles spawning.

They can be used as an alternative to legacy spawns (integrated in the Editor), to allow custom content to spawn on vanilla maps, or to create spawns list for events (fishing/tree-cutting/ore-mining/object-breaking/NPC random rewards)

Here is an example of a spawn table, viewed in the in-game Spawn Table editor :
Basics of Spawn Tables creation
Spawn Tables are assets, which means they have to be located in a folder the game will load; they will also need a unique file name, ID and GUID (which will not be generated by the game!)

The easiest way to create a Spawn Table is to copy a vanilla one and edit it, you can find them at : Unturned/Bundles/Spawns
Make sure you do not edit them directly or delete them (verify integrity of game files if needed).


Name

A Spawn Table consists of a folder which stores a dat file.
The folder and dat file of your spawn table must have the same unique name, as shown below with a vanilla example :


GUID

Spawn tables do not generate GUIDs when loaded by the game. Make sure you give it one manually.

You can generate GUIDs here (uncheck "hyphens" to get rid of the dashes)[guidgenerator.com]

ID

Spawn Tables rely on IDs to work, they will need a Unique ID so they do not conflict with another one.
Note that Spawn Tables IDs can only conflict with other Spawn Tables IDs, they can use the same IDs as other asset types (NPCs/Items/Vehicles...)

File Location

The Spawn Table folder has to be loaded by the game in order to work.
You can store it :
  • In your custom map Bundles folder (recommended if it will be used by your custom map)
  • In the Sandbox folder of the game (Unturned/Sandbox)
  • In a vanilla map Bundles folder (alternative to the Sandbox folder)
  • In the main Bundles folder of the game (not recommended)

Starting from these folders, you can organize your Spawn Tables within sub-folders : something like "Unturned/Sandbox/My_Mod/Spawns/Items/{SpawnTable}/{SpawnTable.dat}" will work.

In the end, you should have a folder with a unique name, containing a single dat file named the same as the folder, which has a unique pre-generated GUID and unique ID :

Roots and Tables
Roots and Tables are the core of the Spawn Table : they are used to determine when a Spawn Table should be used and what they should spawn.

Tables

Tables specify what a Spawn Table should spawn.
There are two types of Tables :
  • "Asset" Tables, which point to assets (Items;Vehicles:Animals)
  • "Spawn" Tables, which point to other Spawn Tables

Weight is used to determine the chance of a Table to be used or spawned. Applying Weights will specify percentages next to each Spawn or Asset Table.

Tables {number_of_tables} ... Table_x_Asset_ID {ID} Table_x_Weight {Weight} Table_y_Spawn_ID {ID} Table_y_Weight {Weight}

Tables : Asset

Asset Tables are used to specify what assets will be spawned.
A Spawn Table will either spawn Items, Vehicles, or Animals, but not different types at the same time.

If a Spawn Table, or its "children" Spawn Tables, has no Asset Tables, nothing will spawn.

Table_x_Asset_ID {ID} Table_x_Weight {Weight}


Tables : Spawn

A Spawn Table can have several other Spawn Tables as "children". This can be used to gather simpler Spawn Tables into one without having to make a huge list of Assets inside a single Spawn Table.

There are a lot of uses for this :
  • Better organize complex Spawns
  • Allow for more precise Item Spawning on a map location while having zombies drop all Item types.
  • Make modular vehicles or clothes spawning (making one Spawn Table with all color variants of one asset).
  • Create an edited version of an existing Spawn Table without having to override it or duplicate it.

    Table_y_Spawn_ID {ID} Table_y_Weight {Weight}

    Roots

    Roots are used to force a Spawn Table to be a child of another Spawn Table.

    The main use of Roots is to add custom Assets to vanilla Spawn Tables, or to override them.

    The weight of the Root determines the chance of the Spawn Table to be used. It is compared to the weights of the other Tables of that Root Spawn Tables.

    Roots {number_of_roots} ... Root_x_Spawn_ID {ID} Root_x_Weight {Weight}

    Roots overrides

    Roots overrides will make the custom Spawn Table override the specified Spawn Table.
    This can be used to replace vanilla spawns with custom ones.
    Weight is not needed in that case.

    Root_x_Spawn_ID {ID} Root_x_Override

    Example


    In this example, the custom Spawn Table will be a child of the Special_Canada_Effects Magazines Spawn Table, with a weight of 20 (as shown in Red).

    When used, the custom Spawn Table will have 66,66% chance of spawning an Horizontal Grip (as shown in Green); and a 33,33% chance of using the Special_Canada_Ammo Spawn Table (as shown in Yellow).

    This is the equivalent in the dat file :
    Roots 1 Root_0_Spawn_ID 147 Root_0_Weight 20 Tables 2 Table_0_Asset_ID 145 Table_0_Weight 2 Table_1_Spawn_ID 146 Table_1_Weight 1
In-game Spawn Table Editor
The in-game Spawn Table editor is an easy way to create Spawn Tables.
It can be found in the Menu -> Workshop -> Spawn Tables.


Once your file is created ("Basics of Spawn Tables creation" step is done), start or reload your game, open the Spawn Table editor, write your Spawn Table ID in the top-left field and press View.

Your Spawn Table should appear, you can edit it by adding or removing Roots; Assets or Spawns and giving them Weights. Press Write to save.

You can click on Roots/Tables Spawn Tables to navigate to them.

Spawn Table Editor limitations

- Asset Tables will always appear as Items even if you want to spawn Vehicles (the Spawn Table will still work)
- Roots overrides are not supported by the editor and have to be added by hand in the dat file.
- Make sure you do not edit vanilla Spawn Tables through the editor (Verify integrity of game files if needed)
Using custom Spawn Tables
How to specify when your Spawn Table should be used by the game?

Roots

The first method is to make a vanilla Spawn Table the root of your custom Spawn Table.
Check the Roots sections for more information.

Map Editor

When adding a Spawn (Item, Animal or Vehicle) in the map editor, you can replace the legacy Tiers and IDs by specifying your Spawn Table ID in "Spawn ID" as shown here.

The same works for zombies Item loot, by specifying the Spawn Table ID in "Loot ID"

Fishers

Fishing rods rely on Spawn Tables :

Reward_ID {Spawn Table ID}

Resources

Tree-cutting and Ore-mining rely on Spawn Tables :

Reward_ID {Spawn Table ID}

Random Item Reward

NPC random Item reward rely on Spawn Tables :

Reward_x_ID {Spawn Table ID}

More information on rewards here
3 Comments
HEXA 5 Sep, 2024 @ 11:02pm 
thx dude
jacus_1 14 Jul, 2024 @ 4:03pm 
I love you bro
heisenburger 21 Sep, 2023 @ 10:18pm 
Thx