BPI_HidingSpotMemory
Interface Functions
Function Name |
Parameters |
Return |
RememberHidingSpots |
|
|
GetRememberedHidingSpots |
|
HidingSpots (Actor Array) |
ForgetHidingSpot |
HidingSpot (Actor) |
bNoMoreHidingSpotInMemory (Boolean) |
BP_ZombieController
Functions
Function Name |
Parameters |
Return |
Description |
RememberHidingSpots |
|
|
This is an implementation of a function in BPI_HidingSpotMemory . This stores the HidingSpotActos in RememberHidingSpots . This is used to remember the hiding spots within the line of sight of the AI. |

Figure 1: RememberHidingSpots Code
Function Name |
Parameters |
Return |
Description |
GetRememberedHidingSpots |
|
HidingSpots (Actor Array) |
This is an implementation of a function in BPI_HidingSpotMemory . This returns RememberedHidingSpots array. |

Figure 2: RememberHidingSpots Code
Function Name |
Parameters |
Return |
Description |
ForgetHidingSpot |
HidingSpot (Actor) |
bNoMoreHidingSpotInMemory (Boolean) |
This is an implementation of a function in BPI_HidingSpotMemory . This removes HidingSpot stored in RememberedHidingSpots , then returns true if the RememberedHidingSpots is now empty. |

Events
Name |
Parameters |
Description |
EventOnPossess |
PossessedPawn (Pawn) |
Runs BT_Zombie Behavior Tree when the controller possesses a pawn. |

Name |
Parameters |
Description |
EventBeginPlay |
|
Sequence 1: binds event that listens to the GM_VRHideAndSeekGameMode to changes in the game mode’s round state. Sequence 2: binds event that listens to BP_VRPawn changes in the VR player’s hiding state. |
OnRoundStartUpdate |
GameState (E_GameState) |
This is called the GM_VRHideAndSeekGameMode changes. If the state is RoundInProgress it will set the bRoundStarted Blackboard Key to true and set it to false if the state is RoundOver . |
OnVrPlayerHidingStateUpdate |
IsHiding (Boolean) |
This is called when BP_VRPawn 's hiding state changes. If the IsHiding is true, the AI will forget the VR player. |

Name |
Parameters |
Description |
EventBeginPlayOnTargetPerceptionUpdated (AIPerception) |
Actor (Actor) , Stimulus (AIStimulus Structure) |
This event is executed when the AIPerception component receives a stimulus update from an Actor . The Actor parameter is the Actor that signals the update and the Stimulus parameter is the updated stimulus. |

Overview of EventBeginPlayOnTargetPerceptionUpdated (AIPerception).

Code for checking whether the updated stimulus is of class sight perception or hearing perception.

Code for handling VRPlayer stimulus. If the VRPlayer is in sight, it will be set as the TargetActor BBKey. If the VRPlayer exits the AI’s line of sight, the TargetActor BBKey will be unset after some time and the LastKnownPlayerLocation BBKey will be set..