CRole.CreateProceduralSpawnSystem
Creates a procedural spawn system for a custom role.
Syntax
CRole.CreateProceduralSpawnSystem role_to_replace per_player_spawn_chance conversion_limit? minimum_required_players?
Returns
reference to CustomRoleSpawnSystem object
Arguments
| Name | Required | Type | Description |
|---|---|---|---|
role to replace | Yes | RoleTypeId enum value - found using 'serhelp RoleTypeId' command | This decides which base-game role will be replaced by a custom role. |
per player spawn chance | Yes | A number between 0% and 100% (inclusive) | Example: setting conversion chance to 30% means that EACH player has a 30% chance to convert. |
conversion limit | No | A whole number bigger or equal 0 | The maximum amount of players that can convert. |
minimum required players | No | A whole number bigger or equal 0 | The minimum amount of players that must have the 'role to replace' when the round starts for the conversion to happen. |
Details
This spawn system works only when the round starts.
Validated examples using this method
On a running server
Use serhelp CRole.CreateProceduralSpawnSystem to inspect the reference generated by your installed SER version.