Verse Library verse

03 Creating The Verse Script

Subscribes to button activation and awards accolades to the triggering player.

extracted-snippets/documentation/en-us/uefn/using-accolade-devices-in-unreal-editor-for-fortnite/03-creating-the-verse-script.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/using-accolade-devices-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/uefn/using-accolade-devices-in-unreal-editor-for-fortnite.md
# Section:    Creating the Verse Script
 using { /Fortnite.com/Devices }
 using { /Verse.org/Simulation }
 using { /UnrealEngine.com/Temporary/Diagnostics }

 accolade_example := class(creative_device):

     @editable
     Accolades:accolades_device = accolades_device{}
        
     @editable
     ConditionalButton:conditional_button_device = conditional_button_device{}

     OnBegin<override>()<suspends>:void=
         ConditionalButton.ActivatedEvent.Subscribe(BountyComplete)

     # Awards score to the player who activated
     # the ConditionalButton
     BountyComplete(Agent:agent):void=
         Accolades.Award(Agent)
Copy full snippet

Comments

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