Page 1 of 7 1234567 LastLast
Results 1 to 20 of 137

Thread: [TUTORIAL] How to create Mods

  1. #1
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default [TUTORIAL] How to create Mods

    With the release of the Pack files manager 1.9.9 (LTChambers and Alpaca are doing a superb work), it's now easy to create mods as they’re supposed to be done by CA, so I will try to explain the feature of this new format and why it should be used over the old patch method.
    The mod format will overwrite the patch format at start of the game, so there’s no more troubles finding wich patch load first (this is one of the interests of this format).
    For this tutorial, I will include my work to change the standard bearer / musician for some units.
    I will not explain here how to make these changes but more of the mod structure to limit the overwriting/conflicting problems that could happen when using multiple mods.



    The first thing to note is that even if I respect the structure of the pack file, my adds aren’t named like the default ones, this way I can add or overwrite just the entry that concern me in the original pack:






    As showed in this screen, I’ve just put my new entries to the battle_personnalities_table in a new file called ottomans_personnalities, this way I don’t have to put the whole original battle_personnalities and I’m sure that my file will not conflict with other mods affecting this file.
    At start, the game will start loading the normal pack files then my mod, when it finds my new file it knows from my file structure that this is concerning the battle_personnalities_table but because of a different name he will not overwrite the original, just add my new rows.

    NOTE: unless you're really attempting to overwrite all the native file you must use a different name.
    If I had called my ottomans_personalities battle_personalities, the game will overwrite the original battle_personalities with my new one containing only three rows and probably crash.
    That was stated by Jerome from CA:

    Quote Originally Posted by JeromeGrasdyke View Post
    Ok. If you were to make a mod which supplies a new file called "db/unit_stats_land_table/unit_stats_land" it would override the one from the CA packs. Yours would be used, the CA one would not. That's file-level overriding, and it's not something that you normally would want to do to the database files (although I imagine it'll be pretty common with data files like tga's and so on).

    Instead, you should put in a file named something like "db/unit_stats_land_table/delphy_mod_unit_stats"... the game should then pick it up, and *add* any records that are in your file to the ones that are in the CA-supplied main one. And then if there are any records with the same name in the two files, the one that gets loaded last (the mod one) will be what's used. It'd be a good idea to try and pick unique, relevant names for the files your mod adds, as well.

    I’ve worked the same way with the battle_stat_land file except that I want to overwrite the Information concerning some units (not all of them!) so I just put the lines that concern me in this file.



    Note that if I had named it units_stat_land in place of my custom name it would have overwritten the whole original.
    Now that I’m done with my modifications I just have to check that my mod is in the correct format and then save it.



    DONE !!!!!
    Not really in fact, if you try to run the game now, your mod will not work!
    To activate the mod, you’ve got to create a little text file in the script folder which contain the preferences files

    Edit: There's a link above for a tool that take care of this (and much more) so you can skip this part

    On Win XP, it’s situated at: C:\Documents and Settings\[USER-NAME]\Application Data\The Creative Assembly\Empire\scripts

    On Vista: C:\Users\[USER-NAME]\AppData\Roaming\The Creative Assembly\Empire\scripts
    (Thanks to Phenom)

    (The saves are near this too by the way…)

    If you have troubles finding the folder, check that in your windows options you’ve checked the show hidden files stuff.
    Now that you’re here, there should be a text file called “preferences.empire_script.txt”, just leave it and create a new one called: “user.empire_script.txt”
    Open your newly created file and add this line: mod [MOD NAME].pack;
    For my mod it’s: mod MrThib-ottomans-textures.pack;
    Save.

    Thanks to Waronmars for finding out this:

    Quote Originally Posted by waronmars View Post
    TO MAKE YOUR user.empire_script.txt WORK:

    When you save your text file, go to SAVE AS and select UNICODE under encoding. The reason it wasn't working before is that Windows defaults text files to ANSI, which empire doesn't like.


    Mr. Thib, you might want to add this to your tutorial.


    And now your mod is fully functional in game.
    So, why the text file stuff? Because with this you can activate/deactivate mods without moving/deleting the mods files, this way if some mods are conflicting you can just delete the entry in this file one by one to find the problem.
    You can use this link to download the mod manager created by LTChambers, this tool will take care of the text editing for you as well as managing your mods at start of the game and their loading order, it's simple and effective: http://www.twcenter.net/forums/showthread.php?t=240335 (a must have for modders and mod users)








    Happy modding!!


    PS: I join my little mod and the text file so you can check by yourself
    Last edited by MrThib; March 21, 2009 at 12:26 PM. Reason: Updating infos about mod manager

  2. #2

    Default Re: [TUTORIEL] How to use the new mod format

    Holy , nice work...! Finally I understood how the mod format works and stop the bloody game from crashing again... Thanks! I will rep if I could.
    I don’t know the location of this file in Vista through… please post it there and I will add it.
    Btw, for Vista I think it's C:\Users\[USER-NAME]\AppData\Roaming\The Creative Assembly\Empire\scripts

    Haha... one thing I noticed... our tutorials all have to do with Ottomans inside... LOL!
    Last edited by The Phenom; March 20, 2009 at 05:56 AM.

  3. #3
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [TUTORIEL] How to use the new mod format

    Thanks I've noticed that a lot of people are having trouble with this , I will add the result in game as a final eye-candy!
    Edit: done.... more or less, I can't put the pict directly, don't know why...
    Last edited by MrThib; March 20, 2009 at 05:54 AM.

  4. #4

    Default Re: [TUTORIEL] How to use the new mod format

    Btw... use imageshack... it's faster and more reliable.

  5. #5

    Default Re: [TUTORIEL] How to use the new mod format

    Excellent work guys .. so is this the offical? mod pack editor? .. or should I wait for the nice officlal version?

    BTW, shouldn't the editor create/edit the config file as well .. n00bs (me!) are going to forget, screw it up etc

    R

    BTW, where do we get this pack editor?

    Thanks
    oOo

    Rome 2 refugee ...

    oOo

  6. #6
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [TUTORIEL] How to use the new mod format

    the editor / pack manager is here: http://www.twcenter.net/forums/showt...49#post4738949

    It's not the official but it's quite user friendly, you should try it this guys are doing some great work.

    shouldn't the editor create/edit the config file as well
    I'm sure some people will do one really soon, it dosn't seem that hard (even if I suck at programing) or you can wait for the official one that will be release ... someday...

  7. #7

    Default Re: [TUTORIEL] How to use the new mod format

    Woot! I've just tested it, and it WORKS! Thanks again, you've just saved me from endless frustation!

  8. #8
    notger's Avatar Decanus
    Join Date
    Dec 2006
    Location
    Berlin, Germany
    Posts
    585

    Default Re: [TUTORIEL] How to use the new mod format

    MrThib, as far as I understood Jerome from CA in the stickied post, there is no need to choose different names for the tables. When the systems loads up, there is a parsing queue and your new values will just overwrite the appropriate values in the appropriate tables. You are not forces to copy and paste the whole table, rename it or anything else.
    Your new rows would be added, even if you named the table the same as the original.

    Did I get him wrong or did you just make things a tad different?

  9. #9
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [TUTORIEL] How to use the new mod format

    Quote Originally Posted by notger View Post
    MrThib, as far as I understood Jerome from CA in the stickied post, there is no need to choose different names for the tables. When the systems loads up, there is a parsing queue and your new values will just overwrite the appropriate values in the appropriate tables. You are not forces to copy and paste the whole table, rename it or anything else.
    Your new rows would be added, even if you named the table the same as the original.

    Did I get him wrong or did you just make things a tad different?
    I've not tested this actually, but would be a nice feature, if someone have try it please tell me.
    But one great thing with the differents namings is that you can keep clear extracted folders with all your modded db files without overwriting the same file again and again, that way you can modified a mod easily without extracting the files again (I don't know if you understand what i try to say?).

    Edit: Oh, and that structure allow some sorts of patching too, you don't have to mod the actual packed files but you can just add another (ex: ottomans_personnalities_2 coming after the original in the same pack), that way it make it easy to debug your mods when you're adding features.
    Last edited by MrThib; March 20, 2009 at 07:01 AM.

  10. #10
    Campidoctor
    Join Date
    Sep 2006
    Location
    Cincinnati, OH
    Posts
    1,593

    Default Re: [TUTORIEL] How to use the new mod format

    Hmm, question here. When I enter my into my username on vista there isn't a folder entitled AppData.

  11. #11
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [TUTORIEL] How to use the new mod format

    I'm perhaps wrong here, it should be near your savegames, if you find it please post it here so I can correct.

  12. #12

    Default Re: [TUTORIEL] How to use the new mod format

    this dont work for me wtf i copied my patch.pack and renamed it moises's-patch.pack and i changed it to mod like the picture shows then i made the txt file and added the line "mod moises's-patch.pack ;" and after i wanted to see if it worked so i changed my polish line infantry reload time to 80 and it remained at 50 wat i do wrong?


    yup i just re-tried it and failed sigh ill just keep writing over the patch.pack method much easier and it doesint make the game take 3 mins to load and not exagerating lol sigh what ever
    Last edited by moisesjns; March 20, 2009 at 08:04 AM.

  13. #13
    Campidoctor
    Join Date
    Sep 2006
    Location
    Cincinnati, OH
    Posts
    1,593

    Default Re: [TUTORIEL] How to use the new mod format

    Woops, turns out AppData is a hidden folder. If you click on the Organize tab and then the folder and search options you can enable hidden files under "view". Thanks for the help. Kind of new to Vista myself, so I'm not sure where everything is as of yet.

  14. #14
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [TUTORIEL] How to use the new mod format

    Quote Originally Posted by moisesjns View Post
    this dont work for me wtf i copied my patch.pack and renamed it moises's-patch.pack and i changed it to mod like the picture shows then i made the txt file and added the line "mod moises's-patch.pack ;" and after i wanted to see if it worked so i changed my polish line infantry reload time to 80 and it remained at 50 wat i do wrong?


    yup i just re-tried it and failed sigh ill just keep writing over the patch.pack method much easier and it doesint make the game take 3 mins to load and not exagerating lol sigh what ever
    Have you try my mod? Does it work?
    If yes, just try to remove the 's from your mod name (and from the txt), that could be the problem.

    MrThib, as far as I understood Jerome from CA in the stickied post, there is no need to choose different names for the tables. When the systems loads up, there is a parsing queue and your new values will just overwrite the appropriate values in the appropriate tables. You are not forces to copy and paste the whole table, rename it or anything else.
    Your new rows would be added, even if you named the table the same as the original.

    Did I get him wrong or did you just make things a tad different?
    It seem I was right on this, if you choose the same name it would just overwrite the original.
    Jerome just post it there: http://www.twcenter.net/forums/showt...79#post4739479
    So yes, it's important to change the names or you would overwrite all the default files.
    Last edited by MrThib; March 20, 2009 at 08:14 AM.

  15. #15
    Senator
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    1,350

    Default Re: [TUTORIEL] How to use the new mod format

    nice tutorial dude but why is this way better than the old way exactly?


  16. #16

    Default Re: [TUTORIEL] How to use the new mod format

    Quote Originally Posted by lesterthenerd View Post
    nice tutorial dude but why is this way better than the old way exactly?
    Because you don't have to mess with the game's native files, so changes won't get overwritten by a new patch and won't interfere with multiplayer. I'll whip up a mod manager to set up the AppData script file based on selected mods tonight.

  17. #17
    Miles
    Join Date
    Mar 2009
    Location
    Lille, France
    Posts
    325

    Default Re: [TUTORIEL] How to use the new mod format

    Quote Originally Posted by lesterthenerd View Post
    nice tutorial dude but why is this way better than the old way exactly?
    I'm not sure of the "old way", if you mean patch format, there is some loading order issues with the officials patch.

    The trick with the movie format is a trick, I think it could become conflictual with multiple mods overwriting each others and no way to manage the loading order (on this one I think the user text file with mod format control it), the movie format wasn't meant to that through so conflicts could occur.

    At least, you can simply control the mods running with the text file (and soon with a mod manager that will do it), so no need to move/delete/rename the mods each time.

    Finally, because it's how mods are supposed to work (that's how CA implement it, and this seem quite performant).

    I'll whip up a mod manager to set up the AppData script file based on selected mods tonight.
    Yay! I was sure someone was working on it, you impress me more and more every days LT.
    Last edited by MrThib; March 20, 2009 at 08:27 AM.

  18. #18

    Default Re: [TUTORIEL] How to use the new mod format

    Quote Originally Posted by notger View Post
    MrThib, as far as I understood Jerome from CA in the stickied post, there is no need to choose different names for the tables. When the systems loads up, there is a parsing queue and your new values will just overwrite the appropriate values in the appropriate tables. You are not forces to copy and paste the whole table, rename it or anything else.
    Your new rows would be added, even if you named the table the same as the original.

    Did I get him wrong or did you just make things a tad different?
    Nope, tried it... it crashed my game.

    Hmm, question here. When I enter my into my username on vista there isn't a folder entitled AppData.
    Have you enabled the view for hidden folders?
    Last edited by The Phenom; March 20, 2009 at 08:38 AM.

  19. #19
    Senator
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    1,350

    Default Re: [TUTORIEL] How to use the new mod format

    well im convinced nice work!


  20. #20

    Default Re: [TUTORIAL] How to use the new mod format

    cause im a total idiot and i truly mean that i dont even understand how you added db there and the other info it took me 15 minutes to realize how to name the pack by the way does the name matter at all or can it be anything? plz help a total idiot lol

Page 1 of 7 1234567 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •