Posted: Tue Feb 02, 2021 1:42 am Post subject:
INI Tool helps spliting and merging multiple files
When modding C&C game, we have large INI and it hard to manage/edit. My idea is spliting large file to multiple small files, once we done editing we will merge them all into one file.
Let me demo simple use case. I need custom/add new vehicle to Metal Omega mod. Firstly I must extract original Mental Omega rules file and I create my own ini file, it called main.ini
Code:
;#import original/rulesmo.ini
; all sections of rulesmo.ini will be imported here
; start adding new vehicle
[NewVehicle]
; extend my vehicle from VCARR with #extends directive
;#extends VCARR
; register NewVehicle to VehicleTypes section with #appendTo directive
;#appendTo VehicleTypes
; my vehicle requires only factory, nothing more
Prerequisite=ALLWEAP
Then I open Window command line at current working folder and run command:
Code:
ini-merge main.ini output/rulesmo.ini
I got new rulesmo.ini at output folder. When Mental Omega mod updated, I just update original rulesmo.ini
This INI tool requires npm to run, please go to this link and download npm executable https://nodejs.org/en/download/
When you installed npm, you need to run the command below in command line window
Code:
npm install --global ini-merge
Please feel free to give me some feedback QUICK_EDIT
I can see this being useful if you don't want to jump from A to B to C in the same INI and possibly losing your train of thought.
Though in that case I'd recommend opening the INI in a new Notepad window and/or use Notepad++' "clone to other view" and "open in new instance".
Not downplaying your work, just questioning the reasoning behind this creation.
Thank for your comment. I think we can do anything with copycat. But with my tool, your INI file is more readable, simplier, easy to mainternant/update. For example, your INI mod project looks like:
You can reuse your INI snippet with ease. once you change TankLogic, you dont need to update its references
You dont care order of TANKA and TANKB in VehicleTypes list QUICK_EDIT
So anyone can easily put it in their map file. Tibsun editor Finalsun has an ootion 'insert ini content', and it uses the same codes u use for your tool, it lists them all in the map perfectly.
It would be really cool if theres an ini tool for all kinds of needs for cnc games.
Ive always imagined a tree organizer that can easily bring you all related ini content.
For example if u click [tankA], that it will bring up [vehicletypes]368=tankA, but also its weapon. Cus [tanka] has primary=weapon1, it will also bring up [weapon1], and weapon1 also has its projectile and warhead, those will also all show in the tree, for easy grab.
You can post new topics in this forum You can 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