Typetting with automation using lua part 2..

Continuing from my previous post, let’s dive into the main course, which is the effects

—————————— E F F E C T S ————————————————————————–

–sylables effect
l=result.add()
l.layer=11
l.text = string.format(“{\\an5\\pos(%d,%d)\\t(0,30,\\fscx140\\fscy160\\1c&HFDF0EE&\\3c&HFFFFFF&)\\t(30,%d,\\3c&H000000&\\fscx100\\fscy100\\alpha&HFF&)}%s”,x,y,syl.duration*10+200,syl.text_stripped)
l.start_time = line.start_time + syl.start_time/10
l.end_time = line.start_time + syl.start_time/10 + syl.duration + 20

–Make hearts fly about
for i=0,30 do
l = result.add()
l.layer=0
l.text = string.format(“{\\an5\\move(%d,%d,%d,%d)\\alpha&H80&\\fscx65\\fscy65\\t(\\alpha&HF7&\\fscx20\\fscy20)}{\\p1}m -4 -9 b -3 -9 -4 -9 -4 -9 b -4 -9 -4 -9 -4 -9 b -9 -13 -12 -11 -13 -9 b -15 -6 -11 -1 -8 2 b -8 2 -6 4 -4 6 b -2 4 0 2 0 2 b 3 -1 7 -6 5 -9 b 4 -11 1 -13 -4 -9 {\\p0}”, x+math.random(-8,8)+15, y+math.random(-8,8)+10, x+math.random(-40,10)+15, y+math.random(-15,30)+10,  syl.text)
l.start_time = line.start_time + syl.start_time/10
l.end_time = line.start_time + syl.start_time/10 + syl.duration + i*4
end

Lets break it down. First up. The syllable effects

–sylables effect
l=result.add()
l.layer=11
l.text = string.format(“{\\an5\\pos(%d,%d)\\t(0,30,\\fscx140\\fscy160\\1c&HFDF0EE&\\3c&HFFFFFF&)\\t(30,%d,\\3c&H000000&\\fscx100\\fscy100\\alpha&HFF&)}%s”,x,y,syl.duration*10+200,syl.text_stripped)
l.start_time = line.start_time + syl.start_time/10
l.end_time = line.start_time + syl.start_time/10 + syl.duration + 20



\\t(0,30,\\fscx140\\fscy160\\1c&HFDF0EE&\\3c&HFFFFFF&)

It means at 0 to 0.30 second from starting time the characters will :

  • expand 140% in x axis direction and 160% in y axis direction
  • the primary color gonna change into the &HFDF0EE& (if you are wondering what is this, this is a hexagonal numeric code for colors ranging from 0-9 then continues from A to F, no need to memorize this, aegis provide you with the conversions) and the tertiary color (border color) will become &HFFFFF&
  • why 0 to 0,30 second you ask again? Well, this is something that’s empirical, meaning this numbers are based on my sole experience is the most suitable as it is not so fas not so slow to initiate an effects.

\\t(30,%d,\\3c&H000000&\\fscx100\\fscy100\\alpha&HAA&) and %d defines by syl.duration*10+200

This series of tags give us ,from 0.30 second till the syllable duration + 0,2 second the characters will :

  • The border color became &H000000 (incase you are wondering this is black)
  • The characters will shrink to normal size (100%) of x and y axis
  • The characters will hit a transparency of total about 60-70% when it gets the end of durations + 0,2 second

Next stop the heart effects, but before that I’m gonna tell you about arranging the definition, incase you haven’t noticed it the definition needs to be arranged properly to get its definite definition for example , If you have something like this :

\\pos(%d,%d)\\t(0,30,\\fsx120\\fscy150)\\t(%d,%d,\\fscx100\\fscy100)%s”,x,y,60,200,syl.text_stripped)} so the position coordinates will be x,y, the second \\t will get 60,200 and the last %s will get syl.text_stripped

Continuing.

–Make hearts fly about
for i=0,30 do
l = result.add()
l.layer=0
l.text = string.format(“{\\an5\\move(%d,%d,%d,%d)\\alpha&H80&\\fscx65\\fscy65\\t(\\alpha&HF7&\\fscx20\\fscy20)}{\\p1}m -4 -9 b -3 -9 -4 -9 -4 -9 b -4 -9 -4 -9 -4 -9 b -9 -13 -12 -11 -13 -9 b -15 -6 -11 -1 -8 2 b -8 2 -6 4 -4 6 b -2 4 0 2 0 2 b 3 -1 7 -6 5 -9 b 4 -11 1 -13 -4 -9 {\\p0}”, x+math.random(-8,8)+15, y+math.random(-8,8)+10, x+math.random(-40,10)+15, y+math.random(-15,30)+10,  syl.text)
l.start_time = line.start_time + syl.start_time/10
l.end_time = line.start_time + syl
.start_time/10 + syl.duration + i*4
end

