Sauerworld Forum

Simple TimeLapse Command

Salatiel

  • ***
  • 116
  • +25/-1
    • Projects by Salatiel
Simple TimeLapse Command
« on: September 02, 2017, 10:10:10 PM »
Hi, this is a simple command i made, and for some reason i have not posted it here yet...   :D
The command takes screenshots every X thous...
The original idea was a Command to create Gifs in Sauerbraten, but with the end result, I think it's more useful for creating TimeLapses...

Add this to the Sauerbraten root folder (or mygames/sauerbraten)

I suggest you download the attachment, or copy the code below and create a file with the original name (gifmaker.cfg)

How to use:
/giftype (File) (Sleep) (Amount) (Debug 0/1)
and
/screengif

Example:
/giftype GifDir01 500 10 1


Blue text is the 'debug' can be deactivated by choosing between 1/0

Code: [Select]
gifhelp = [
clearconsole ;
echo "^f2Gifmaker Help:"
echo "^f1----------------------------------"
echo "^f4/screengif to start"
echo "^f7/giftype DIR TIME END DEBUG"
echo "^f7Dir = The file to save the Gif"
echo "^f7Time = The time to take screenshot "
echo "^f7End = The num of screenshots to take "
echo "^f7Debug = show screen prop in the echo, every *Time* 0/1"
echo "^f4Example: /giftype GifDir01 1000 15 1"
echo "^f1----------------------------------"
echo "^f2Press F11 to close this window"
toggleconsole
]

screengifcount = 0
defaultscreendir = $screenshotdir
gifdebug = "1"
gifcanwork = "no"
giftype = [
echo "^f0" saved | gif dir: $arg1 | giftime: $arg2 | gifend $arg3 | Gifdebug $arg4 | ;

echo "^f2 please, fix any error, or type /screengif to continue"

gifdir = $arg1
giftime = $arg2
gifend = $arg3
gifdebug = $arg4
gifcanwork = "yes"

if (< $gifdebug 0)[echo "^f3Error: max value to Gifdebug its 1 or 0" ; clearsleep]
if (> $gifdebug 1)[echo "^f3Error: max value to Gifdebug its 0 or 1" ; clearsleep]
]
screengif = [
if (strcmp $gifcanwork "no")[echo "^f3Error: Please, do /giftype. example: /giftype gifDir1 500 10 1"][
screenshotdir $gifdir

screengifcount = (+ $screengifcount 1) ;
screenshot $screengifcount ;

if (= $gifdebug "1")[
hidehud 0 ;
echo Screenshoted: $screengifcount .png in $gifdir dir, every $giftime thous, will finish in $gifend . ;
]



if (= $screengifcount $gifend)[clearsleep ; screenshotdir $defaultscreendir ; sleep 300 [exec gifmaker.cfg] ; if (strcmp $gifdebug "1")[echo "^f0Done"]][
sleep $giftime [screengif] ;
]
]
]
« Last Edit: September 02, 2017, 10:32:22 PM by Salatiel »
@Salatiel#5274