Verse Library verse

01 Fragment

Tracks player overlap to save and load custom checkpoint coordinates in your island.

verse-library/using-player-checkpoint-pad-devices-in-fortnite-creative/01-fragment.verse

# CheckpointController.verse
# This script manages the player's last known safe location.

using { /Fortnite.com/Devices }
using { /Verse.org/Sim }

# We define a "Struct" (think of it as a custom data type) to hold our checkpoint data.
# Imagine this as a "Save File" format.
struct CheckpointData {
    SpawnPoint: vector # The X, Y, Z coordinates of the save point
    IsSaved: bool    # A flag to remember if we have a save point yet
}

# This is the main device script. It attaches to a device in your island.
actor CheckpointManager is Actor {
    # These are "Properties" (variables) we can set in the editor.
    # Think of these as the "Device Options" you see in the sidebar.
    checkpoint_zone: volume = Volume{} # The zone player must touch
    player_spawn: player_spawn_pad = PlayerSpawnPad{} # The default spawn

    # This is the "State" of our manager.
    # It starts with no save point.
    current_checkpoint: CheckpointData = CheckpointData{
        SpawnPoint: vector{0, 0, 0},
        IsSaved: false
    }

    # This is the EVENT.
    # It triggers when a player enters the volume.
    # Analogy: This is the "Doorbell Ringing."

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