Derp colour generator issue

Discuss and get help for karaoke effect creation here

Derp colour generator issue

Unread postby zahj » Fri Oct 14, 2016 12:48 am

I tried to create a derp colour generator, but since I don't really know how to lua I just used 3 math.randoms together. The thing is that when I use the "recall" function all of the char colors are applied to the syls, and I can't understand what happens precisely, could you help me understand it? (But before it, sorry for the weird position, I need the kara to be in \an4, and please, don't mind the unmatched or disorganized tags, I'll fix them all after I understand what's wrong)

I'll try to be more clear with some screens: the preline effect looks just as I wanted http://puu.sh/rI7tu/194c775cb6.jpg

Code: Select all
Comment: 0,0:00:18.85,0:00:28.19,romaji,,0,0,0,template char noblank,!retime("preline",math.random(-500,-250),0)!{\fscy83\shad0\fad(300,0)\move(!$x+25+math.random(-5,5)!,!$y-295+math.random(20,35)!,!$x+25!,!$y-295!,0,300)\blur3\1a&HFF&\frz!math.random(-25,25)!\frx!math.random(-25,25)!\fry!math.random(-25,25)!\t(\3c&H!remember("aaa", 0+math.random(10,99))!!remember("bbb", 0+math.random(10,99))!!remember("ccc", 0+math.random(10,99))!&\c&HCDCDCD&\1a&H00&\frz0\fry0\frx0)}


But the line effect applies the same colour to the syls and not to the single characters http://puu.sh/rI7x8/631bf7a387.jpg

Code: Select all
Comment: 0,0:00:18.85,0:00:28.19,romaji,,0,0,0,template char noblank,!retime("line",0,-250)!{\3c&H!recall("aaa")!!recall("bbb")!!recall("ccc")!&!\c&HCDCDCD&\shad0\pos(!$x+25!,!$y-295!)\blur3\fscy83}


The colors from line and postline matches, so it should be perfect http://puu.sh/rI8aH/5aeb0f044f.jpg ...

Code: Select all
Comment: 0,0:00:47.26,0:00:47.26,romaji,,0,0,0,template char noblank,!retime("postline",-250,0+math.random(0,400))!{\fscy83\3c&H!recall("aaa")!!recall("bbb")!!recall("ccc")!&\1a&H33&\c&HC0C0C0&\shad0\move(!$x+25!,!$y-295!,!$x+25+math.random(-5,5)!,!$y-295+math.random(-55,-35)!)\fad(0,300)\blur3\t(\frx!math.random(-25,25)!\fry!math.random(-25,25)!\frz!math.random(-25,25)!\3c&HFFFFFF&\1a&HFF&)}


...if it was applied to the characters and not to the syls.
Originally this was a start2syl-syl2end effect with a random colour pick (
Code: Select all
Comment: 0,0:00:18.85,0:00:28.19,romaji,,0,0,0,code once,color = {"&H202E83&", "&H6A8834&", "&H44BBC0&", "&H97855F&", "&H4F358C&", "&H247811&", "&H9C396B&", "&H7D2D9F&"}

Comment: 0,0:00:00.00,0:00:00.00,romaji,,0,0,0,code syl,color_index = math.random(1,8)
) but I thought that, since the codes can influence just the syllables (and not the single letters), the problem could be having a code, so I cut the tables and I tried to use the remember-recall function... And it gave me the same output. Then I thought that maybe it was the start2syl-syl2end that was applying the effect to the syllables and not to the characters (despite having "char" in the effect), so I tried to make it a line char effect... and it gives me the same output again.
I'm totally clueless as to fix it right now, maybe I didn't understand how to use the remember-recall function. I can't figure out why the preline is perfect but the line applies the colors to the syls and not to the chars...

I apologize if someone already done a similar question or the answer is already written in the docs or something, in that case could you send me the discussion link or the precise reference?
Thank you very much in advance!
User avatar
zahj
{\b1}
{\b1}
 
Posts: 7
Joined: Wed Sep 28, 2016 8:21 pm

Re: Derp colour generator issue

Unread postby pyointa2001 » Fri Oct 14, 2016 11:57 am

char class template execution order is.

K <- applied template A. stored RED and applied RED
o <- applied template A. stored BLUE and applied BLUE
K <- applied template B. recall BLUE and applied BLUE
o <- applied template B. recall BLUE and applied BLUE
K <- applied template C. recall BLUE and applied BLUE
o <- applied template C. recall BLUE and applied BLUE

n <- applied template A. stored Yellow and applied Yellow
o <- applied template A. stored GREEN and applied GREEN
n <- applied template B. recall GREEN and applied GREEN
o <- applied template B. recall GREEN and applied GREEN
n <- applied template C. recall GREEN and applied GREEN
o <- applied template C. recall GREEN and applied GREEN

Ko no preline
Ko no line
Ko no postline

remember/recall function
when template A is applied to the 2nd character "o" in the 1st syllable, stored color red is overwritten to blue, because you choose a same remember name.
you have to choose a unique remember name to each characters.
recall function is not actually a function , it a table. so you can use not only string but also any value as remember name. remember name is table's key.

$center in the char class template has unique value to each characters. (need not "")
\3c!remember($center,_G.ass_color(math.random(255),math.random(255),math.random(255)))!
\3c!recall($center)!

sorry for my bad english, I hope you can understand what I say^^;
pyointa2001
{\b1}
{\b1}
 
Posts: 19
Joined: Sat Apr 06, 2013 11:30 pm


Return to Karaoke

Who is online

Users browsing this forum: No registered users and 1 guest