Announcement

Collapse
No announcement yet.

UTILITY: Civilopedia Patcher

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • UTILITY: Civilopedia Patcher

    Even though this is almost common sense, I didn't know to do it this way until it occurred to me tonight and I had to go back and redo all my leader mods because of it.

    There is an easy way to change or add leaderheads without interfering with the original game or any other mod.

    1) When you change a leaderhead of an existing civ or add a new civ, give it a UNIQUE civolopedia entry. For example, if you change Joan to Napolean in your mod. Change the french civ's civilopedia entry from RACE_FRENCH to RACE_YOURMODNAME_FRENCH.

    2) When you add your flic file for the leaderhead animation, give it a path name like this: Scenarios\YourModName\Leader.flc rather than one like this: Art\Flics\Leader.flc

    3) Open up civilopedia.txt and add a new entry for #RACE_YOURMODNAME_FRENCH or whatever race you modified or added.

    4) Open up pediaicons.txt and add the entries needed for your civ. For example the first entries would be:
    #RACE_YOURMODNAME_FRENCH
    Scenarios\YourModName\Napolean.pcx
    Scenarios\YourModName\Napolean_all.pcx

    5) Create a folder in scenarios named "Yourmodname" matching the path you had been using and put all your new pcx/flic files in that.


    Now when people play your scenario they use the leaders you added, when they play other scenarios or the normal game they use whats in art\whatever.


    The only difficult part is that the two txt files have to be modified, but hopefully we can come up with some utility (or gramphos can add it to his) that can easily patch those without the end user needing to hand add the entries for your leaders.

  • #2
    Since Gramphos said he doesn't have time right now to modify his multitool to patch pediaicons.txt and civilopedia.txt. I went ahead and created a quick C program to do it for pediaicons.txt and civilopedia.txt/


    The readme file I included is below:
    To Use:

    1) Create a text file containing your new pediaicons.txt entries exactly as they should
    appear in pediaicons.txt (for example test.txt)
    2) Create a similar text file containing your new fields for civilopedia.txt as they
    should appear in civilopedia.txt (for example test2.txt)
    2) Run the program with the name of those files as its argument.
    ie) patcher test.txt test2.txt

    3) Ideally for your end users you would create a batch file to do this:
    install_my_mod.bat
    patcher my_mod_icons.txt my_mod_pedia.txt


    It will append any entries which were missing from pediaicons.txt to the bottom of
    pediaicons.txt. Any entry which is not missing is compared against a list of original key names (in the executable itself) to see if it was a key value that was part of the original text files, if so it is skipped and reported. Otherwise, it replaces the old entry.

    It will append any entries missing from civilopedia.txt at the end before the #EOF
    in a similar manner. Those not missing are skipped and reported.

    The included test.txt and test2.txt just an examples to show how to setup a pediaicons.txt and civilopedia.txt patch files.

    The program also backs up the users current civilopedia.txt and pediaicons.txt to
    civilopedia.bak and pediaicons.bak in the folder it is run from.

    It looks for civilopedia.txt and pediaicons.txt in the following locations in this order:
    In the current folder
    Full path for default install: (C:\Program Files\Infogrames Interactive\Civilization III\Text\
    With the assumption its run from the scenarios folder: ..\text\


    Version 3 added:
    Adds the protection for original keys in the files that came with the last patch (1.29)
    Allows replacing of non-protected entries rather than just skipping them. (thus a scenario author can patch his scenario)
    Added an unpatcher.exe which de-applies a patch applied by patcher.
    Attached Files
    Last edited by wervdon; July 21, 2002, 00:28.

    Comment


    • #3
      Oh and this goes without saying, but I highly reccomend you backup your original pediaicons.txt before using it. It should be 100% non-destructive as it only opens the file for reading and appending, but just in case it never hurts

      Ill try to have it make automatic backups when/if I update it again.

      EDIT: The 2nd version I uploaded makes backups to the folder it is run from:

      pediaicons.bak and civilopedia.bak, it overwrites those the next time it runs.
      Last edited by wervdon; July 20, 2002, 08:27.

      Comment


      • #4
        Last Comment: Chances are this same principle can be applied to anything which can have its civilopedia entry set in the editor and has its art files in the pediaicons.txt file, but I wouldn't swear to it without testing it

        Comment


        • #5
          Sample text files:
          test.txt
          #RACE_TEST_FRENCH
          scenarios\Wervdon\Napolean.pcx
          scenarios\Wervdon\Napolean_all.pcx
          #RACE_TEST_SPANISH
          scenarios\Wervdon\Isabella.pcx

          test2.txt
          #RACE_TEST_FRENCH
          We are the french!

          patcher test.txt test2.txt

          Would add those entries in test.txt to pediaicons.txt, and the entry for #RACE_TEST_FRENCH to civilopedia.txt without overwriting any old entries. If the entries for those keys already existed, they would be replaced by the new entries.

          Entries which were present in the original txt files that came with the game are protected and are still skipped.
          Last edited by wervdon; July 21, 2002, 00:29.

          Comment


          • #6
            I'm gonna try this out. And if it works you're a genious.
            I thought about doing something like this but couldn't find the txt file where it was at.

            It's not a perfect fix, but at least we've gotten the file changes down to 2 files instead of every leader .flc and .pcx.

            Comment


            • #7
              It definately works for just adding civs and leaders I tested that much. I have no idea what would happen if you tried to use it for unit graphics, but I strongly suspect it would work since the principle should be the same.

              And yeah, its not perfect cause there's still alot of setup for the mod/scenario maker to do, but at least it reduces the set of instructions of end users to:
              unzip mod/scenario
              Run batch file
              Load civ3, pick the scenario and play


              The patcher still needs one more update though, but its too big of one for me to do today. Ideally, it shouldn't skip over fields it finds already in the text files since that doesnt allow mod makers to easily distribute fixes to their scenarios. But to do that Ill need code to do more than append entries to the end of those files since the original entries need to be deleted too. And if I allow replacing old entries, Ill also want to build in write-protection for any of the keys that were in the original files so mod-makers can't muk up someone's game without really trying. (ie it wouldn't let you write to #RACE_FRENCH cause it was in the original .txt files) I guess there'll be a version 3 of it sometime this week to address those issues, we don't need it yet though since no one has used it to distribute any scenarios with errors in the text files yet to need to correct Once I do that, Ill probally also supply an "unpatcher" to remove a scenario/mods entries since the only changes that'd be needed at that point is to skip the writing out of the changes function calls.
              EDIT: That update is above now, I don't perceive needing anymore updates to this unless its for a bug that I missed.
              Last edited by wervdon; July 21, 2002, 00:29.

              Comment


              • #8
                Now what?

                Shall I move this to files?
                Creator of the Civ3MultiTool

                Comment


                • #9
                  You tell me, your the mod

                  Seriously though, go ahead if you think it belongs there

                  Comment


                  • #10
                    What do you have to change so that the .FLC files are found in the correct location? I manually changed the PediaIcons.text and Civilopedia.text files, and I have yet to test it. I was just wondering how the .FLC leaderhead files are found.

                    Comment


                    • #11
                      You set those in the editor under the civilizations tab. As far as I know its the only art that is set in the editor directly.

                      Comment


                      • #12
                        Originally posted by wervdon
                        You tell me, your the mod

                        Seriously though, go ahead if you think it belongs there
                        I'm not sure...

                        It belengs both here and there. And they belong together. But as there are so many topped threads here I'll probably move it.
                        Creator of the Civ3MultiTool

                        Comment


                        • #13
                          Originally posted by wervdon
                          You set those in the editor under the civilizations tab. As far as I know its the only art that is set in the editor directly.
                          *Smacks forhead*

                          I was so busy with all that text and .INI file editing I completely forgot about that!

                          Comment


                          • #14
                            Hmm, I guess with the mod manager in ptw, this will become useless this fall, but oh well Im glad they are doing it, since this couldn't handle units or such.

                            For those not sure what im talking about in ptw, each scenario gets its own /art directory in the scenario folder which over-rides the default game art folder for stuff present, at least thats how I read the excerpt from the chat log


                            I guess this will still be useful to people who don't upgrade to ptw too assuming they don't patch that into base civ3

                            Comment

                            Working...
                            X