Placing your creatures in the world - LeeTwentyThree/ECCLibrary-Legacy GitHub Wiki

Placing creatures into the world

There are two main ways to go about placing creatures into the world. You can use one or both, depending on your needs.

Option 1: CoordinatedSpawns override

Use this option if you want static spawn locations for your creature. Leviathans should use this.

In your CreatureAsset class, override the virtual CoordinatedSpawns property. Simply feed in a list of coordinates (and rotations if applicable), and your creatures should appear at said positions in the world.

Example of Coordinated Spawns, this spawns 2 creatures around the origin of the map.

public override List<SpawnLocation> CoordinatedSpawns => new List<SpawnLocation>()
{
    new SpawnLocation(new Vector3(1f, 0f, 0f)),
    new SpawnLocation(new Vector3(0f, 0f, 1f))
};

Note that CoordinatedSpawns are an SMLHelper feature, and are neither a vanilla or ECCLibrary feature.

Option 2: BiomesToSpawnIn override

Use this option if you want your creatures to spawn in a variety of different locations, without manually defining spawn locations. Most smaller creatures use this method of spawning.

Override this property in your CreatureAsset list, and simply add items to the list.

An example of implementing this override can be seen here.

A list of vanilla spawns can be found here.