Verse Library verse

01 Standalone

Defines a public data module to store and share potion configuration values across scripts.

verse-library/creating-custom-modules/01-standalone.verse

# PotionData.verse
# This is our "Loot Pool" file. It holds the data, but doesn't run the game logic.

# Define a module named PotionData
PotionData<public> := module:

    # We want other scripts to be able to read this variable.
    # Think of this as the "Name Tag" on the potion item.
    PotionName<public><localizes>:message = "Health Potion"

    # This is how much health it restores.
    # Like the number on a medkit.
    HealAmount<public> : int = 50

    # This is the cooldown time in seconds.
    # Like the timer on a respawn beacon.
    CooldownTime<public> : float = 10.0

Comments

    Sign in to vote, comment, or suggest an edit. Sign in