Jump to content


Photo

Tool to fix -mod command (v1.03)


  • Please log in to reply
52 replies to this topic

#1 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 31 January 2007 - 06:46 PM

Today I present you with a tool, that is inevitably going to make your modding lives much easier ;)

As you know, for some strange reason, when you use the -mod command to make your modifications to BFME, changes in gamedata.ini don't get read. Now, unfortunately that's just the file that contains all the unit data such as health and stuff. There are two things you can do:
1. Change all options directly in the appropriate files. In the end this will result in an unmanagable gibberish.
2. Move the macros (#define BLABLA) somewhere else. Unfortunately, you can't give them the same name, so you have to rename them. However, then you have to update all the references in all the ini files to your new macros, which you had to do by hand...



But not anymore!



This tool I made does that for you ;)



Here's how it works:
- Download the rar file and extract it in 'X:\somefolder'
- Put a copy of your INI files in 'X:\somefolder\old' (so you will have, for example, 'X:\somefolder\old\commandbutton.ini' and 'X:\somefolder\old\object\goodfaction\units\men\aragorn.ini')
- Make a new .bat file, with these codes (save it in 'X:\somefolder')

java -jar MacroRenamer_1.4.jar M_ old new
pause
- Run the bat file by double clicking
- Let it run (this will take a long while, but it will report what it's doing)

What it will do:
- Load all macros in gamedata.ini
- Rename them all, by putting a prefix before them (which, in the .bat file above, is 'M_'. change it if you want something else*).
- Update all files to reference the new macros, and store them in a new folder

* = the prefix can only contain numbers, letters and the underscore. IT MUST NOT begin with a number

Now, when it's done, all you have to do is:
- move all the macros in 'gamedata.ini' to 'default\water.ini'
- move the GameData block in 'gamedata.ini' to a new file 'object\gamedata.ini'
- and of course put the new INI files at the appropriate place in your mod ;)

Notes:
- I've programmed this tool not to alter the original files. However, bugs can of course always be present, so have a backup!
- You need the Java Runtime Environment for this to work. I've programmed it on version 6 (or 1.6, if you like), but maybe it will work on 5 as well (but get 6 anyway)
- If there are files that you are 100% sure, don't contain any references to a macro, delete them before starting, because the program will go trough them anyway

Using the -mod command is now definitely THE only way for modding.
Have fun :)






Preconverted INI folders

BFME 1 - 1.03
BFME 2 - 1.06
ROTWK - 1.00

If you have another useful converted INI folder (e.g. ROTWK originals) please send them to me.






Changelog

Version 1.4
Apparently there was still a bug in 1.3, it didn't read macros in files that are simple included by gamedata.ini. That is fixed now
Also:
- Progress bar changed from dots to stars
- The tool logs everything in macrorenamer_log.txt, in it's working directory

Version 1.3
Because there are some macros in experiencelevels.ini with the same name as some hero KindOfs (e.g. ARAGORN and GANDALF) some serious crashes occured when trying to launch the converted BFME 2 1.06 INI. This version only reads macros from gamedata.ini, which is more a workaround than a solution, but will do for now.

Version 1.2
There was a serious bug in 1.1, making it unusable. This one has fixed that. Also:
- It reports the time it takes to do one file, and all the files
- It will not process a file if it is already present in the target directory (useful when the program crashes)
- Improved layout

Version 1.1
After trying to convert a BFME 2 INI directory, which was still at the beginning after an hour, I made a version that performs a lot better.

Version 1.0
First version

Attached Thumbnails

  • macroRenamer1.2.jpg
  • macroRenamer.jpg
  • macroRenamer2.jpg
  • macrorenamer_1.4.jpg

Attached Files


bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#2 Joe

Joe

    title available

  • Project Team
  • 886 posts
  • Location:England
  • Projects:Real Life

Posted 31 January 2007 - 06:56 PM

Did ya get bored? Good work
Posted Image
Posted Image
Posted Image

#3 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 31 January 2007 - 06:58 PM

bored? no. i learned a lot about using regular expressions and files/directories with Java today

edit: heh, i hit the Submit button and when the page is done loading, there's a reply below my post :)
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#4 Juissi

Juissi

    AWESOM-O

  • Hosted
  • 1,555 posts
  • Location:Finland
  • Projects:Last Alliance modification, The Hobbit mod
  •  Forger Of (Last) Alliance

Posted 31 January 2007 - 06:58 PM

Nice work with it. Im sure that it will be handy tool.

#5 cahik_

cahik_

    Sage engine ruler

  • Project Team
  • 1,896 posts
  • Location:Czech Republic
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member and Crazy animator

Posted 31 January 2007 - 08:40 PM

good job 2play, definatly handy tool :)

Posted Image

Posted Image
Posted Image


#6 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 31 January 2007 - 08:46 PM

i'm currently converting an original bfme 2 1.06 ini, which i will upload when it's done

edit: it took so long, i made a better performing version
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#7 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 01 February 2007 - 01:42 PM

just found out the new version doesn't quite work ok. use the old one for now

