Log in

View Full Version : Help understanding simple script


Floatingshed
25th May 2014, 09:43
I'm experimenting with making scrolling credits and I found and copied this script:

Blackness(length=1000, width=720, height=404, pixel_type="YV12", fps=25, fps_denominator=1, audio_rate=48000, stereo=True, sixteen_bit=True, color=$000000)
V=last

function credits (clip video, int sf, int ef, string words)
{
Animate(video, sf, ef, "subtitle", words, -1, 780, sf, ef, "Tahoma", 30, $FFFFFF, words, -1, -450, sf, ef, "Tahoma", 30, $FFFFFF)
}

V1=credits(V, 40, 200, "kjhjfdskhdkhfkdfhkdjfhkdsjc")
V2=credits(V1, 60, 220, "kkklscslkcjlskjcksjchksjhcksjchkshc")
V3=credits(V2, 80, 240, "jkcxjsudhd")
V4=credits(V3, 100, 260, "jusjxdskaxdkaxhj")
V5=credits(V4, 120, 280, "ojkdiwudgqwkhjsbi9q7uyhu")
V6=credits(V5, 140, 300, "salijdhuaiuhxoajx")
V7=credits(V6, 160, 320, "wouhdiuwydyughdj")
V8=credits(V7, 180, 340, "jsauduajdahoklsjqdiuoajxsalkjdoisuagdchs")
V9=credits(V8, 200, 360, "kusahiouxdhasoudy8owuihdopwu8d")
V10=credits(V9, 220, 380, "djduyuedbgdj")
V10

This does exactly what I want it to do, but despite reading the documentation for animate I still don't understand how and why it works. Where do the variables: "sf", "ef" and "words" get their values?

If anyone has the time to explain it in easy steps I'd appreciate it, thanks.

Bloax
25th May 2014, 09:59
If you look at this:

function credits (clip video, int sf, int ef, string words)
{
Animate(video, sf, ef, "subtitle", words,
}

And then this:

V1=credits(V, 40, 200, "kjhjfdskhdkhfkdfhkdjfhkdsjc")

You might see that the first argument is the video you assign to it, the second argument (40) being "int sf", the third (200) being "int ef" - and the fourth ("kjhjdskhdkhfkdfhkdj..") being "string words"
And since "int" and "string" are just input types (numbers without decimals and "text in quotation marks" respectively); the second argument in credits(V, 40, 200, "kjhjfdskhd") is then "sf" (and thus 40), third "ef" (200) and the fourth "words".

Floatingshed
25th May 2014, 18:54
Of course, sorry my brain seems to be failing!

I now understand the arguments being passed to the function,
although I still don't see why "ef" and "sf" are repeated twice.

I don't seem to be able to grasp animate at all!

Thanks.