Verse Library verse

01 6 Managing The Game Loop

Defines the main custom device class for a minigame, storing player state, device references, and communication events.

extracted-snippets/documentation/en-us/uefn/verse-starter-template-6-managing-game-loop-in-unreal-editor-for-fortnite/01-6-managing-the-game-loop.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/verse-starter-template-6-managing-game-loop-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/uefn/verse-starter-template-6-managing-game-loop-in-unreal-editor-for-fortnite.md
# Section:    6. Managing the Game Loop
# A Verse-authored creative device that can be placed in a level
verse_commander_minigame := class(creative_device):
# The HUD Controller device for the minigame.
@editable
HUDController<private>:hud_controller_device = hud_controller_device{}
# The button that starts the minigame.
@editable
PlayVerseCommanderButton:button_device = button_device{}
# The NPC spawner that spawns the NPC used in the minigame.
@editable
NPCSpawner:npc_spawner_device = npc_spawner_device{}
# An array of gameboards that the user can customize in the editor.
# Each element in this array is a level that the character has to complete.
@editable
var Gameboards<private>:[]gameboard = array{}
# The cinematic sequence used to show off design billboards.
@editable
Cinematic:billboard_cinematic = billboard_cinematic{}
# A variable to track which gameboard the character is currently on.
var CurrentBoard<private>:int = 0
# Whether this is the first time a gameboard has been played. Used to know when to play
# intro VFX for the board.
var FirstTimeOnCurrentBoard<private>:logic = true
# Minigame events that the character and Verse device can use to communicate with each other.
ExecuteCommandsEvent:event(tuple([]command, vector3)) = event(tuple([]command, vector3)){}
BoardResetEvent:event(transform) = event(transform){}
GameStartedEvent:event() = event(){}

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