Timelines

API Timelines 1.0.0

  • 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!

Contributors
Lego_freak1999, TPGamesNL
Supported Minecraft Versions
  1. 1.12
  2. 1.13
  3. 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:
HH::MM::SS::mmm

H = Hours
M = Minutes
S = Seconds
m = Milliseconds

This is a offset time to the start point of the timeline.

Timelines are not made to replace
wait %time span%

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
wait %time span%


Code:
Expressions:
(start|new|create) timeline
[timecode] %HH%::%MM%::%SS%::%mmm%

Effects:
(stop|delete) timeline %timeline%
wait for %timecode% in %timeline%

Code:
#Example Basic timeline

command /basictimeline:
   trigger:
       set {_timeline} to start timeline
       wait for timecode 00::00::01::000 in {_timeline}
       send "1 second later"
       wait for timecode 00::00::02::000 in {_timeline}
       send "2 seconds later"
       wait for timecode 00::00::03::000 in {_timeline}
       send "3 seconds later"
       delete timeline {_timeline}

#Example stop a timeline

command /stopabletimeline:
   trigger:
       set {timeline} to start timeline
       set {_timeline} to {timeline}
       wait for timecode 00::00::01::000 in {_timeline}
       send "1 second later"
       wait for timecode 00::00::02::000 in {_timeline}
       send "2 seconds later"
       wait for timecode 00::00::03::000 in {_timeline}
       send "3 seconds later"
       delete timeline {_timeline}
       delete {timeline}

command /stoptimeline:
   trigger:
       stop timeline {timeline}
       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:
#Example how !!!not!!! to use

function test():
   wait 4 seconds
   send "2"

command /Wrongtimeline:
   trigger:
       set {_timeline} to start timeline
       wait for timecode 00::00::01::000 in {_timeline}
       send "1"
       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.
       send "2"
       test() #U can run a function or custom effect if u still want to use delays without messing up timecodes.
       wait for timecode 00::00::04::000 in {_timeline}
       send "3"
       wait for timecode 00::00::03::000 in {_timeline} #Timecodes should be later than timecodes before them.
       send "4"
       #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

Hook with my other resource McJukeBox Api

Suggestions?
Author
Lego_freak1999
Downloads
103
Views
399
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Lego_freak1999