Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 7:11 pm
All times are UTC + 0
Tool for editing INI file
Moderators: Ares Support Team at PPM, Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [1 Post] Mark the topic unread ::  View previous topic :: View next topic
Author Message
linq2js
Light Infantry


Joined: 26 May 2011

PostPosted: Sun Apr 15, 2018 11:45 am    Post subject:  Tool for editing INI file Reply with quote  Mark this post and the followings unread

I developed INI Transformer, it saves much time for modder. Here are some featured functionality

SAMPLES:
1. Declare variables
Code:

@AllCountries=Yuri,America,Russia..

[NewTechNo]
Owner=@{AllCountries}

Output
Code:

[NewTechNo]
Owner=Yuri,America,Russia..


2. Reuse/inherit INI section
Code:

[HasPrimary]
@type=base ; specific this section is base section and it will be not rendered to output file
Primary=@{0} ; set primary weapon to argument 0 value
ElitePrimary=@{1} ; set elite primary weapon to argument 1 value

[NewTechno]
@extend=HasPrimary | 120mm | 120mmE


Code:

[NewTechno]
Primary=120mm
ElitePrimary=120mmE


OR we can set default value if no argument 1 passed
Code:

[HasPrimary]
@type=base ; specific this section is base section and it will be not rendered to output file
Primary=@{0} ; set primary weapon to argument 0 value
ElitePrimary=@{1} ; set elite primary weapon to argument 1 value
@default:1=@{0} ; set default value for argument 1


3. Auto merge properties
Code:

; file 1
[General]
Prop1 = value1
Prop2 = value2

;file 2
[General]
Prop1 = value2


Output
Code:

[General]
Prop1 = value2
Prop2 = value2


4. Auto register list item
Code:

[InfantryTypes]
@type=append
1 = NewTechno

[NewTechno]
; techno props here

Output
Code:

[InfantryTypes]
... existing items
121 = NewTechno ; new item will be added in last position


OR we can use other way to register Techno
Code:

[NewTechno]
@appendTo=InfantryTypes ; same effect with prev sample


This helps modders can register Projectiles, Warheads, Techno Types... on the fly

5. Auto modify tag value
For sample, modder want to add TechNo name to BuildCons of AI section
Code:

[AI]
@type = merge
BuildConst=@{current},AUBASE ; @{current} is special value, it means value of current tag

Output
Code:

[AI]
... another tags
BuildConst=...another values,AUBASE


6. Obfuscate section name
Code:

[unique:NewTechno]
... some tags here

[AnotherTechno]
Prerequisite=ref:NewTechno ; get NewTechno real name


Output
Code:

[ads577as996da]
...new techno tags

[AnotherTechno]
Prerequisite=ads577as996da


USAGE:
We can organize our INI files look like
rules.original.ini ; original rules
rules.soviet.builings.ini ; contains all building technos
rules.soviet.infantry.ini ; contains all infantry technos (may be weapons included)
rules.soviet.misc.ini ; other things

BAT file:
INITransformer.exe rules.ini rules.original.ini rules.soviet.builings.ini rules.soviet.infantry.ini rules.soviet.misc.ini

That will create rules.ini file with combinations of rules.original.ini, rules.soviet.builings.ini ...

Syntax:
INITransformer.exe OutputFile File1 File2 File3 ...

DOWNLOAD LINK:
This requires .Net 4.5.2
https://drive.google.com/drive/folders/1O4Ih8PLlfhk1MqWKpvAcbsSBOcPVdFfA?usp=sharing

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1523s ][ Queries: 11 (0.0077s) ][ Debug on ]