Let’s break it down.

The first for i=0,20 do …

… (commands)

End

That basically a loop command, it will generate a loop that will do the commands in like 21 times(from 0 to 20), i is the variables. Could be change by anything as long as it doesn’t collide with the lua commands, just put your name if you are confuse xD.

Moving onto the effecting tags.

{\\an5\\move(%d,%d,%d,%d)\\alpha&H80&\\fscx65\\fscy65\\t(\\alpha&HF7&\\fscx20\\fscy20)}{\\p1}m -4 -9 b -3 -9 -4 -9 -4 -9 b -4 -9 -4 -9 -4 -9 b -9 -13 -12 -11 -13 -9 b -15 -6 -11 -1 -8 2 b -8 2 -6 4 -4 6 b -2 4 0 2 0 2 b 3 -1 7 -6 5 -9 b 4 -11 1 -13 -4 -9 {\\p0}”, x+math.random(-8,8)+15, y+math.random(-8,8)+10, x+math.random(-40,10)+15, y+math.random(-15,30)+10,  syl.text)

\move(a,b,c,d) is use to move the characters from point #1(a,b) to point #2(c,d) (seek aegis help for more details).

Math.random(a,b) it will generate a rondom pick of number ranging from a to b

The you should understands the rest of the tags

AEGIFACTS| Principally one line is suitable for one tags, so how do you make a line with a sentences meaning there are couple of syllable while you want each syllable of the sentences gets an effects at different time? Easy. You could write down a tag for each syllable. Pretty inconvenient huh? That’s when the k-replacer comes. The k replacer is a method that basically replace every {\k} that you have next to your syllable timing and replace it with a template tags effect that you made without separating em into different lines. But sadly tags like \move are allowed only one for each line. So what’s the solution? Yes. You separate each line into different line so you could have more freedom to animate things are more controlled environment. That’s the rule of karaskel-adv lua and other mandatory things in each script.

Let’s carry on. Outro.

–sylable outro
l=result.add()
l.text = string.format(“{\\an5\\pos(%d,%d)\\alpha&HAA&\\t(\\fry360\\alpha&HFF&)}%s”,x,y,syl.text_stripped)
l.start_time = line.start_time + syl.start_time/10 + syl.duration + 20
l.end_time = line.start_time + syl.start_time/10 + syl.duration + 40

return result
end

Let’s again break it down.

{\\an5\\pos(%d,%d)\\alpha&HAA&\\t(\\fry360\\alpha&HFF&)}%s”,x,y,syl.text_stripped)

You should have understand the first two tags, the alpha&HAA& I put there is to synchronize with the previous alpha we give to our character in the effects part. Finally the remaining tags are for spinning it 360 degrees in y axis and fading it into 100% transparency in the set of time.

There you go. You have learnt the lua. Hurray.

Feedbacks and question are welcomed. Post it here or email me. Thanks for reading

Advertisements

The powerful tag of \blur

Since the newest version of VSfilter 2.9c which include some of the latest features and bug fixing. From all of the latest features there’s only 3 tags  that intrigue me and making me still holds a special trust in aegis (not AE =P). The tags are :

  • \blur — This my favourite tag and I should say the most powerful tag in aegis today. It make the real gaussian blur not the fake blur that \be makes. The blur starts from the middle of the character and circling outward. The blur main target is the primary color and akso the border and shadows. And the best thing is it could be animated with \t and has a practically unlimited numeric range. Yes you could put something like this \t(\blur 90)
  • \fax and \fay. This is the second tag I like. To put it simply it has ability to bends and stretch the character in horizontal and vertical, x and y respectively. This tag also capable of 0.something numeric range.
  • \xbord and \ybord, last but not least, this tags provide the ability to stretch the border in horizontal and vertical, x and y respectively yet separately

Aside from these 3 tags above. There’s actually another tag that I haven’t pull out the max use of it, that is the \iclip tags which the inverion of the \clip tags. Will report back when I have.