need help reading .ini file

For code related discussions and questions
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 02 Oct 2013, 22:02

hitpoints for features and structures default value is 1
hitpoints for unit components default value is 0

Should default value be the same?
http://addons.wz2100.net/ developer

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3777
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per » 03 Oct 2013, 00:42

Duha wrote:hitpoints for features and structures default value is 1
hitpoints for unit components default value is 0

Should default value be the same?
No. Zero should be legal value for components, but not for the others.

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 03 Oct 2013, 23:14

Per wrote:
Duha wrote:hitpoints for features and structures default value is 1
hitpoints for unit components default value is 0

Should default value be the same?
No. Zero should be legal value for components, but not for the others.
1. Some features has hitpoints = 0 (and damagable = 0) Should them be changed to hitpoints = 1 (and we can remove them from ini file because we don`t show default values)?

2. width and breadth in features has default 1 and no other checks
width and breadth in structures has default 0 and must be <= 100

3. we have techCode =major | minor. We can remove this key and set major if has msgName key.

4. Found bug in campaign research: cyborg(VTOL) factory upgrade research do nothing. Looks like tank factory upgrade affects this factories. Should we remove this researches?
http://addons.wz2100.net/ developer

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 09 Oct 2013, 01:39

I plan to add header in new style for ini files:

Here is an example: https://github.com/Cjkjvfnby/warzone210 ... 83233ee9d3

It looks bad on forum page:
Spoiler:
PS. Still waiting answers for previous questions.
http://addons.wz2100.net/ developer

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 10 Oct 2013, 23:30

How pie files loader resolve path to pie when loading data/mp/stats:

Is it use same cache as base? (lib\ivis_opengl\imdload.cpp:*modelGet)
What will happens if there is file with same name in base and mp folder? Base will show one pie mp other?
What will happens if there is no file in mp? Base and pie will show same file?

Double pie examples:

Code: Select all

components/bodies/drtrans.pie
components/prop/prsrvtl1.pie
components/prop/prslvtl1.pie
components/weapons/scavmra.pie
What is this means in data\mp\stats\bodypropulsionimd.ini

Code: Select all

[ZNULLBODY]
ZNULLPROP=MIBNKDRL.PIE, MIBNKDRR.PIE
What is *.wrf files?
Some pie models is not used in ini file but mentioned in wrf ("cybitrkt.pie")

And other pie models is not mentioned in whole project: "gnmacan.pie" Should we remove them?
http://addons.wz2100.net/ developer

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3777
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per » 14 Oct 2013, 00:03

Any file in data/mp with the same name as any file in data/base will override the latter file. The files in data/mp take priority.

The .wrf files are a list of files to be loaded into memory (and for scripts, also activated). They are kind of useless, in my opinion, and I have been slowly reducing their usage. PIE files and textures are no longer loaded from wrf files, but loaded as needed.

Informative headers for .ini files would be welcome.

I will try to answer the more detailed questions later.

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 14 Oct 2013, 23:39

Per wrote:Any file in data/mp with the same name as any file in data/base will override the latter file. The files in data/mp take priority.
thank you
The .wrf files are a list of files to be loaded into memory (and for scripts, also activated). They are kind of useless, in my opinion, and I have been slowly reducing their usage. PIE files and textures are no longer loaded from wrf files, but loaded as needed.
mp: components/bodies/scbd_run.pie is only one usage in data\mp\anims\scbd_run.ani what for this file used?

Is any other places where pie files is used?
Is it true that if I cant find filename by text search(ignore case) in master this pie is unused?
Informative headers for .ini files would be welcome.
I will make pull request after previous will be closed.
http://addons.wz2100.net/ developer

User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: need help reading .ini file

Post by NoQ » 15 Oct 2013, 06:28

data\mp\anims\scbd_run.ani
I guess it's scavenger soldier run animation? Probably used by its id in anim.cfg (?)
P.S. there are quite a lot of other unused pie files around, such as this.

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 15 Oct 2013, 10:24

NoQ wrote:
data\mp\anims\scbd_run.ani
I guess it's scavenger soldier run animation? Probably used by its id in anim.cfg (?)
P.S. there are quite a lot of other unused pie files around, such as this.
I already has list of pies not used by stats. I am trying to figure out what files is not used at all.

This is information about pie usage in stats
Spoiler:
http://addons.wz2100.net/ developer

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3777
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per » 16 Oct 2013, 23:05

Duha wrote: 4. Found bug in campaign research: cyborg(VTOL) factory upgrade research do nothing. Looks like tank factory upgrade affects this factories. Should we remove this researches?
This is a bug. The campaign research files are missing both techs and tech results. If you grep the research ini files in campaign for "resultFunctions" you will find techs missing their results, and also missing their prerequisites (eg upgrades 01...05 for cyborgs, 01..02 for vtols in cam3).

Edit: Probably due to script side not implementing a way to distinguish between different kinds of buildings for production points upgrades, since MP does not care.

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 17 Oct 2013, 00:23

Add some header example for research and stats: https://github.com/Cjkjvfnby/warzone210 ... 6fca852eef

If this style is OK I will proceed with other files.
http://addons.wz2100.net/ developer

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3777
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per » 17 Oct 2013, 22:31

Duha wrote:If this style is OK I will proceed with other files.
Looks good to me.

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 24 Oct 2013, 00:02

Per wrote:
Duha wrote:If this style is OK I will proceed with other files.
Looks good to me.
Will add new pull request after finishing with current.
http://addons.wz2100.net/ developer

crab_
Trained
Trained
Posts: 349
Joined: 29 Jul 2013, 18:09

Re: need help reading .ini file

Post by crab_ » 26 Oct 2013, 13:01

Hello.

What is situation with names.txt?
As far i know "name" field was added to many stat ini-files
I need to know how read names of cyborgs.

May be add "name" field into templates.ini?

I can turn names of cyborgs from names.txt into templates.ini, if someone will write codes it in hardcode :)
Warzone2100 Guide - http://betaguide.wz2100.net/

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: need help reading .ini file

Post by Duha » 26 Oct 2013, 15:10

crab_ wrote:Hello.

What is situation with names.txt?
As far i know "name" field was added to many stat ini-files
I need to know how read names of cyborgs.

May be add "name" field into templates.ini?

I can turn names of cyborgs from names.txt into templates.ini, if someone will write codes it in hardcode :)
As I understand there was a plan to remove names.txt from 3.2

per: did you need patch that removes all entries of names in names.txt that already present as name = .* in *.ini files?
http://addons.wz2100.net/ developer

Post Reply