generic usage

 

to test out one of those sample effects:


create a new folder


put the p*.txt files for the effect in


create a shortcut for the exe


set the working path of the shortcut

to the folder where you put the p*.txt files



drag the .ass script on the shortcut


(directly on the exe wont work!)



it should draw a lot of stuff, some ....... and then say done

then you have a out.ass which contains the effect


BIG FILES: edit your shortcut to read asscalc.exe split

That’ll create out_000.ass, out_001.ass, ...


----


coding your own scripts:


i'd suggest you to look at the sample source

|       lines expr '\n'         { print_tval_of( $2.value );/*fprintf( foutt, "%.12g", $2.value) */}


       |       lines TEXTINDEX STORE '(' expr ')' '\n'         { TextindexStore( $5.value ); }

       |       lines TEXTINDEX GET '(' expr ')' '\n'         { TextindexGet( $5.value ); }


       |       lines PRINTS STRING '\n'         { printf( "%s", $3.name ); }

       |       lines PRINTV expr '\n'         { printf( "%f", $3.value ); }


       |       lines COLORING_OFF '(' expr ',' expr ')' '\n'         { ColoringOff( $4.value, $6.value );  }


       |       lines BORDERLINE '(' expr ',' expr ')' '\n'         { PrintBorderline( $4.value, $6.value );  }


       |       lines KILLTHISLOOP '\n'    { KillThisLoop(); }

       |       lines LOWKILL '(' expr ',' expr ')' '\n'    { if( $4.value<$6.value ){printf( "lowkill yes %f<%f\n",$4.value,$6.value);return EXIT_SUCCESS;}else printf( "lowkill no %f>=%f\n",$4.value,$6.value); }

       |       lines IDENTIFIER '=' expr '\n'         { set_identifier( $2, $4.value ); }

       |       lines IDENTIFIER '[' expr ']' '=' expr '\n'         { set_identifier_arr( $2, $7.value, $4.value ); }

       |       lines FONTMATCHUSE STRING '\n'         { fontmatchuse( $3.name ); }

       |       lines SETFLAG STRING '\n'         { set_flag( $3.name ); }

       |       lines TIMEOF expr '\n'         { print_time_of( $3.value ); }

       |       lines POSOF expr '\n'         { print_pos_of( $3.value ); }

       |       lines HEXOF expr '\n'         { print_hex_of( $3.value ); }

       |       lines CHAROF expr '\n'         { print_char_of( $3.value ); }

       |       lines COLOROF expr '\n'         { print_color_of( $3.value ); }

       |       lines TVALOF expr '\n'         { print_tval_of( $3.value ); }

       |       lines INSERT IDENTIFIER '\n'         { print_identifier( $3.name ); }

       |       lines RANDOMINS STRING expr '\n'         { rand_ins( $3.name, $4.value ); }

       |       lines LOOPFILE STRING expr '\n'         { loop_file( $3.name, $4.value, 1 ); }

       |       lines LOOPFILE2 STRING '(' expr ',' expr ')' '\n'         { loop_file( $3.name, $5.value, $7.value ); }

       |       lines TEXTLOCK IDENTIFIER '\n'         { if( !textlock_identifier( $3.name ) )return EXIT_SUCCESS; }

       |       lines STYLELOCK IDENTIFIER '\n'         { if( !stylelock_identifier( $3.name ) )return EXIT_SUCCESS; }

       |       lines TEXTFIND IDENTIFIER '\n'         { if( !textfind_identifier( $3.name ) )return EXIT_SUCCESS; }

       |       lines '!' TEXTFIND IDENTIFIER '\n'         { if( textfind_identifier( $4.name ) )return EXIT_SUCCESS; }

       |       lines STRING '\n'         { fprintf( foutt, "%s", $2.name) }

       |       lines EXIT '\n'         { return EXIT_SUCCESS; }

       |       /* empty */

       |       error '\n'              { printf("\n error \n"); yyerrok; }

       ;


