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.


Discussion in 'APIs' started by Lego_freak1999, Mar 10, 2020.

  1. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Jan 26, 2017
    Likes Received:
    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):
    2. HH::MM::SS::mmm
    4. H = Hours
    5. M = Minutes
    6. S = Seconds
    7. m = Milliseconds
    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.

    Because of the use of timecodes ur code is alot more cleaner and readable wenn making a timed code.
    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):
    2. (start|new|create) timeline
    3. (stop|delete) timeline %timeline%
    4. [timecode] %HH%::%MM%::%SS%::%mmm%
    5. wait for %timecode% in %timeline%

    Code (Text):
    3. #Example Basic timeline
    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}
    16. #Example stop a timeline
    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}
    31. command /stoptimeline:
    32.    trigger:
    33.        stop timeline {timeline}
    34.        delete {timeline}

    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):
    3. #Example how !!!not!!! to use
    5. function test():
    6.    wait 4 seconds
    7.    send "2"
    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.

    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


Share This Page