edit: yes, it's fixed (for the techies under you: i forgot to close the output stream ;)). i'm running some tests now, and if all is fine i will upload version 1.2 ASAP. other changes
- it reports the time
- better report layout
- if a file is already in the target dir, it will be skipped (very useful if it crashes or something)
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#8 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 02 February 2007 - 11:08 AM

after ten hours of converting (!), i have uploaded a completely converted BFME 2 1.06 ini
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#9 Clement

Clement

    title available

  • Network Staff
  • 1,442 posts
  • Location:France
  • Projects:Various
  •  T3A Team Chamber Member
  • Division:Revora
  • Job:Developer

Posted 02 February 2007 - 10:39 PM

Perfect :)

It's even too easy now :)
Posted Image

#10 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 04 February 2007 - 10:11 PM

Because there are some macros in experiencelevels.ini with the same name as some hero KindOfs (e.g. ARAGORN and GANDALF) some serious crashes occured when trying to launch the converted BFME 2 1.06 INI. This version only reads macros from gamedata.ini, which is more a workaround than a solution, but will do for now.

I'm now reconverting the BFME 2 1.06 INI, but it will take a while. I calculated why:
- There are a grand total of 5000 (!) macros in gamedata.ini
- The total size of the ini folder is about 20MB
- It reads trough each file looking for each macro. That means 5000 * 20 MB = 100 GB of text processing! :p
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#11 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 04 February 2007 - 10:55 PM

the new ini is up, and this time i've actually tested it :p (and it works)

enjoy
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#12 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 05 February 2007 - 10:52 PM

Apparently there was still a bug in 1.3, it didn't read macros in files that are simple included by gamedata.ini. That is fixed now
Also:
- Progress bar changed from dots to stars
- The tool logs everything in macrorenamer_log.txt, in it's working directory
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#13 Solinx

Solinx

    .

  • Undead
  • 3,101 posts
  • Location:The Netherlands
  • Projects:Real Life
  • Division:Revora
  • Job:Retired Leader / Manager

Posted 06 February 2007 - 04:09 PM

Running the program for BFME 1 ini now :)
Done in approximately 2 - 2,5 hours

Solinx
Posted Image

"An expert is a man who has made all the mistakes which can be made in a very narrow field." - Niels Bohr


#14 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 06 February 2007 - 07:14 PM

BFME 2 INI is now up
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#15 Clement

Clement

    title available

  • Network Staff
  • 1,442 posts
  • Location:France
  • Projects:Various
  •  T3A Team Chamber Member
  • Division:Revora
  • Job:Developer

Posted 06 February 2007 - 08:18 PM

Running the program for BFME 1 ini now :p
Done in approximately 2 - 2,5 hours

Solinx



Lucky you are! Bfme2 Rotwk takes me around 13 hours :) , and I have to export it again *I should be more concentrated sometimes*
Posted Image

#16 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 07 February 2007 - 03:15 PM

thanks TDP for the ROTWK ini, which is now up
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#17 Bart

Bart

  • Network Admins
  • 8,524 posts
  • Location:The Netherlands
  • Division:Revora
  • Job:Network Leader

Posted 07 February 2007 - 07:02 PM

thanks to Solinx, the BFME 1 1.03 INI is also online
bartvh | Join me, make your signature small!
Einstein: "We can’t solve problems by using the same kind of thinking we used when we created them."

#18 Solinx

Solinx

    .

  • Undead
  • 3,101 posts
  • Location:The Netherlands
  • Projects:Real Life
  • Division:Revora
  • Job:Retired Leader / Manager

Posted 08 February 2007 - 06:36 PM

You're welcome :grin:

Solinx
Posted Image

"An expert is a man who has made all the mistakes which can be made in a very narrow field." - Niels Bohr


#19 Nazgûl

Nazgûl

    S.E.E. Team Leader

  • Hosted
  • 10,582 posts
  • Location:Sweden
  • Projects:BFME2 - Nazgûl's Special Extended Edition
  •  Veteran

Posted 09 July 2007 - 08:26 PM

Hi 2Play :D

Sorry to bring this up here in case it's unappropriate? Please move this post if so :p
We have a strange bug in SEE, and rumour says it might be related to the -mod command?
Could that be true? And if so, is there a way to solve it? ;)

"Settings Reset bug"

// C}{riZpc_punch.gif
"Do not come between the Nazgûl and his mod!"
SEE_Banner_2008.jpg
SEE-Team_Leader.jpg
----------------------------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>>>>>>>> I S.E.E. YOU! <<<<<<<<<<<<<<<<<<<<<<<
----------------------------------------------------------------------------------------------------


#20 Hostile

Hostile

    Benefitting Humanity Simply by Showing Up!

  • Veterans
  • 9,551 posts
  • Location:Washington DC
  •  T3A Founder
  • Division:Revora
  • Job:Global Administrator
  • Donated
  • Association

Posted 09 July 2007 - 11:40 PM

I never understood the need for this program. Seems like using a nuke to kill a fly. All you have to do is take the changes you want from the gamedata.ini and simply place it in it's own tiny little file in the objects folder named "anythingyouwant"


The gamedata.ini changes are read correctly and function perfectly with the -mod command.

What the heck do you need a fancy program to do that for?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users