Spawns
Player spawns
Player spawns use the SBZPlayerSpawnGroup class. In this class, you can attach Player Spawns to an array.
The game randomly chooses one SBZPlayerSpawnGroup in your heist and spawns the players there. It is recommended for each group to have 4 PlayerSpawns attached to it, one for each player.
Use the On Player Group Chosen event on the group to execute nodes based on the spawn location that was chosen.
Scripted spawns
All scripted spawns, such as civilians and cops, use the SBZPawnspawnPredefined class.
Spawning
You can use Spawn on Begin Play, but it is recommended to have the level blueprint spawn the pawn using Spawn predefined on the Begin Black Screen event. Spawning AI too early can cause instability, or prevent the pawn from spawning at all which the Begin Black Screen event prevents.
Use Override Spawning Method if a pawn is having trouble spawning. Even when a pawn is inside the nav mesh, it typically needs a radius of nav mesh around the actor before it can spawn.
|
For the pawn spawn to work, the spawn definition array and the weighted location must each have at least one item with the location set, typically to the actor’s own location. To set this up:
|
To spawn the pawn at a different location, use that location’s transform instead.
Settings
Set the Spawn Loot Class to a blueprint of your choice to give the pawn an item on their back, such as a keycard or phone. For key items to show up on the HUD, add the key item to the Key Item Data Map in the world settings. See World Settings.
Use the Predefined request Action Actor Ref to have the pawn use a blueprint-based life action, such as patrols or other movement-based life actions. See Life Actions for more details.
The Data section inside the Predefined Pawn Request specifies the type of scripted spawn, such as Civilian, Guard, or another type.
Other ways to spawn in AI
In the level blueprint, you can use "Spawn Actor of class" on any of the CH_* assets in the content folder to spawn other types of AI that aren’t listed in the data section of the SBZPawnspawnPredefined.
|
This has a tendency of no replicating to clients. Be careful of using the "Spawn Actor of Class" method. |
Spawn groups
Spawn pawn groups (class PD3PawnSpawnGroup), like player spawn groups, are used to spawn AI pawns randomly.
Groups can be used to spawn civilians randomly, or in assaults.
Assaults
The game automatically chooses spawn groups to spawn cops during assaults, so the only control you have over whether cops may spawn at a location is the set enabled for assault bool, which can be changed at any time.
It is recommended to use 4 pawn spawns per group.
The spawn group actor’s location needs to be inside an SBZRoomVolume for the game to initialize the actor.
|
As of update 3.9, assault spawns are not functional. A fix is being investigated. Scripted spawns are unaffected. |
Assault and civilian managers
See World Settings to manage automatic spawning, i.e., what can spawn, how frequently, etc.
Spawn closets
A spawn closet spawns a squad behind closed doors, then opens the doors so the squad can leave.
An example is the elevators in No Rest For The Wicked.
A spawn closet uses these level actor variables:
-
A closet volume, which is the
SBZRoomVolume -
The spawn group
-
The reactor, the actor that is triggered when a squad spawns from the group
Together, these allow the spawn closet to interact with the reactor, to spawn enemies only when no player is inside the volume, and to detect whether any pawn is inside the room volume to keep the door open.
Reactors, such as BP_ElevatorDoor, need the ReactToCloset blueprint interface to interact with the closet.
|
This information has been gathered but not yet tested. |