Verse Library verse

02 Play Heartbeat Effects At A Location

Defines editable heartbeat timer, VFX, audio, and UI properties for prop hunt players.

extracted-snippets/documentation/en-us/fortnite/prop-hunt-02-playing-visual-effects-on-players-in-unreal-editor-for-fortnite/02-play-heartbeat-effects-at-a-location.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/prop-hunt-02-playing-visual-effects-on-players-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/fortnite/prop-hunt-02-playing-visual-effects-on-players-in-unreal-editor-for-fortnite.md
# Section:    Play Heartbeat Effects at a Location
log_heart_beat := class(log_channel){}
# These messages are used to notify a prop agent with a message (or to hide it) when they need to move to avoid their heartbeat from becoming visible.
HeartBeatWarningMessage<localizes>(Time:int):message = "Heart Beat in {Time} Seconds. Move!"
HeartBeatWarningClear<localizes>:message = ""
# This class exposes the editable properties for the heartbeat to the prop_hunt Verse device.
heart_beat := class<concrete>():
Logger:log = log{Channel:=log_heart_beat}
@editable # The number of seconds before a prop agent must move before the heartbeat reveals their position.
MoveTime:float = 15.0
@editable # The seconds remaining before the heartbeat warning appears. Shouldn't be > than HeartBeatTimer.
WarningTime:float = 5.0
@editable # An array of heartbeat VFX devices. There is one per player.
AgentVFX:[]heartbeat_vfx = array{}
@editable # The Radio Player device used to play the heartbeat sound effects (SFX).
SFXPlayer:radio_device = radio_device{}
# This map associates a UI for displaying the heartbeat warning to each prop agent.
var WarningUI:[agent]heartbeat_warning_ui = map{}
# Keeps track of how many players have an active heartbeat so we can manage the SFX device.
var NumberOfHeartBeats:int = 0
# Sets up heartbeat UI for the agent.
SetUpUI(PropAgent:agent):void =
if:
not WarningUI[PropAgent]
AsPlayer := player[PropAgent]
PlayerUI := GetPlayerUI[AsPlayer]
then:
UIData:heartbeat_warning_ui = heartbeat_warning_ui{}

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in