Back to NxLabs

NxLabs / Vintage Story

Additional Spawn Constraints

ZBy Zach2039

A server-side dependency mod that allows JSON mods and patching to control various spawn conditions;

Description

Additional Spawn Constraints

A server-side dependency mod that allows JSON mods and patching to control various spawn conditions; does nothing on its own!

Overview

AdditionalSpawnConstraints will look for an additionalSpawnConstraints object inside an entity's /attributes object. This can be included on new entity JSON files, or patched in via JSON.

An example for some properties is below, applied via a patch to drifter.json:

<pre>[ { <span class="pl-ent">"side"</span>: <span class="pl-s"><span class="pl-pds">"</span>Server<span class="pl-pds">"</span></span>, <span class="pl-ent">"file"</span>: <span class="pl-s"><span class="pl-pds">"</span>game:entities/land/drifter.json<span class="pl-pds">"</span></span>, <span class="pl-ent">"op"</span>: <span class="pl-s"><span class="pl-pds">"</span>addmerge<span class="pl-pds">"</span></span>, <span class="pl-ent">"path"</span>: <span class="pl-s"><span class="pl-pds">"</span>/attributes/additionalSpawnConstraints<span class="pl-pds">"</span></span>, <span class="pl-ent">"value"</span>: { <span class="pl-ent">"changeTemporalStormSpawnMechanics"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"canSpawnOn"</span>:[ <span class="pl-s"><span class="pl-pds">"</span>game:sand-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:gravel-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:dirtygravel<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:sludgygravel<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:muddygravel<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:soil-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:forestfloor-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:peat-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:rock-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:crackedrock-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:regolith-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:ore-gem-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:ore-graded-<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>game:ore-ungraded-*<span class="pl-pds">"</span></span> ] } } ]</pre>
&nbsp;

The properties that can be set within additionalSpawnConstraints are:

  • "minRegionStability" : The minimum region stablity required when spawning the entity; does not take into account rifts nor rift proximity.

  • "maxRegionStability" : The maximum region stablity required when spawning the entity; does not take into account rifts nor rift proximity.

  • "canSpawnOn" : A list of block codes that are valid for spawning the entity on; supports globs and regex to handle variants.

  • "cannotSpawnOn" : A list of block codes that are not valid for spawning the entity on; supports globs and regex to handle variants.

  • "changeTemporalStormSpawnMechanics" : Determines if other properties can affect temporal storm spawning, where applicable; default is false if unspecified. Does not apply to "minRegionStability" or "maxRegionStability". Only affects entities that are spawned during storms.

&nbsp;

Future Plans

  • Properties related to health scaling on spawn.

&nbsp;

Known Issues

  • None, atm.

&nbsp;

Mods That Use This

  • Natural Spawns : Limits drifters to spawning on soil and other natural blocks, even during storms.

&nbsp;

Read the full description on Vintage Story ModDB →

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.