HytaleDocs
NPC

Flocks

Asset path: Server/NPC/Flocks/*.json

This object has different properties depending on the value of the Type property.

All possible options are listed below:

default case: Default

A flock definition in which the initial random size is picked from a range.

RangeSizeFlockAsset with the following properties:

KeyTypeDescription
Type(Nullable) String

This field controls the type, it must be set to the constant value "Default" to function as this type.

ParentString

When set this asset will inherit properties from the named asset.

When inheriting from another RangeSizeFlockAsset most properties will simply be copied from the parent asset to this asset. In the case where both child and parent provide a field the child field will simply replace the value provided by the parent, in the case of nested structures this will apply to the fields within the structure. In some cases the field may decide to act differently, for example: by merging the parent and child fields together.

MaxGrowSizeInteger defaults to: 8

The maximum size a flock can possibly grow to after spawning. It is technically possible to spawn a flock without specifying a definition (e.g. via a command), in which case the maximum grow size is irrelevant.

BlockedRoles(Nullable) Array of String

An array of roles that will not be allowed to join this flock once it has been spawned. This is used to exclude roles from the list of allowed roles in the NPC configuration of the initial leader.

SizeArray of Integer

An array with two values specifying the random range from which to pick the size of the flock when it spawns. e.g. [ 2, 4 ] will randomly pick a size between two and four (inclusive).

Tags(Nullable) Map of the following:
Map
KeyType
any StringArray of String

Tags are a general way to describe an asset that can be interpreted by other systems in a way they see fit.

For example you could tag something with a Material tag with the values Solid and Stone, And another single tag Ore.

Tags will be expanded into a single list of tags automatically. Using the above example with Material and Ore the end result would be the following list of tags: Ore, Material, Solid, Stone, Material=Solid and Material=Stone.

Weighted

A flock definition where the initial random size is picked from a weighted map of sizes.

WeightedSizeFlockAsset with the following properties:

KeyTypeDescription
TypeConstant value: Weighted

This field controls the type, it must be set to the constant value "Weighted" to function as this type.

ParentString

When set this asset will inherit properties from the named asset.

When inheriting from another WeightedSizeFlockAsset most properties will simply be copied from the parent asset to this asset. In the case where both child and parent provide a field the child field will simply replace the value provided by the parent, in the case of nested structures this will apply to the fields within the structure. In some cases the field may decide to act differently, for example: by merging the parent and child fields together.

MaxGrowSizeInteger defaults to: 8

The maximum size a flock can possibly grow to after spawning. It is technically possible to spawn a flock without specifying a definition (e.g. via a command), in which case the maximum grow size is irrelevant.

BlockedRoles(Nullable) Array of String

An array of roles that will not be allowed to join this flock once it has been spawned. This is used to exclude roles from the list of allowed roles in the NPC configuration of the initial leader.

MinSizeInteger defaults to: 0

The absolute minimum size to spawn the flock with.

SizeWeightsArray of Number

An array of weights which is used in conjunction with the MinSize to determine the weighted size of the flock. The first value in the array corresponds to the weight of the minimum size and each successive value to a flock larger by one. e.g. If MinSize is 2 and SizeWeights is [ 25, 75 ], there will be a 25% chance that the flock will spawn with a size of 2 and a 75% chance that the flock will spawn with a size of 3. As these are weights, they do not need to add up to 100 and their percentage is relative to the total sum.

Tags(Nullable) Map of the following:
Map
KeyType
any StringArray of String

Tags are a general way to describe an asset that can be interpreted by other systems in a way they see fit.

For example you could tag something with a Material tag with the values Solid and Stone, And another single tag Ore.

Tags will be expanded into a single list of tags automatically. Using the above example with Material and Ore the end result would be the following list of tags: Ore, Material, Solid, Stone, Material=Solid and Material=Stone.

On this page