Verse Library verse

02 Standalone

Binds an attribute evaluator pass event to dynamically locate and activate a door device by its assigned name.

verse-library/using-attribute-evaluator-devices-in-fortnite-creative/02-standalone.verse

using { /Fortnite.com/Devices }

MyDynamicGate := class(creative_object):

    Gate: Attribute Evaluator = ?
    
    # A variable to hold the required gold. 
    # This is a 'Variable': a container that holds a value that can change.
    RequiredGold: int = 1000

    OnBegin<override>()<suspends>: void=
        # Initially, set the gate's requirement via code? 
        # Note: Attribute Evaluator properties are not directly editable in Verse easily.
        # So, we stick to the Editor setup for the base check.
        # But we can use Verse to *override* the behavior if needed.
        
        # For this tutorial, the Editor setup is sufficient.
        # The Verse part is just to show you how to bind the result.
        
        # Bind the Pass event to open the door
        Gate.PassEvent:Bind(
            func(self):
                # Find the door
                door := self.GetWorld().FindDevice[Prop Mover]("BossDoor")
                door.Activate()
        )

Comments

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