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

5 Comments

  1. wow..!coolll!!

    i’ll try it o’course..!
    it’s really exhausting just using ‘line per syllable’ for subbing….!

    well…thank youuu…!!!!

  2. OMG.. just look at the number make me dizzy
    I just dont get it about LUA.. -_-

    • hahaha, nope if you break it down as simple as possible

  3. hmm how bout auto4 kara ga? since jfs himself said that all support for auto3 already stopped ages ago XD. what is the fundamental diff between both version anyway?

    • Well to be honest I haven’t grasp the concept yet, in other word I haven’t undestood it all. I’m in the learning process, sometimes I tried it out on minor releases but for my professional service I still use auto3 to give my best competent skill.


Comments RSS TrackBack Identifier URI

Leave a comment