Verse Library verse

01 Fragment

Defines a custom device that stores a landing spot actor and validates it on game start.

verse-library/using-terrain-prefabs-in-fortnite-creative/01-fragment.verse

# This is a simple Verse script that finds an object in the scene graph
# and prints its name. It doesn't create terrain, but it shows how
# Verse talks to the scene.

using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Simulation }

# Define a simple device that can be placed in the world
# This device will look for a specific object when the game starts
Create_The_Landing_Zone_Device = device:
    # This is a "variable" that holds a reference to an object
    # Think of it like a "Target Lock" on a specific prop
    landing_spot: actor = actor:
        pass # We'll set this in the editor

    # This is an "Event" that runs when the game starts
    # Think of it like the "Battle Bus" leaving the plane
    On_Begin_Play <- ():
        # This checks if our target object exists
        if landing_spot.Is_Valid():
            # This prints the name of the object to the debug screen
            # Think of it like a "Kill Feed" message, but for debugging
            Print("Landing spot found: ", landing_spot.Get_Display_Name())
        else:
            Print("Landing spot not found! Check your scene graph.")

    # This is a "Function" that we can call from other devices
    # Think of it like a "Switch" that turns something on
    Setup_Landing_Spot <- (spot: actor):
        landing_spot = spot

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