Posted: Sun Apr 15, 2018 9:57 pm 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 ...
; Can use @require anywhere, it will inject another file and parse immediately
@require=rulesmd.original,ini
@require.rulesmd.soviet,ini
... more files or new techno here
So we have simplier BAT file
INITransform.exe rulesmd.mod.ini
8. query for merging and updating
Code:
[?Replace armor type query:*] ; using wildcard for any chars, ? for single char
@where=Armor:concrete&ConstructionYard:yes ; this means tag filter for Armor = concrete and ConstructionYard=yes
Armor=NewArmorType
Sample 1
Code:
; render original rulesmo firstly
@require=rulesmo.original.ini
; define simple base section, it has Owner tag and make sure ForbiddenHouses tag must be removed
[AnyOwner]
@type=base
Owner=USSR,Latin,Chinese,PsiCorps,Headquaters,ScorpionCell,Europeans,UnitedStates,Pacific,Guild1,Guild2,Guild3
ForbiddenHouses=@@remove
; define new tech no
[TDHMGT]
; append it into BuildingTypes
@appendTo=BuildingTypes
; copy all tags from CAHMG gun
@extend=CAHMG
; it belongs to any country
@extend=AnyOwner
; more stuffs
BaseNormal=yes
Adjacent=10
Power=0
Powered=false
TechLevel=1
Also check out the comments on the other one. Such a tool isn't well received here from most experienced modders due to various good reasons. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Also check out the comments on the other one. Such a tool isn't well received here from most experienced modders due to various good reasons.
wow, thank you it really good. i never know it before. haha
I can collect some diff between it and mine
1. Can declare variable any where in my app
2. Can update multiple techno tags with few lines
3. Multiple inheritances, can pass arguments to base class
4. Easy to register techno warhead...
5.. Append / prepend value to existing techno tag value
hopfully these features help modder a lot QUICK_EDIT
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