expr: 

               expr '+' expr   { $$.value = $1.value + $3.value }

       |       expr '-' expr   { $$.value = $1.value - $3.value }

       |       expr '*' expr   { $$.value = $1.value * $3.value }

       |       expr '/' expr   { $$.value = $1.value / $3.value }

       |       expr '^' expr   { $$.value = pow($1.value, $3.value) }

       |       '(' expr ')'    { $$.value = $2.value }

       |       SIN '(' expr ')'    { $$.value = sin($3.value); }

       |       COS '(' expr ')'    { $$.value = cos($3.value); }

       |       INTROUND '(' expr ',' expr ')'    { $$.value = (double)(((int)($3.value+0.5)) % ((int)($5.value+0.5))); }

       |       TRUNC '(' expr ')'    { $$.value = floor($3.value); }

       |       SIGN '(' expr ')'    { $$.value = $3.value/(abs($3.value)+0.0001); }

       |       MIN '(' expr ',' expr ')'    { if( $3.value<$5.value )$$.value = $3.value; else $$.value = $5.value; }

       |       MAX '(' expr ',' expr ')'    { if( $3.value>$5.value )$$.value = $3.value; else $$.value = $5.value; }

       |       SWITCH '(' expr ',' expr ',' expr ')'    { if( $3.value<0.5 )$$.value = $5.value; else $$.value = $7.value; }

       |       PIXBUF '(' expr ',' expr ')'    { $$.value = get_pixbuf( $3.value, $5.value ); }

       |       '-' expr  %prec UMINUS { $$.value = -$2.value }

       |       IDENTIFIER { $$.value = get_identifier( $1 ); }

       |       IDENTIFIER '[' expr ']' { $$.value = get_identifier_arr( $1, $3.value ); }

       |       FINDINDEX '(' IDENTIFIER ',' expr ')' { $$.value = find_index_arr( $3, $5.value ); }

       |       TEXTFINDBOOL IDENTIFIER { $$.value = textfind_identifier( $2.name ); }

       |       NUMBER

Commands

these names are system variables. these are always readable. also you can set your own variables


   ntstart = next kara/char start


   ntend = next kara/char end


   tstart = current kara/char start


   tend = current kara/char end


   ltstart = last kara/char start


   ltend = last kara/char end


   wtstart = line start


   wtend = line end


   nth = index of kara in current line


   nthall = number of karas in current line


   nchr = index of char in current line


   nchrall = number of chars in current line


   nsiz = width of all kara/char before the actual one in current line in pixel


   lnsiz = width of all kara/char before the last one in current line in pixel


   nsizthisone = width of current kara/char in pixels


   nysizthisone = height of current kara/char in pixels


   nsizall


   bfirstone = [bool] give back 1 (true) if kara is the first in line


   blastone = [bool] give back 1 (true) if kara is the last in line


   bsylf = [bool] give back 1 (true) if the actual char is the first on in a kara (only intresting in combination with flag "charwise")


   nafterlastspace


   bwordf = first char in word


   bwordl = last char in word


   nthword = index of word in current line


   rand = random number 0....1

Variables

there are two types of arrays

text arrays and variable arrays


Text arrays can save the current text you work on into a slot. There are 256 slots numbered 0...255.

using TEXTINDEX STORE( someVariable ) you can save the current text

you can then later read it using

TEXTINDEX GET( someOtherVariable )


someVariable and someOrtherVariable are variables, numbers, or calculating expressions. for example (3 + nthall)


variable arrays have an unlimited number of slots and you can store and and use them just as any other variable


arrayVariable[ someIndex ] = 5

will store 5 in the slot someIndex in arrayVariable


a good use is to store positions for later use in conjunction with nthall


for example

storedX[ nthall ] = posx


will save the current x position for every kara into storedX

this can then be read in p-layers with a higher number to know the position in advance :)


like this:


(storedX[ nthall ] + storedX[ nthall+1 ]) / 2

would give the middle between the current and the next kara

Arrays

OPTIONAL: you can use zero, one, or multiple SETSYLE lines. You can, for example, combine charwise with skipspace


charwise


doublecharwise


spacefix


skipspace


no_k_ins

Flags

normal names:


stylecolor1


stylecolor2


stylecolor3


stylecolor4




if you want the property of a different style than the one belonging to the current line, you can append .stylename


like this:


stylecolor1.boom


would read color 1 of style "boom"



if you want the color at the current time, and not the color defined in style ( this only applies to lines with \t(\c) ):


append @


like this:


stylecolor1@



for great use of dynamic styleitems see the chrno crusade intro,

which creates dynamic layers of moving color changing fonts

Style Items

Mail Me !

if something seems odd, or you need help, or you have an improvement for this page


see contacts page for details