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 Mon Dec 02, 2024 7:43 pm
All times are UTC + 0
INI Tool helps spliting and merging multiple files
Moderators: Community Tools Developpers
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
linq2js
Light Infantry


Joined: 26 May 2011

PostPosted: Tue Feb 02, 2021 1:42 am    Post subject:  INI Tool helps spliting and merging multiple files Reply with quote  Mark this post and the followings unread

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 is very basic use case, there are alot special use cases you can found here https://www.npmjs.com/package/ini-merge

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

Back to top
View user's profile Send private message
TAK02
General


Joined: 28 Jun 2015
Location: It was Damascus.

PostPosted: Tue Feb 02, 2021 7:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

Back to top
View user's profile Send private message Send e-mail Visit poster's website ModDB Profile ID YouTube User URL Twitter Channel URL Skype Account
linq2js
Light Infantry


Joined: 26 May 2011

PostPosted: Tue Feb 02, 2021 8:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

TAK02 wrote:
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:

main.ini
Code:

;#import original_rulesmd.ini
;#import countryA.ini
;#import countryB.ini


countryA.ini
Code:

;#import countryA_vehicles.ini
;#import countryB_infantry.ini


countryA_vehicles.ini
Code:

[TANKA]
;#appendTo VehicleTypes
;#apply TankLogic
Primary=TANKA_Primary

[TANKB]
;#appendTo VehicleTypes
;#apply TankLogic
;#apply AmphibiousLogic
Primary=TANKB_Primary


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

Back to top
View user's profile Send private message
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Thu Feb 04, 2021 6:41 am    Post subject: Reply with quote  Mark this post and the followings unread

A lot of work to create a problem to solve #Tongue

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
Holland
Grenadier


Joined: 31 May 2017

PostPosted: Tue Mar 30, 2021 10:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Hey thats pretty neat. I already do something similar. I write ini files like this;

[Vehicletypes]
Kittie26=kittie26

[Kittie26]
Codes blabla
Primary=hairball

[Hairball]
Codes blabla
Projectile=hair

And then i share it on my topic on cncnet
https://forums.cncnet.org/topic/10252-adding-mods-with-final-sun-ts-mods-included/

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.

But its pretty neat that it can split up the entire ini .. i gotta try it out.
Xcc ini clt can also merge or subtract ini files
And funky also made a neat ini tool https://ppmforums.com/topic-48261/ini-file-merge-and-subtract-tool/

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.

That would be ideal and quick c&c modding.

Anyway, ill check it soon

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] 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
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
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


Powered by phpBB © phpBB Group

[ Time: 0.2078s ][ Queries: 11 (0.0086s) ][ Debug on ]