Verse Library verse

04 Prop Team Verse

Manages prop agent scoring, heartbeat movement detection, and tracks remaining props during a round.

extracted-snippets/documentation/en-us/fortnite/prop-hunt-06-adding-the-full-script-in-unreal-editor-for-fortnite/04-prop-team-verse.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/prop-hunt-06-adding-the-full-script-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/fortnite/prop-hunt-06-adding-the-full-script-in-unreal-editor-for-fortnite.md
# Section:    prop\_team.verse
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Fortnite.com/UI }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /UnrealEngine.com/Temporary/UI }
using { /Verse.org/Colors }
using { /Verse.org/Simulation }
# This message is used to print the number of props remaining to all players during a round.
PropAgentsRemainingMessage<localizes>(Count:int):message = "{Count} Prop(s) Remaining"
# Inheriting from the base_team class, the prop_team class contains the device definitions and functions related to the prop team and its agents.
# Notably, a prop agent's heart beat behavior can be found in this class.
prop_team := class<concrete>(base_team):
@editable # The score a prop agent receives per second.
ScorePerSecond:int = 10
@editable # The minimum distance a prop agent must move to reset the heart beat timer.
MinimumMoveDistance:float = 100.0
@editable # The timer device used to award score to a prop.
ScoreTimer:timer_device = timer_device{}
@editable # This tracker device is used to display the props remaining to the screen.
PropsRemainingTracker:tracker_device = tracker_device{}
@editable # Get the properties from the heart_beat class.
HeartBeat:heart_beat = heart_beat{}
# Set the agent to a prop agent and assign heartbeat warning UI.
InitializeAgent<override>(NewPropAgent:agent):void =
Logger.Print("Setting a new prop agent.")
(super:)InitializeAgent(NewPropAgent)

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