Verse Library verse

26 Medic Example Verse

Defines the primary NPC behavior class for a medic bot with healing logic and delays.

extracted-snippets/documentation/en-us/uefn/create-your-own-npc-medic-in-verse/26-medic-example-verse.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/create-your-own-npc-medic-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/create-your-own-npc-medic-in-verse.md
# Section:    medic\_example.verse
using { /Fortnite.com/AI }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Verse.org/Colors }
using { /Verse.org/Random }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }

# A Verse-authored NPC Behavior that can be used within an NPC Definition or a Character Spawner device's Behavior Script Override.
medic_example<public> := class(npc_behavior):
    # The HP threshold a character must be at before healing them.
    @editable
    HealingThreshold:float = 50.0

    # How long to wait before healing characters
    @editable
    HealingDelay:float = 1.5

    # How much to heal characters per healing instance
    @editable
    HealingAmount:float = 5.0

    # The volume characters enter to receive healing.
    @editable
    HealVolume:mutator_zone_device = mutator_zone_device{}

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