using { /Fortnite.com/Devices } using { /UnrealEngine.com/Temporary/SpatialMath } using { /Verse.org/Simulation } # This is our main script. It runs when the device is placed. 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() Back_Barrier.Enable() Left_Barrier.Enable() Right_Barrier.Enable() # 4. HELPER: print a simple status message so you can confirm the # script ran correctly when you check the Output Log in UEFN. Log_Status(WallName : string) : void = Print("Arena wall active: {WallName}") # This is the entry point. The game calls this to start the script. OnBeginPlay() : void = Setup() Log_Status("Front") Log_Status("Back") Log_Status("Left") Log_Status("Right")