See <ComponentProps>
A portion of the configuration object to pass to the PopulationSpawnAreaComponent
constructor.
type PopulationSaveDataChild = null | {
index: number;
pointIndex: number;
};
type PopulationSpawnAreaComponentPropsV2 = {
definition?: number | undefined;
isPopulationStarted?: boolean | undefined;
children?: PopulationSaveDataChild[] | undefined;
maxPopulation?: number | undefined;
currentPopulation?: number | undefined;
checkPopulationTime?: number | undefined;
numberOfSpawnPoints?: number | undefined;
startingPopulation?: number | undefined;
isOneOff?: boolean | undefined;
};
type PopulationSpawnAreaComponentProps = PopulationSpawnAreaComponentPropsV2;
definition
(optional, default30040
)<PopulationDefinitionHash>
isPopulationStarted
(optional, defaulttrue
)<boolean>
children
(optional, default[]
)<Array<PopulationSaveDataChild>>
maxPopulation
(optional, default20
)<number>
currentPopulation
(optional, default5
)<number>
checkPopulationTime
(optional, default852974979330
)<number>
numberOfSpawnPoints
(optional, default40
)<number>
startingPopulation
(optional, default5
)<number>
isOneOff
(optional, defaultfalse
)<boolean>
Creates a versioned PopulationSpawnArea
component.
props
<ComponentProps & PopulationSpawnAreaComponentProps>
Configuration of the component to create.- Returns:
<PopulationSpawnAreaComponent>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
See Component.fromBinary(reader, version)
Note that the following properties are sorted in order of appearance when decoding component binary data.
See Component.hash
See Component.name
The hash of the population to spawn in the SpawnArea
component that is attached to the same prefab this component is attached to.
- Since:
v2
<PopulationDefinitionHash>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const definition = component.definition;
// `definition` is `30040`
- Since:
v2
<boolean>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const isPopulationStarted = component.isPopulationStarted;
// `isPopulationStarted` is `true`
- Since:
v2
<Array<PopulationSaveDataChild>>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const children = component.children;
// `children` is `[]`
The maximum amount of spawned prefabs in this population.
- Since:
v2
<number>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const maxPopulation = component.maxPopulation;
// `maxPopulation` is `20`
The current amount of spawned prefabs in this population.
- Since:
v2
<number>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const currentPopulation = component.currentPopulation;
// `currentPopulation` is `5`
- Since:
v2
<number>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const checkPopulationTime = component.checkPopulationTime;
// `checkPopulationTime` is `852974979330`
The amount of spawn locations inside the SpawnArea
component that is attached to the same prefab this component is attached to.
- Since:
v2
<number>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const numberOfSpawnPoints = component.numberOfSpawnPoints;
// `numberOfSpawnPoints` is `40`
The amount of spawned prefabs that this population begins with.
- Since:
v2
<number>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const startingPopulation = component.startingPopulation;
// `startingPopulation` is `5`
Whether any removed prefabs from this population shouldn't be replaced after the server's respawn timer has elapsed.
- Since:
v2
<number>
import { PopulationSpawnAreaComponent } from 'att-string-transcoder';
const componentVersion = 2;
const component = new PopulationSpawnAreaComponent({ version: componentVersion });
const isOneOff = component.isOneOff;
// `isOneOff` is `false`
See Component.toBinary(version?)