Posted: Sun Apr 15, 2018 11:45 am Post subject:
Tool for editing INI file
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 ...
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