need help reading .ini file

For code related discussions and questions
User avatar
Ezio
Trained
Trained
Posts: 306
Joined: 24 Apr 2010, 16:42

need help reading .ini file

Post by Ezio »

EDIT: i need to know which stats in ini file i nee to link for these

here weapons.ini

Code: Select all

'sacc' => 
'lifetime' => 
'life' => 
'v' => 
'iheight' => 
'type' => 
'mrange' => ,
repair.ini

Code: Select all

'hp' => ,
'build' => ,
'prereq' => ''
Last edited by Ezio on 15 Apr 2013, 09:30, edited 2 times in total.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per »

I don't understand your question.
User avatar
Ezio
Trained
Trained
Posts: 306
Joined: 24 Apr 2010, 16:42

Re: need help reading .ini file

Post by Ezio »

Per wrote:I don't understand your question.
my bad haha, stats from left are the one that will be put to guide page, while on right is comes from .ini. but some stats either not entered in ini file or have a different name and it's pretty confusing so i might entered wrong stats from ini file to guide page like 'direction' => simplify($tvals['facePlayer']), which should be 'movement' (i fixed it already).
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per »

I can tell you what every line in the .ini files is for, but I can't tell you what 'v' in a php script I've never read is...
User avatar
Ezio
Trained
Trained
Posts: 306
Joined: 24 Apr 2010, 16:42

Re: need help reading .ini file

Post by Ezio »

Per wrote:I can tell you what every line in the .ini files is for, but I can't tell you what 'v' in a php script I've never read is...
seems those don't do anything, but we have longRange (i use this for long range),longHit (i use this for log accuracy) but we dont have shortRange and shortHit in weapon.ini :hmm:
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 »

Per wrote:I can tell you what every line in the .ini files is for, but I can't tell you what 'v' in a php script I've never read is...
Hi Per, if you project still needs converter from txt to ini I can rewrite it in python. I think old one is outdated since we rename/remove some fields and simplify some files.
http://addons.wz2100.net/ developer
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per »

That would be useful. As you can see, we still have a few .txt files remaining. Any help transforming those to .ini would be appreciated.
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 »

Per wrote:That would be useful. As you can see, we still have a few .txt files remaining. Any help transforming those to .ini would be appreciated.
Send me PM what to what. Or just do something and send result?
http://addons.wz2100.net/ developer
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per »

Do something and post result in bug tracker.
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 »

Per wrote:Do something and post result in bug tracker.
In what format attach it to bugtracker?

First attempt.
https://www.dropbox.com/sh/x1k0kiun93emfpm/k5jxreymAd


I don`t know waht to do with function. Should I merge them to researches?

I don`t know what to do with template.avaliable (for base it has 7, 5 and other values for mp it is yes/no)

May be we should merge assignweapons to templates?
http://addons.wz2100.net/ developer
User avatar
Ezio
Trained
Trained
Posts: 306
Joined: 24 Apr 2010, 16:42

Re: need help reading .ini file

Post by Ezio »

.......
Last edited by Ezio on 21 May 2013, 07:28, edited 1 time in total.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per »

Duha wrote:In what format attach it to bugtracker?
Just attach the .ini files you have made to the bugtracker. Your first attempt looks good. I'd like to see just one change, see below.
Duha wrote: I don`t know waht to do with function. Should I merge them to researches?
Just leave functions.txt to me, I am working on that right now. Its contents will be moved elsewhere.
Duha wrote: I don`t know what to do with template.avaliable (for base it has 7, 5 and other values for mp it is yes/no)
I'll look into it.
Duha wrote:May be we should merge assignweapons to templates?
Yes, please.
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 »

Per wrote:
Duha wrote:In what format attach it to bugtracker?
Just attach the .ini files you have made to the bugtracker. Your first attempt looks good. I'd like to see just one change, see below.
http://developer.wz2100.net/ticket/4005

PS. When you changing c++ code to work with ini please leave some comment about fields. default values, limit, list of available choices.
http://addons.wz2100.net/ developer
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: need help reading .ini file

Post by Per »

Nice work. While you're at it, maybe you can write a script to transform from old functions.txt + new research.ini resultFunctions to even newer functions line in research.ini?

Here is how it looks in upgrades branch: https://github.com/perim/warzone2100/bl ... search.ini
Notice the lines with 'results' keys.

Here is how it looks previously: https://github.com/perim/warzone2100/bl ... search.ini and https://github.com/perim/warzone2100/bl ... ctions.txt (yes, functions.txt is removed entirely in upgrades branch)

I changed the MP research.ini by hand. This was a ton of work, and may have mistakes. If you could write a script to change base and mp automatically, I would be very grateful.
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 »

Per wrote:Nice work. While you're at it, maybe you can write a script to transform from old functions.txt + new research.ini resultFunctions to even newer functions line in research.ini?

Here is how it looks in upgrades branch: https://github.com/perim/warzone2100/bl ... search.ini
Notice the lines with 'results' keys.

Here is how it looks previously: https://github.com/perim/warzone2100/bl ... search.ini and https://github.com/perim/warzone2100/bl ... ctions.txt (yes, functions.txt is removed entirely in upgrades branch)

I changed the MP research.ini by hand. This was a ton of work, and may have mistakes. If you could write a script to change base and mp automatically, I would be very grateful.

Am I right?:
Take string "Research Upgrade,Struc-Research-Upgrade02,60" from functions.txt
Find "resultFunctions = Struc-Research-Upgrade02" in research.ini section R-Struc-Research-Upgrade02 and replace it with
result = ResearchPoints:60

Where can I find dict (hash) like:

Code: Select all

{
'Research Upgrade': 'ResearchPoints',
}
We use same values without changes?
http://addons.wz2100.net/ developer
Post Reply