Blueprint Reference
Every Blueprint in the pack, with its editable properties and the functions meant for you. Paths are relative to Content/AITurret.
Turret
BP_TurretPawnBase
Blueprints/Core/BP_TurretPawnBase is the base of every turret: mesh, firing, health, damage states and destruction. It implements BPI_TeamAgent, BPI_Destructible and BPI_Highlightable.
Components: TurretSceneComponent, MeshComponent (skeletal mesh), HealthComponent (AC_Health), NumberPop (BP_NumberPop).
| Property | Type | Description |
|---|---|---|
TeamID | Byte | Team of the turret (255 = no team) |
VelocityScale | Float | Projectile speed in cm/s (1000) |
bDualBarrel | Bool | Fire from both barrels |
DualBarrelShootDelay | Float | Delay of the second barrel in seconds |
ProjectileClass | Class | Projectile to spawn (BP_TurretProjectile) |
Name_SocketMuzzle, Name_SocketMuzzleLeft, Name_SocketMuzzleRight | Name | Muzzle sockets on the mesh (muzzle, muzzle_left, muzzle_right) |
ShootSound, ResetTurretSound, DamageSound, DestructionSound | Sound | Sounds for shot, reset, damage and destruction |
MuzzleFlashEffect, ProjectileEffect | Niagara System | Muzzle flash and projectile trail |
DestroyedActorClass | Class | Debris actor spawned on destruction |
DamageStateThresholdPercentages | Float array | Health fractions for the damage states (0.75, 0.5, 0.25) |
DamageStateEffectClasses | Class array | Effect actor per damage state |
DamageStateEffectOffset | Vector array | Offset of each damage-state effect |
HealthBarWidgetClass | Class | Health bar widget (WBP_Healthbar) |
HealthBarHeight | Float | Height of the health bar at actor scale 1 (300) |
TurretRotation | Rotator | Aim of the head, set by the controller, replicated; drives the Animation Blueprint |
| Function | Description |
|---|---|
OnProjectileImpact | Called when one of this turret's projectiles hits something. Empty: override it to deal damage |
SpawnShootFX | Shot sound and muzzle flash. Override for custom effects |
ResetTurret | Called by the controller when it gives up its target |
PlayDamageFeedback | Sound, damage number and health bar after taking damage. Runs on every machine |
PlayDestruction | Hides the turret and spawns the debris actor and a field that breaks it. Runs on every machine |
UpdateDamageStates | Shows the damage-state effects for a health fraction |
GetSocketLocationFromMesh | World location of a socket on the mesh |
BP_TurretPawn and BP_TurretPawn2
Blueprints/Turret/BP_TurretPawn (dual barrel, SKM_Turret) and BP_TurretPawn2 (single barrel, SKM_Turret_Single_HighPoly). Both are children of BP_TurretPawnBase with VelocityScale 4000, TeamID 1, AI Controller Class BP_TurretAIController and their own debris actor (BP_DestroyedTurret1, BP_DestroyedTurret2).
BP_TurretAIController
Blueprints/Turret/BP_TurretAIController sees with its AIPerception component (sight sense), picks a hostile target, leads it and fires.
| Property | Default | Description |
|---|---|---|
TrackingTimeout | 3.0 | Seconds without a hostile in sight before the turret resets |
TrackPlayerTimerRate | 0.1 | Seconds between aim updates |
ShootProjectileTimerRate | 0.7 | Seconds between shots |
TrackingActive | true | Track targets |
ShootingActive | true | Fire at targets |
TrackedActor | Current target (read only) | |
TeamID | Copied from the possessed turret |
| Function | Description |
|---|---|
GetTeamAttitude | Friendly, Neutral or Hostile for an actor. Override to change who the turret attacks |
IsHostile | GetTeamAttitude is Hostile |
OnTeamsChanged | Event: call after changing teams at runtime, so the turret re-checks its target |
IsActorStillPerceived | The actor is seen and hostile |
FindOtherHostile | First perceived hostile actor other than the given one |
IsControlledTurretDead | The possessed turret is dead or dying |
Example children in Blueprints/Examples: BP_TurretAIController_01, _02, _03 (sight 600, 1500, 2000 cm) and BP_TurretAIController_AlwaysFriendly.
BP_TurretProjectile
Blueprints/Turret/BP_TurretProjectile: a sphere with a projectile movement component, no gravity, BlockAllDynamic collision and a life span of 5 seconds. InitializeProjectile(Velocity, TrailEffect) is called by the turret right after spawning. Its OnImpact dispatcher reaches the turret's OnProjectileImpact.
Core
AC_Health
Blueprints/Core/AC_Health: health component. Damage arrives through Apply Damage on the owner or through ChangeHealth.
| Property | Default | Description |
|---|---|---|
MaxHealth | 100 | Health at spawn and upper limit (replicated) |
bDamageImmune | false | Ignore damage; healing still applies |
Health | Current health, server-authoritative (RepNotify) | |
DeathState | E_DeathState: NotDead, DeathStarted, DeathFinished (RepNotify) |
| Function or dispatcher | Description |
|---|---|
ChangeHealth(Delta, Instigator) | Server only. Negative damages, positive heals. Starts death at 0 |
GetHealth, GetMaxHealth, GetHealthNormalized, IsDeadOrDying | Queries |
StartDeath, FinishDeath | Server only. Advance the death state |
OnHealthChanged, OnMaxHealthChanged | Dispatchers, fire on every machine |
OnDeathStarted, OnDeathFinished | Dispatchers, fire on every machine |
BFL_Turret
Blueprints/Core/BFL_Turret: function library.
| Function | Description |
|---|---|
CalculateFiringSolution(ShooterPosition, TargetPosition, TargetVelocity, ProjectileSpeed, ShooterVelocity) | Direction to fire so a projectile of that speed intercepts a target moving at constant velocity. Success is false when no interception is possible |
GetTeamOfActor(Actor) | TeamID from BPI_TeamAgent on the actor, or on its controller for a pawn |
GetAttitudeBetweenTeams(TeamA, TeamB) | Same team Friendly, other team Hostile |
BPI_TeamAgent
Blueprints/Core/BPI_TeamAgent: interface with GetTeamID. Implement it on a pawn or its controller to give the pawn a team. Actors without it have no team; a pawn without a team is hostile to turrets.
BP_NumberPop
Blueprints/Core/BP_NumberPop: component that shows damage numbers through NS_DamageNumbers. AddNumberPop(WorldLocation, NumberToDisplay, bIsCriticalDamage).
Damage states and debris
Blueprints/DamageStates/BP_DamageState_Sparks,_Smoke,_Fire: effect actors attached to a damaged turret.Blueprints/Turret/BP_DestroyedTurret1,BP_DestroyedTurret2: debris actors that break apart.
UI
UI/WBP_Healthbar: health bar above a turret (SetHealthPercent).UI/WBP_DemoMessage: the example map's on-screen messages (ShowMessage(Message, Duration)).
Examples
| Blueprint | Purpose |
|---|---|
BP_TeamPlayerController | Player controller with a TeamID, implements BPI_TeamAgent |
BP_TeamPad | Gives the player its team when stepped on, then calls OnTeamsChanged on every turret controller |
BP_ThirdPersonCharacter | Template character with the demo keys (F, T, X) and ShowDemoMessage |
BP_ThirdPersonGameMode | Uses BP_TeamPlayerController and BP_ThirdPersonCharacter |
Animation
Characters/Turret1/ABP_Turret and Characters/Turret3/ABP_Turret2 rotate the turret head from the pawn's TurretRotation.