Condition

type
Condition<native><epic_internal>: injected_condition
Module
AI
Declared in
behavior_tree_injection
Source
fortnite

Used in

else:
                TeamBlueTier = NewTier
                
            // Grant the next weapon
            GrantWeapon(InKiller, NewTier)
            
            // Check for Win Condition
            CheckWinCondition(InKiller.GetTeam())

    // 5. Grant Weapon Helper Function
    // Think of this as a mini-recipe for giving items
    GrantWeapon(InPlayer: player, Tier: int) -> void:
        // Make sure the tier isn't higher than our weapon list
create_arena_device := class(creative_device):

    # 1. DEFINE THE ARENA SIZE
    # Think of this like setting the "Win Condition" or "Match Settings"
    # We use named constants because these numbers won't change during the game.
    # Distances are in centimetres in Unreal Engine (2000.0 = 20 metres).
    Arena_Width : float = 2000.0
    Arena_Depth : float = 2000.0
    Arena_WallHeight : float = 500.0   # How tall each wall panel is
    Arena_Thickness : float = 50.0     # How thick the walls are

    # Reference to a barrier device that must be placed and wired in the editor.
    # Duplicate it in UEFN for each of the four walls and assign each below.
    # note: Verse cannot spawn barrier_device instances at runtime; they must
    # be pre-placed in the editor and referenced here as editable properties.
    @editable
    Front_Barrier : barrier_device = barrier_device{}

    @editable
    Back_Barrier : barrier_device = barrier_device{}

    @editable
    Left_Barrier : barrier_device = barrier_device{}

    @editable
    Right_Barrier : barrier_device = barrier_device{}

    # 2. THE SETUP FUNCTION
    # This runs once when the game starts, like the "Pre-Game Lobby" phase.
    Setup() : void =
        # We need to know where the device itself is placed in the world.
        # This is like checking your GPS location.
        My_Transform := GetTransform()
        My_Location  := My_Transform.Translation

        # 3. ACTIVATE THE BARRIERS
        # Each barrier_device was pre-positioned in the editor to match the
        # arena corners. We simply enable them here so they block players
        # and projectiles from the moment the game starts.
        Front_Barrier.Enable()
# note: stat_powerup_device exposes GrantToAgent; point value
                # is configured in the device's UEFN property panel (set to 1).

                # Read the player's current score from the stat creator device
                # and check whether they have reached the win threshold.
                # note: Score comparison is handled through Island Settings
                # Victory Condition (Score >= WinScore) configured in UEFN,
                # because stat values are read server-side by the engine.
                Print("Point collected! Reach {WinScore} to win!")
# This is your storm timer, but for the whole match
    timer.Start(60.0)
    
    # Update our scoreboard variable
    is_game_active = true

# 3. The Victory Condition (Event Handling)
# This code runs ONLY when the button is pressed.
# It's like an elimination notification popping up.
OnButtonPressed := func() -> void:
    if is_game_active:
        # Stop the clock!
        timer.Stop()
# 1. Define the MAX_SCORE constant.
# This is like the "Win Condition" points. It’s set once in the editor and never changes.
const MAX_SCORE: int = 100

# 2. Define the current score variable.
# We use 'constrained' to set limits.
# min: 0 (You can't have negative points)
# max: MAX_SCORE (You can't have more than 100 points)
TagSystem / Resource Tags verse-source
# Temperature/physical states
    melted_tag<public> := class(item_state_tag){}
    frozen_tag<public> := class(item_state_tag){}
    cold_tag<public> := class(item_state_tag){}
    hot_tag<public> := class(item_state_tag){}

    # Condition states
    damaged_tag<public> := class(item_state_tag){}
    broken_tag<public> := class(item_state_tag){}
    rusted_tag<public> := class(item_state_tag){}
    corroded_tag<public> := class(item_state_tag){}
    pristine_tag<public> := class(item_state_tag){}
    worn_tag<public> := class(item_state_tag){}
MiniGameSystem / Minigame Controller verse-source
Logger.Print("{MinigameName} - Player Counted - {CurrentPlayers} of {TargetPlayers} but did not match Start Condition", ?Level := log_level.Warning)

    InviteUnregisteredPlayers(Player:player)<suspends>:void =
        if (PopupDialogDevice := JoinMinigamePopupDialogDevice?):
            for (PlayerAlreadyRegistered : RegisteredPlayers):
                if (Player <> PlayerAlreadyRegistered):
                    JoinNotification(Player)