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
For pawn appearance assets, seeds and predefined-spawner previews, see Variations.
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 - 6 pawn spawns per group.
The spawn group actor’s location needs to be inside an SBZRoomVolume for the game to initialize the actor.
A few things are needed for Assaults to work properly, these include: SBZNavMeshGeneratorVolume,
SBZPawnSpawnPredefined and PD3PawnSpawnGroup along with a few important Settings within the World Settings.
To begin, place down a few SBZPawnSpawnPredefined and assign them to a PD3PawnSpawnGroup, this is the container for the spawn location.
Within the SBZPawnSpawnPredefined make sure, Spawn on Begin Play is unticked (as the assault manager will spawn them), then tick the checkbox Override Spawning Method and set the Method to Try To Adjust Location, But Always Spawn.
You can leave the Predefined Pawn Request empty, as the assault manager will also manage that.
Lastly, make sure that within the Spawn Definition Array the Transform is set to the Actors Location, same goes with the Weighted Location.
Now just grab the SBZNavMeshGeneratorVolume, encase your playable area with it, and now youre almost done.
Lastly comes the Blueprint Part, go into your Level Blueprint and place a Get PD3AssaultManager Node, from that Node drag off into the Set Assault Active Function, lastly add a Set Level Progression Node, make sure the bool is set to true and the float is set to something above 0.5.
You can put this blueprint section in conjunction with a SBZPlayerTrigger to trigger the alarm for example.
|
Make sure that the This will interfere with the assaults if all Volumes on the Map have the same priority. |
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. |