using { /Fortnite.com/Devices } using { /UnrealEngine.com/Temporary/Symbols } # We are creating a device that changes the landscape material's "Blend Factor" # when a player enters a trigger. Think of it like a storm circle that changes the terrain type. class MudSlideDevice is Device() # The trigger zone - like a kill box but for mud MudTrigger: Trigger = Trigger() # The landscape material we want to modify # We need to expose this so we can change its parameters MudMaterial: Material = Material() # A parameter in the material named "MudIntensity" (0.0 to 1.0) # 0.0 = Pure Grass # 1.0 = Pure Mud MudIntensityParam: string = "MudIntensity" OnBegin(): void = # Listen for players entering the trigger MudTrigger.OnBeginOverlap.Subscribe(OnPlayerEnter) OnPlayerEnter(overlap_event: TriggerBeginOverlapEvent): void = # Get the player who entered player := overlap_event.Actor.GetPlayer() if (player != null): # "Activate" the mud slide # This is a simplified example. In reality, you'd usually # use SetMaterialParameter on the specific actor or landscape component. # For now, let's assume we have a way to update the material globally # or on a specific landscape component. # WARNING: Directly changing landscape layer weights via Verse # usually requires using Landscape Component APIs or Material Parameters. # Here is the conceptual flow: # 1. Get the Landscape Component under the player # 2. Update the Material Parameter to increase Mud weight # Since we are keeping it simple, we'll just log it. # In a real build, you'd use: # MudMaterial.SetScalarParameterValue(MudIntensityParam, 1.0) Print("Mud slide activated! The terrain is getting dirty.")