using { /Fortnite.com/Devices } using { /Fortnite.com/Characters } using { /Verse.org/Simulation } using { /UnrealEngine.com/Temporary/Diagnostics } # We are defining a "Device" which is a reusable block of Verse logic. # Think of it as a custom Device type you can place in your level. title_sequence_device := class(creative_device): # --- CONSTANTS: The "Locked" Settings --- # These are like the fixed map boundaries. They don't change. # We link this to a Fixed Point Camera in the editor. # Drag your gameplay_camera_fixed_point_device from the level into this slot. @editable SplashCamera : gameplay_camera_fixed_point_device = gameplay_camera_fixed_point_device{} # We link this to our Pop-Up Dialog Device in the editor. # This is the "Loot Drop" container for our menu. @editable MenuDialog : popup_dialog_device = popup_dialog_device{} # --- VARIABLES: The "Changing" State --- # This is like the "Game State" flag. Is the game started or not? # Starts as FALSE (game hasn't started). var GameStarted : logic = false # --- FUNCTIONS: The Actions --- # This function is like a "Prop Mover" that moves the camera. # It activates the splash camera sequence, waits, then shows the menu. StartIntroSequence() : void = # "Print" is like shouting in chat. It shows text in the debug console. Print("Intro sequence started!") # We tell the splash camera device to activate (play its cinematic view). # In Verse, we call methods on the device reference to change its state. SplashCamera.AddToAll() # We wait 3 seconds (like a storm timer) before showing the menu. # This gives the player time to absorb the hype. Sleep(3.0) # Now we show the menu. ShowMenu() # This function shows the Pop-Up Dialog device we configured in the editor. ShowMenu() : void = # Show the dialog for every player currently in the session. # GetPlayspace().GetPlayers() returns all active players. for (Agent : GetPlayspace().GetPlayers()): # Show the pop-up dialog to each player. # Configure the dialog's message and button text in the editor's # device properties panel, or via set_text / set_option_button calls. MenuDialog.Show(Agent) # --- EVENTS: The Triggers --- # This function runs automatically when the level begins. # It's like the "On Begin Play" event on a Trigger. OnBegin() : void = # Wire up the dialog's primary button so pressing it starts the game. # ButtonClickedEvent(0) fires when the player clicks the first button. MenuDialog.ButtonClickedEvent(0).Subscribe(OnStartPressed) # Start the whole sequence! StartIntroSequence() # This function runs when a player clicks the primary button on the dialog. # It's like the "On Interact" event. # note: popup_dialog_device button events pass the interacting agent directly. OnStartPressed(Agent : agent) : void = # If the game hasn't started yet... if (GameStarted = false): # Mark the game as started (change the variable). set GameStarted = true # Hide the menu (turn off the light). MenuDialog.Hide(Agent) # Print a message to debug. if (Player := player[Agent]): Print("Game Started!") # HERE IS WHERE YOU WOULD ADD CODE TO: # 1. Spawn the player in the game area. # 2. Give them weapons. # 3. Start the storm. # For now, we just log it!