A unified csv2ini converter

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: A unified csv2ini converter

Post by Iluvalar »

Berg wrote: Your reply again does not reflect the topic you are replying to you claim knowledge about the conversion of csv to ini yet all you have input to this thread is "it will make the mod downloads bigger" .
No, that's not what I said. Learn to read. I said that THIS new effort put into csv to ini conversion just cancel any argued advantage the .ini had (easier to read than .csv UNLESS we spend time on some reading tools) and therefore, the only effect remaining from that conversion is bigger files.
Your claim to have hosted thousands of game is total crap going by the stats i have made up out of thin air like you often do your game have total 0.005 of total games played on the net.
Your not helping!
But how much of modded games on the net ?
Heretic 2.3 improver and proud of it.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: A unified csv2ini converter

Post by NoQ »

UNLESS we spend time on some reading tools
Not sure what you "understood" this time, but we're writing no "reading tool" here.
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: A unified csv2ini converter

Post by cybersphinx »

Iluvalar wrote:argued advantage the .ini had (easier to read than .csv
Wasn't that argument about being human-readable?
We want information... information... information.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: A unified csv2ini converter

Post by Per »

My primary reason was being able to add/remove fields without breaking backwards compatibility each time.
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: A unified csv2ini converter

Post by Iluvalar »

You could have used the header of the CSV to identify the columns. Most files already had an header.

Cybersphinx, what was the problem with opening them into a spreadsheet editor ? It was easy enough to read there. It was possible to compare weapons over one another there. Now with an .ini file, it's actually harder; We'll need to scroll up and down to do so.
Heretic 2.3 improver and proud of it.
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

Re: A unified csv2ini converter

Post by vexed »

Iluvalar wrote:You could have used the header of the CSV to identify the columns. Most files already had an header.

Cybersphinx, what was the problem with opening them into a spreadsheet editor ? It was easy enough to read there. It was possible to compare weapons over one another there. Now with an .ini file, it's actually harder; We'll need to scroll up and down to do so.
Round & round it goes...
Bottom line on why ini was done is found in this post.
viewtopic.php?f=32&t=9295&p=102221#p111088
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: A unified csv2ini converter

Post by NoQ »

Iluvalar wrote:You could have used the header of the CSV to identify the columns. Most files already had an header.
NoQ wrote:I didn't like the idea of trying to achieve less than one line of code per ini file field, as in some unpredictable places we could really use arbitrary flexibility, such as complicated guessing of new field values depending on multiple other field values from different files.
Not only file format has changed. Some fields were added, some were renamed, some were removed. Providing code for exceptions to this routine only will lead to a much more complicated code.

Let's see if Duha comes up with anything though (:
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: A unified csv2ini converter

Post by Per »

Note fdb43a35f583431db8a020c69ab98326a9450d24.

Thinking about moving some of the other weapons abilities into flags as well.
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: A unified csv2ini converter

Post by Duha »

NoQ wrote:
Per wrote:Note fdb43a35f583431db8a020c69ab98326a9450d24.

Thinking about moving some of the other weapons abilities into flags as well.
Let's see if Duha comes up with anything though (:
Sorry I fill ill a little.

Flags are better.

IMHO it is not hard to add some wiki entry for small changes. in result we will have some docs at the end of development.

Code: Select all

flags avaliable:
ShootGround   (default value If no flag specifified in ini)
AirOnly 
ShootAir  == ShootGround | AirOnly
*flags names are casesensitive 
Names "ShootAir" "AirOnly" named in different style. You can use same names as in c++ code.
http://addons.wz2100.net/ developer
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: A unified csv2ini converter

Post by NoQ »

I guess i'd do it my way :oops: as it's currently going very quickly (10 minutes per file convertor, until i get to research, where, thanks to Duha, we already have a code to merge).

Also i renamed the repo and thrown more stuff into it (including a tool for checking correctness of conversion by comparing ini files), see also.
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: A unified csv2ini converter

Post by Duha »

NoQ wrote:I guess i'd do it my way :oops: as it's currently going very quickly (10 minutes per file convertor, until i get to research, where, thanks to Duha, we already have a code to merge).

Also i renamed the repo and thrown more stuff into it (including a tool for checking correctness of conversion by comparing ini files), see also.
As you wish.

I think you can add me to you repo. I will move all my tools to it as separate folder.

I am prefer to use python2 (I am coding on it at work, And it still more common now.) But can convert libs to work with ini to work with both versions.
http://addons.wz2100.net/ developer
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: A unified csv2ini converter

Post by NoQ »

Bump this, i think i accidentally finished the upgrade support.
The convertor is mostly functional.
Probably some stuff in other files has changed since last time i checked it.

P.S. Just curious: guys, what's going on in the repo? >_<
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: A unified csv2ini converter

Post by Duha »

NoQ wrote:P.S. Just curious: guys, what's going on in the repo? >_<
I am awaken :)
http://addons.wz2100.net/ developer
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: A unified csv2ini converter

Post by Duha »

I am working on stats validation script. It check is ini files is compatible with master rules.

Note: This file can became outdated on each commit in master. This script can contain errors.

Code: Select all

usage:     validate_stats.py [-h] stats_folders [stats_folders ...]
example:   validate_stats.py g:\warzone2100\data\base\stats g:\warzone2100\data\base\stats
output example

Code: Select all

validating propulsionsounds.ini(g:\warzone2100\data\base\stats\propulsionsounds.ini) ... OK
validating research_cam1.ini(g:\warzone2100\data\base\stats\research_cam1.ini) ... Failed. Has errors or warnings in 12 sections
	CAM1WEAPONS
		researchPower use default value(0)
		researchPoints use default value(0)
	R-Struc-Factory-Cyborg-Upgrade01
		has additional keys ['resultFunctions']
	ADVANCEDRESEARCH
		researchPower use default value(0)
		researchPoints use default value(0)
	R-Struc-Factory-Cyborg-Upgrade03
		has additional keys ['resultFunctions']
      ...
http://addons.wz2100.net/ developer
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: A unified csv2ini converter

Post by NoQ »

Probably the script could grep for parameter name and "value" word through game sources to try to figure out the default values?
Post Reply