Clearing some part of the vanilla spawns

I just want to clear the guns and attachements on a map and add modded ones into it, I already know how to make spawntables but I do not know how to clear vanilla natural spawns.
Also, the same with the horde beacon. I need to clear that as well, but not all of them such as grenades and other clothing items.
Or ammunition.

It sounds like the SpawnAsset property you want is Root_#_Override IsOverride. More information available on our documentation website, here: Spawn Assets — Unturned 0.1 documentation

This property zeroes the weights of all spawns parent spawn table. If you want to preserve some vanilla items, you’ll need to manually re-add them in your attached child spawn table.

Like, what am I supposed to use Root_#_Override for, more specifically what number does it go for the hashtag the whole spawntable’s ID?

Do I have to find every single spawntable’s ID to clear them out?
Like, I override them and add them back, sounds reasonable but I’m not really sure how to do it.

If you haven’t read through the SpawnAsset documentation already, I recommend skimming through it briefly. It sounds like you may be confused about some broader concepts though.

I’ve included some explanations below, but if you just want the “short answer” skip to the very end. Feel free to ask questions about any specific terms or properties that confuse you.

IDs vs. GUIDs

Assets—such as items, spawn tables, or vehicles—will have a type of identification called a “legacy ID” or a “GUID”. Most assets will have both types of identification.

A legacy ID is a short number from 1 to 65535, while a GUID is a larger 32-digit hexadecimal string (such as 0123456789abcdef0123456789abcdef). These are both valid types of identification for an asset, although GUIDs are generally better for a number of reasons that aren’t super relevant here.

When adding something to a spawn table, either a legacy ID or a GUID can be used to reference whatever you’re adding. Support for using GUIDs in spawn tables only came with the latest update, so most vanilla or modded examples of spawn tables still use legacy IDs.

“Parent” and “Child” spawn tables

A spawn table can contain other spawn tables inside of it. When this happens – the original spawn table is called a “parent” (or “root”) spawn table, and the spawn tables inside of it are called “child” spawn tables.

When you create a custom spawn table, you can choose to make it have a parent spawn table that it should be a part of. This allows modders to add their custom spawn tables to preexisting spawn tables, such as those used by the vanilla maps.

Weights

Anything that a spawn table can spawn has a “weight” assigned to it. This weight is used to calculate the spawn chance of that thing. If something’s weight is set to 0, then it functionally has a 0% chance of spawning.

Modders can “zero the weights” of a parent spawn table. This sets the weights of all the preexisting things in that parent spawn table to 0. This is what you’re trying to do – you’re wanting to zero the weights of some vanilla spawn tables, so that only your modded items spawn.

How should I set up my spawn table?

The relevant properties for what you’re trying to do here are under the “Roots” section of the documentation. These are the properties that let you assign a parent spawn table that your custom spawn table should be a child of.

There’s two different (but very similar) groups of properties in this section. There’s the newer properties added with this latest game update—which use a newer file format—and there’s the old properties for the older file format. If you’ve looked at the vanilla spawn tables, or anyone else’s custom spawn tables, these are likely still using the older file format.

  1. First, you need to assign a parent spawn table either by referencing its legacy ID or its GUID. The property you add to your file is different depending on which type of identification you choose to use, but my examples will assume you’re using GUIDs. Check the documentation for the alternative.

  2. Second, you need to add the property that will zero the weights of the parent spawn table that you added.

If you’re using the older properties and file format, your setup may look like this:

Roots 1
Root_0_GUID ffffffffffffffffffffffffffffffff
Root_0_Override

If you’re using the newer properties and file format, it may look more like this:

Roots
[
    {
        // Vanilla Spawn Table - replace the example GUID value with one from a real spawn table.
        Guid ffffffffffffffffffffffffffffffff
        IsOverride true
    }
]
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.