Verse Library verse

03 Device

Choreographs multi-device animations using asynchronous coroutines to trigger sequenced visual and audio performances.

verse-library/verse-skel-grand-reveal-capstone/03-device.verse

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

# THE GRAND REVEAL — orchestrate a sequenced show from Verse.
#
# This capstone ties the whole domain together. One Button kicks off a timed,
# multi-beat performance that the THREE animation surfaces you've met take turns
# driving:
#
#   beat 1  Cinematic Sequence  — a camera flythrough rolls (Part 2 + Part 3)
#   beat 2  Animated Mesh        — a skeletal performer animates (Part 1)
#   beat 3  Character device     — the host mannequin emotes (PlayEmote)
#   finale  Audio Player         — a fanfare, then the rate is reset for next time
#
# The magic is the orchestration. OnGo can't wait (it must return immediately),
# so it `spawn`s a <suspends> coroutine, RunReveal, which runs the beats IN ORDER:
# it uses StoppedEvent.Await() to block until the cinematic actually finishes, and
# Sleep() to hold each later beat for a set time. That's how you choreograph
# animations across devices on a single shared timeline.
#
# A guard (var Running) stops a second press from starting an overlapping show.
# The Cinematic Sequence device should be set to *Everyone* (or pass the agent on
# every call). Here we pass the instigating agent so it works in either mode.
grand_reveal_device := class(creative_device):

    @editable
    StartButton : button_device = button_device{}

    @editable

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

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