I thought about this thread again, and I realised there is a much simpler method to make a name: re-write the name_generator in WML using "rand" (random) function.@
This code does the same thing as the previous code (well, only with a few syllables), and there is no need for a dummy unit.
Code:
#define GAIN_A_NAME_2 [label] x,y=10,10text="<span color='#76AA2F' size='x-small' weight='normal'>" + _ "Rename unit here" + "</span>" [/label] [event]name=moveto [filter] side=1 x,y=10,10 [/filter]first_time_only=no [set_variable] name=old_name value= $unit.name [/set_variable] [set_variable] name=new_prefix rand=Ai,Al,A,Du,Glam [/set_variable] [set_variable] name=new_suffix rand=sil,fur,bor,bus,gos [/set_variable] [set_variable] name=new_name value=$new_prefix| + $new_suffix| + " " + $old_name| + "-Rider" [/set_variable][modify_unit] [filter] x,y = $x1, $y1 [/filter] name=$new_name[/modify_unit] {CLEAR_VARIABLE new_prefix,new_suffix,old_name,new_name} [/event]#enddef
Statistics: Posted by tsunami_ — Today, 2:21 am