1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API Timelines 1.0.0

Create shows and effects in sync with music

Tags:
  1. Lego_freak1999
    Contributors:
    Lego_freak1999, TPGamesNL
    Supported Minecraft Versions:
    • 1.12, 1.13, 1.14
    This skript api allows you to work with timelines.

    A timeline is a list of timecodes that execute code in a chronological time spectrum.

    A timecode is a timestamp formatted like this:

    Code (Text):
    1.  
    2. HH::MM::SS::mmm
    3.  
    4. H = Hours
    5. M = Minutes
    6. S = Seconds
    7. m = Milliseconds
    8.  
    This is a offset time to the start point of the timeline.

    Timelines are not made to replace
    But timelines are a great replacement if u want to time shows/effects in sync with audio.

    1:
    Because of the use of timecodes ur code is alot more cleaner and readable wenn making a timed code.
    2:
    No server lag desync. No this doesn't make ur server less laggy, But wenn the server experiences lag the timeline makes shure it will still execute code at the right time and will catch-up after a huge lagg spike.

    The use of timelines isn't as efficient as just using


    Code (Text):
    1.  
    2. Expressions:
    3. (start|new|create) timeline
    4. [timecode] %HH%::%MM%::%SS%::%mmm%
    5.  
    6. Effects:
    7. (stop|delete) timeline %timeline%
    8. wait for %timecode% in %timeline%
    9.  

    Code (Text):
    1.  
    2.  
    3. #Example Basic timeline
    4.  
    5. command /basictimeline:
    6.    trigger:
    7.        set {_timeline} to start timeline
    8.        wait for timecode 00::00::01::000 in {_timeline}
    9.        send "1 second later"
    10.        wait for timecode 00::00::02::000 in {_timeline}
    11.        send "2 seconds later"
    12.        wait for timecode 00::00::03::000 in {_timeline}
    13.        send "3 seconds later"
    14.        delete timeline {_timeline}
    15.  
    16. #Example stop a timeline
    17.  
    18. command /stopabletimeline:
    19.    trigger:
    20.        set {timeline} to start timeline
    21.        set {_timeline} to {timeline}
    22.        wait for timecode 00::00::01::000 in {_timeline}
    23.        send "1 second later"
    24.        wait for timecode 00::00::02::000 in {_timeline}
    25.        send "2 seconds later"
    26.        wait for timecode 00::00::03::000 in {_timeline}
    27.        send "3 seconds later"
    28.        delete timeline {_timeline}
    29.        delete {timeline}
    30.  
    31. command /stoptimeline:
    32.    trigger:
    33.        stop timeline {timeline}
    34.        delete {timeline}
    35.  

    Using delayed effects in a timeline can cause the next timecodes to trigger tolate.

    Timecodes should be later than timecodes before them.

    Not deleting the timeline isn't a problem but will cause variables to stackup till a restart.

    Code (Text):
    1.  
    2.  
    3. #Example how !!!not!!! to use
    4.  
    5. function test():
    6.    wait 4 seconds
    7.    send "2"
    8.  
    9. command /Wrongtimeline:
    10.    trigger:
    11.        set {_timeline} to start timeline
    12.        wait for timecode 00::00::01::000 in {_timeline}
    13.        send "1"
    14.        wait 4 seconds # Using delays or delayed effects here can cause the next timecodes to trigger tolate. In this example the 3 will be send >1 second tolate.
    15.        send "2"
    16.        test() #U can run a function or custom effect if u still want to use delays without messing up timecodes.
    17.        wait for timecode 00::00::04::000 in {_timeline}
    18.        send "3"
    19.        wait for timecode 00::00::03::000 in {_timeline} #Timecodes should be later than timecodes before them.
    20.        send "4"
    21.        #Not deleting the timeline isn't a problem but will cause variables to stackup till a restart.
    22.  

    Pause and continue timelines

    Jump to a timecode in a timeline (forwards and backwards)

    2.0 version wich supports using delayed effects inside of timelines

    Hook with my other resource McJukeBox Api

    Suggestions?