I mean the leader name modification which let you sort leaders according to their traits. I know there was one here sometimeago but I cant find it now.
A mod?Icer said:I mean the leader name modification which let you sort leaders according to their traits. I know there was one here sometimeago but I cant find it now.
Aha, adding the traits to the names? A clever idea! But how dows it look on screen in the game? Can you post a pic here please?jdrou said:Warlimont was modifying the leader files by adding the traits to the names. I don't think he has updated them since the picture packs came out. (I have a bash shell script that I use to apply this to my leader files. I can post it if anyone wants to see it. I also have a link to a bash shell for Windows if you don't run Linux.)
(FB OD LW)von Falkenhausen
#bash script
# Extract numerical traits from leader record and add text traits to name field
trait[0]=LW
trait[1]=DD
trait[2]=OD
trait[3]=WS
trait[4]=TR
trait[5]=EN
trait[6]=FB
trait[7]=PL
trait[8]=CO
trait[9]=OG
trait[10]=SW
trait[11]=BR
trait[12]=ST
trait[13]=SP
trait[14]=TB
trait[15]=CB
trait[16]=NF
trait[17]=FD
typeset -i traits
typeset -i trait_added
typeset -i n
typeset -i t
input_file=${1}
if [ -f ${input_file}.tmp ]
then
rm ${input_file}.tmp
fi
while read input_record
do
field5=`echo ${input_record} | cut -d';' -f5`
case $field5 in
Traits|TRAITS)
traits_text="(Traits) ";;
0)
traits_text="(N) ";;
*)
traits=$field5
traits_text="("
trait_added=0
n=17
while [ $n -ge 0 ]
do
t=2**n
if [ $traits -ge $t ]
then
if [ $trait_added -eq 1 ]
then
traits_text="${traits_text} "
fi
traits=$traits-$t
traits_text="${traits_text}${trait[n]}"
trait_added=1
fi
n=$((n-1))
done
traits_text="${traits_text}) ";;
esac
echo "${traits_text}${input_record}" >> ${input_file}.tmp
done < ${input_file}
mv ${input_file} ${input_file}.bak
mv ${input_file}.tmp ${input_file}
jdrou said:It's not pretty but it works.
Code:#bash script # Extract numerical traits from leader record and add text traits to name field . . [/QUOTE] Anything that works is good. Would it be okay with you if I translated this to vbscript and/or vba for personal use and then potential forum posting/publishing? I will fully credit you in the post+code. I would trust your judgement about it would be proper to also credit Warlimont in some way. As for the MS scripting... I hope you will not think blasphemy would be involved ;) Just to smooth the path: I [I]have [/I] played around with a number of diffrent systems, SCO Unix and Linux (an old Redhat) included, but it was a long time ago and even if I have some basic knowledge left, I have scrapped the installations and don't do anything new. Point is I am not a MS fanatic, even when putting some focus on some of their stuff. So, will that do to smoothen the path? :D
Feel free to translate and post. If you want to make a compiled binary and post with source code that would be fine too. I was hoping someone would do a Perl translation; I've been trying to translate it myself but haven't had time to learn enough Perl yet. The only thing I got from Warlimont was the idea to write the script after seeing his mod posted; I asked him if he used a program/script and he said he did it manually.MostlyHarmless said:Anything that works is good.
Would it be okay with you if I translated this to vbscript and/or vba for personal use and then potential forum posting/publishing?
I will fully credit you in the post+code. I would trust your judgement about it would be proper to also credit Warlimont in some way.
As for the MS scripting... I hope you will not think blasphemy would be involved![]()
Just to smooth the path: I have played around with a number of diffrent systems, SCO Unix and Linux (an old Redhat) included, but it was a long time ago and even if I have some basic knowledge left, I have scrapped the installations and don't do anything new. Point is I am not a MS fanatic, even when putting some focus on some of their stuff.
So, will that do to smoothen the path?![]()
Ok, thx for the input.jdrou said:Feel free to translate and post. If you want to make a compiled binary and post with source code that would be fine too. I was hoping someone would do a Perl translation; I've been trying to translate it myself but haven't had time to learn enough Perl yet. The only thing I got from Warlimont was the idea to write the script after seeing his mod posted; I asked him if he used a program/script and he said he did it manually.
Forgot about that.MostlyHarmless said:That cut command was very handy by the way.
I didn't run it in Linux. I don't think I have Linux installed anymore.jdrou said:Forgot about that.o Did you run it in Linux or get the cut command from the same location I linked to for the bash shell for Windows?