Page 1 of 1

wzstats windows executable

Posted: 09 Feb 2007, 13:41
by Watermelon
wzstats is a simple 'console' comandline program I wrote to convert the csv-like wz data to a more human-readable format,features:

1.convert wz txt to new format txt
2.convert new format txt to wz txt
3.supports the following txt's:
weapons.txt,templates.txt,structures.txt,bodypropimd.txt,
assignweapons.txt,structureweapons.txt,research.txt,pre_research.txt,researchfunctions.txt,researchstructures.txt,resultcomponent.txt,resultstructure.txt

sample:(old template for python medium cannon tracks)
PythonMedCnTrks,472,Body11ABT,ZNULLBRAIN,ZNULLCONSTRUCT,ZNULLECM,6,tracked01,ZNULLREPAIR,ZNULLREARM,DROID,DefaultSensor1Mk1,1

sample:(new template data for python medium cannon tracks)
[PythonMedCnTrks]
templateID = 472; compBody = "Body11ABT"; compBrain = "ZNULLBRAIN"; compConstruct = "ZNULLCONSTRUCT"; compECM = "ZNULLECM";
playerId = 6; compPropulsion = "tracked01"; compRepair = "ZNULLREPAIR"; compRearm = "ZNULLREARM"; type = "DROID";
compSensor = "DefaultSensor1Mk1"; numWeapons = 1;


note:it only works with the weapons.txt and templates.txt included,because I added new fields such as 'compRearm' to those 2 files recently.

source code is available on mailinglist,it's written in C with ANSI 'main()' so linux user shouldnt have any problems compiling it(my linux installation is still unfinished due to borked internet d/l speed...)

Feel free to post any suggestion or feedback :)

Re: wzstats windows executable

Posted: 09 Feb 2007, 16:11
by kage
is whitespace important in the new format? as in, could we write ours to have one statement per line?

Re: wzstats windows executable

Posted: 09 Feb 2007, 16:58
by Watermelon
no all whitespace outside " " will be ignored and discarded,I just make the converter to put a whitespace after each variable name/variable value to make it easier to read.

Currently it's set to 5 variables/fields per line,you can change it to whatever via #define MAX_VALUES_PER_LINE,though it will become unreadable,esp with the 50+ fields per line weapons.txt...

Basically this tool is used to make editing wz .txt files/modding easier:
1.convert old txt to new format
2.makes changes to new format file so you dont suffer from comma count/field meaning guessing anymore...
3.convert the new format file back to old txt wz uses

Re: wzstats windows executable

Posted: 09 Feb 2007, 17:12
by kage
i had meant the opposite: something like
#define MAX_VALUES_PER_LINE 1

cool. is the code portable enough to make linux and mac binaries?

Re: wzstats windows executable

Posted: 09 Feb 2007, 17:57
by Watermelon
not sure.I havent tried to compile it under linux yet,it just uses the stdlib,stdio,string,should work under linux since I dont think those standard C libs will have any portability issues.