Verse Library verse

02 Fragment

Imports Unreal Engine asset modules and initializes a script container to execute setup logic on game start.

verse-library/how-to-use-unrealengine-api-module-declarations-in-verse-uefn/02-fragment.verse

# This is our main script file. Think of it as the "Brain" of our device.

# STEP 1: Import the Modules (Open the Toolboxes)
# We need the Devices module to talk to standard Fortnite devices.
# This is usually imported by default, but it's good practice to be explicit.
using { /Fortnite.com/Devices }

# STEP 2: Import the Unreal Engine Module
# This is the new stuff! We are importing the 'Assets' module.
# This gives us access to functions like 'Create' or 'SetMaterial' 
# that aren't available in standard devices.
using { /UnrealEngine.com/Assets }

# STEP 3: Define our Script
# This is the container for our logic.
MyAssetScript := script()
{
    # We'll add our logic here later, but for now, 
    # just know that any function we write inside here 
    # can now use the tools from /UnrealEngine.com/Assets
    
    # Example of what you WOULD do next (pseudo-code for context):
    # OnBegin() is a function that runs when the game starts.
    OnBegin() override() : void = 
    {
        # If we had a reference to a Prop, we could do this:
        # my_prop.SetMaterial(MyCustomMaterial)
        
        # But for this tutorial, we just want to prove 
        # the modules are imported correctly.

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