# SyncDanceController.ver # This script makes the Character Device Controller force all linked characters # to perform a specific emote when triggered. using { /Fortnite.com/Devices } using { /Verse.org/Sim } using { /UnrealEngine.com/Temporary/Symbols as E } # This is our main script structure. # Think of 'SyncDanceController' as the name of the 'Brain' for this device. sync_dance_controller := class(creative_device): # VARIABLE: The Remote Control # We need a variable to hold a reference to the Character Device Controller. # In game terms, this is like holding the actual remote in your hand. # 'CharacterDeviceController' is the type of the object. # ':=' means "assign this right now." controller : CharacterDeviceController = character_device_controller # VARIABLE: The Emote to Play # We want to store which emote we want them to do. # This is like choosing the song on the playlist. # We use a 'string' (text) to identify the emote name. dance_emote : string = "emote_floss_v01" # EVENT: OnBeginPlay # This runs once when the game starts. # It's like the "Soundcheck" before the concert. OnBeginPlay() -> unit: # For now, we just log a message to the debug console. # This helps us know the script is loaded. print("Dance Party Ready! Step on the trigger!") # FUNCTION: TriggerDance # This is the action we call when a player hits the trap. # 'public' means other devices (like our Trigger) can call this. # It takes no inputs ('-> unit'). TriggerDance() -> unit: # This is the core logic. # We tell the 'controller' variable to change its emote. # The syntax is: controller.SetEmote(emote_name) # NOTE: In real Verse, you might need to use specific APIs to set emotes. # However, for this beginner concept, we simulate the command structure # to show the *logic* of how the controller affects the group. # If we were using the full UE6 API, it might look like: # controller.SetCurrentEmote(dance_emote) # Since we are keeping it simple and device-focused for this tutorial, # let's assume the Controller device has a built-in way to respond # to Verse signals, or we simply print what we *would* do. print($"Forcing {controller} to play {dance_emote}!") # In a full implementation, you would connect this function # to a Trigger Volume's 'OnAct' event. # EVENT: OnAct # This event fires when another device (like a Trigger Volume) sends a signal. # It's like the director getting a text message from the stage manager. OnAct() -> unit: # When the trigger fires, call our dance function. TriggerDance()