### Loop Command Example Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Compound_Commands Demonstrates a loop that fades an object in and out repeatedly. The loop starts at 60000ms, runs for 30 iterations, with each iteration taking 1000ms. The fade-in occurs during the first 500ms of each iteration, and fade-out during the next 500ms. ```osu!Storyboard Sprite,Pass,Centre,"Sample.png",320,240 _L,60000,30 __F,0,0,500,0,1 __F,0,500,1000,1,0 ``` -------------------------------- ### Example .osb Scripting Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/General_Rules This is an example of storyboard scripting code that can be placed into the .osb or .osu file under the [Events] section. ```osu!sb [Events] // Background and Video events // Background colour and image events // Sprite and animation events // Sample and audio channel events ``` -------------------------------- ### Example: White Screen Transition in Storyboard Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Compound_Commands Demonstrates how to use Passing and Failing triggers to create a temporary white screen effect during state transitions. The example uses a large white image sprite to cover the screen for a specified duration. ```osu!Storyboard Sprite,Foreground,Centre,"LargeWhiteImage.png",320,240 _T,Passing,20000,40000 __F,0,0,500,1 __F,0,500,501,0 _T,Failing,20000,40000 __F,0,0,500,1 __F,0,500,501,0 ``` -------------------------------- ### Play Audio Samples in Storyboard Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Audio Examples demonstrating how to play audio files at specific timestamps and layers. The first example plays a music track at 80% volume on the Pass layer, and the second plays a sound effect at 100% volume on the same layer. ```scripting Sample,163520,2,"Audio\Best End.mp3",80 Sample,167201,2,"Audio\sfx\EndG-SmallExplosion.wav",100 ``` -------------------------------- ### Variable Substitution Example Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Variables This example demonstrates how the engine replaces variables with their defined values. Be cautious with short or general variable names as they can be substituted into unintended places. ```osu!sb Sprite,Pass,Centre,"Sample.png",320,240 _C,0,58810,59810,0,255,0 ``` -------------------------------- ### Instantaneous State Changes Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Shorthand Multiple commands with the same start time but different end times can create instantaneous changes. This example shows an image jumping to full opacity halfway through a move command. ```storyboard Sprite,Pass,Centre,"Sample.png",320,240 _F,0,1000,,0.5 _F,0,1500,,1 _M,0,1000,2000,0,0,320,240 ``` -------------------------------- ### Single-line Comment Example Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/General_Rules Demonstrates the syntax for a single-line comment in storyboards. Note that these comments may be removed by the in-game editor. ```General // This is a comment. ``` -------------------------------- ### Move X Event Parameters Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Define start and end X positions for a move event. ```osu!Storyboard Script _MX,[...],startx,endx ``` -------------------------------- ### Shorthand2 Event Notation (Same Start/End Time) Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Use shorthand2 when the start and end time of an event are the same, simplifying the notation. ```osu!Storyboard Script _M,0,1000,1000,320,240,320,240 becomes ``` -------------------------------- ### Same Start and End Values Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Shorthand Abbreviate commands where the start and end values for an event are identical. This is useful for maintaining a specific value over a timespan. The shorthand omits the second instance of the value. ```storyboard Sprite,Pass,Centre,"Sample.png",320,240 _V,0,1000,2000,0.5,2 _F,0,1000,2000,0.75 ``` -------------------------------- ### Move Y Event Parameters Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Define start and end Y positions for a move event. ```osu!Storyboard Script _MY,[...],starty,endy ``` -------------------------------- ### Shorthand for Same Start and End Times Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Shorthand When a command's start and end times are the same, the end time can be omitted. This shorthand is useful for applying a constant state throughout a command's duration. ```storyboard Sprite,Pass,Centre,"Sample.png",320,240 _F,0,1000,,0.5 _M,0,1000,2000,0,0,320,240 // ... more M commands ``` -------------------------------- ### Vector Scale Event Parameters Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Define start and end scale factors for width and height separately using vector scaling. ```osu!Storyboard Script _V,[...],startx,starty,endx,endy ``` -------------------------------- ### Move Event Parameters Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Define start and end positions (x, y) for a move event within the playfield dimensions (640x480). ```osu!Storyboard Script _M,[...],startx,starty,endx,endy ``` -------------------------------- ### Scale Event Parameters Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Specify start and end scale factors for a scale event. 1 equals 100% scale. ```osu!Storyboard Script _S,[...],startscale,endscale ``` -------------------------------- ### Fade Event Parameters Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Specify start and end opacity for a fade event. Opacity ranges from 0 (invisible) to 1 (fully visible). ```osu!Storyboard Script _F,[...],startopacity,endopacity ``` -------------------------------- ### Color Event Parameters Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Define start and end RGB color values for a color event. (255,255,255) is the original color, (0,0,0) is black. ```osu!Storyboard Script _C,[...],r1,g1,b1,r2,g2,b2 ``` -------------------------------- ### Rotate Event Parameters Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Specify start and end angles in radians for a rotate event. Positive angles indicate clockwise rotation. ```osu!Storyboard Script _R,[...],startangle,endangle ``` -------------------------------- ### Sprite and Animation Shorthand Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Cheat_Sheet Use shorthand notation when the start and end values for a sprite or animation event are identical. The blank space in the endtime field is required for standard notation. ```osu! Storyboard Script _M,0,1000,,320,240,320,240 ``` ```osu! Storyboard Script _M,0,1000,,320,240 ``` -------------------------------- ### Sequential Events with Same Duration Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Shorthand Use this shorthand when multiple values for the same event occur sequentially with a consistent duration between each change. The duration is calculated from the start and end times of the first event. ```storyboard Sprite,Pass,Centre,"Sample.png",320,240 _F,0,51000,52000,0,1,0.5,1,0 ``` -------------------------------- ### Storyboard Trigger Syntax Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Compound_Commands Defines the general structure for storyboard triggers, including trigger type, start and end times, and event parameters. This format is used to control when specific storyboard events occur. ```plaintext _T,(triggerType),(starttime),(endtime) __(event),(easing),(relative_starttime),(relative_endtime),(params...) // More events allowed ``` -------------------------------- ### Apply Yellow Color to Sprite Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Commands Applies a yellow color to a sprite over a specified duration. This example demonstrates setting specific RGB values for yellow. ```osu!Storyboard Sprite,Pass,Centre,"Sample.png",320,240 _C,0,58810,59810,255,255,0 ``` -------------------------------- ### Declare Audio Sample Source: https://osu.ppy.sh/wiki/en/Storyboard/Scripting/Audio Use this format to declare an audio sample that will play at a specific time and layer. The volume can be adjusted, with 100 being the default. ```scripting Sample,