Announcement

Collapse
No announcement yet.

How To Mod / Where to Mod - XML Files

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

  • How To Mod / Where to Mod - XML Files

    This MAY have been covered in peices here and there, but I haven't been able to find it. If it exists elsewhere in a comprehensive fasion, please point me at it. If it doesn't, could one of the experienced Modders please explain it (and in small language)

    (Also - I did read the Modding manual. It just talks about how to -pre-think your mod/scenario, and how to create a scenario. I don't want to create a scenario. I just want to alter the rules I play within, in all 'Custom World' games as a single player.)

    Premise #1: Modding the actual game files and returning them to the orginal directory is bad.

    Question #1: I saw a post that alluded to the fact that there is a 'mods' directory in the 'program files' CIV dir. and that there is a 'MODS' directory in the 'My Games' directory (The post said implied that the less obvious place was correct). Where do I put my mods files so that I can go to advanced, "Load Mod", and then play a custom world game?

    Premise #2: Modding should be easy and able to build upon others works.

    Question #2: Is the below example a legal way to make a mod in the CIV modding system? (If not, please let me know what about my example is wrong)

    Example: I want to make a mod, that builds upon someone elses mod. An easy example is the Treebuilder mod, that added a new terrain improvement "Tree Plantation" that turns into a real forest after X turns.

    So far it seems like all the modders have been taking the full XML file that defines all the different descriptors they need, and duplicating them and editing them. Since I would like this to be a small and simple mod I just want to use the new definitions in my xml files and nothing else.

    I will take the treebuilder mod files, cut out all the definitions that DID NOT change between vanilla CIV, and the mod. I will then put all those text lines into 1 or 2 files that go into specific directories, with a defined treebuilder_Lite.ini that calls out those files.

    Question 2.1: Did I just make a _Lite_ version of the treebuilder mod?

    Now I will make my own extension to the treebuilder_lite mod. I will make a file and re-define some of the arguments in the treebuilder mod. Lets assume the original mod had Turns_Before_Forest=25. In my Backpack_Mod I am going to define T_B_F=15. I now create a Backpack_Mod.ini that calls out my single new file which has the cingle argument definition of T_B_F=15.

    Now I create a Backpack_Treebuilder_Mod.ini that calls out #Inherit Treebuilder_Lite
    #Inherit Backpack_Mod
    (in that order, using whatever the command should be for Inherit).

    Question 2.2: Did I just create a mod that when loaded, uses the CIV vanilla files as a base, Then loads the treebuiler_lite mod files (And overwrites some of the vanilla CIV arguments and definitions), and then loads the Backpack_Mod and overwrites some of the arguments and definitions already loaded by CIV and Treebuilder?

    -----------------------------------
    Looking back at my example, I think I can summarize my xml modding questions a bit.....

    3.1: Can I define/redefine things to be loaded, without duplicating the ENTIRE xml file that the vanilla game normally defines them in? (misc1.xml is HUGE and appears a s ahodgepodge anyway)

    3.2: Can I #inherit files to combine Mini_Mods into a more comprehensive mod?

    3.3: Can I #inherit 'serially' so that any conflicts between inherits are decided by the order in which they are loaded or called out?
    -----------------------------------

    Thanks for reading (And sharing if you know these answers)

    Backpack
    ---- "What gunpowder did for war, Blake has done for the AI" - Diadem ----

  • #2
    Re: How To Mod / Where to Mod - XML Files

    Originally posted by Backpack
    Premise #1: Modding the actual game files and returning them to the orginal directory is bad.

    Question #1: I saw a post that alluded to the fact that there is a 'mods' directory in the 'program files' CIV dir. and that there is a 'MODS' directory in the 'My Games' directory (The post said implied that the less obvious place was correct). Where do I put my mods files so that I can go to advanced, "Load Mod", and then play a custom world game?
    You would have to put them in your Sid Meier's Civilization 4/Mods folder for that.
    Create a new folder in the Mods folder, and name it 'MyMod' for example. Then create a new 'Assets' folder within that. You'll then have to 'recreate' the structure of the standard Assets folder, so your modified files are placed in folders that would correspond to the standard game Assets folders. For example, if you have modified the file
    Sid Meier's Civilization 4/Assets/XML/Units/CIV4UnitInfos.xml
    you should place your modified file in
    MyMod/Assets/XML/Units

    Premise #2: Modding should be easy and able to build upon others works.

    Question #2: Is the below example a legal way to make a mod in the CIV modding system? (If not, please let me know what about my example is wrong)

    Example: I want to make a mod, that builds upon someone elses mod. An easy example is the Treebuilder mod, that added a new terrain improvement "Tree Plantation" that turns into a real forest after X turns.

    So far it seems like all the modders have been taking the full XML file that defines all the different descriptors they need, and duplicating them and editing them. Since I would like this to be a small and simple mod I just want to use the new definitions in my xml files and nothing else.

    I will take the treebuilder mod files, cut out all the definitions that DID NOT change between vanilla CIV, and the mod. I will then put all those text lines into 1 or 2 files that go into specific directories, with a defined treebuilder_Lite.ini that calls out those files.
    You can do that with the XML files that are in the TEXT folder. The game will read any file placed in that folder, regardless of what they're called (see the Mods/Desert War/Assets/XML/Text folder for example).

    But the game doesn't support doing that for the rest of the XML files, so you'll have to include all the entries you want in your mod, even the ones that weren't changed.
    Double Your Pleasure mod | DYP Forums | DYP Mod thread

    Comment


    • #3
      Hey, are you talking about my Tree School improvements or did somebody do exactly the same thing but named it differently?

      About the actual questions at hand, unfortunately - as isak said - modding CIV isn't quite as flexible as you'd wish it to be.
      _____
      rezaf
      _____
      rezaf

      Check out my Forest planting mod or my Terrain adaption mod

      Comment


      • #4
        Yes Rezaf - I just didn't take the time to look up the correct mod name for my example (your mod).

        Because you and so many other people will experience 'that itch' for different problems, I was looking for a simplistic way to combine solutions into a 'personal' mod. Yours is just the first of many little mods that I'm gonna see and say "I wanna play like that"
        ----------------


        Isak -
        Thanks for the confirmation that to make 'generic' mods they have to go in the "My Program" tree structure.
        Thanks for the confirmation that the TXT.xml files won't have to be duplicated. (It was misc1.xml that made me think this kind of behavior might exist, as it appears to be a hodge-podge of different topics.)

        --------------------------------
        Question: Here is another angle at the problem. Can we increment the original file name such as CIV4UnitInfos.xml? (In other words - has anyone tried making a CIV4UnitInfos2.xml that might load with or after the unnumbered file (and hence can be trimmed of unneeded declarations)?).


        Thanks

        Backpack
        ---- "What gunpowder did for war, Blake has done for the AI" - Diadem ----

        Comment


        • #5
          dont forget 'MyGames\Civ4\CustomAssets' Stuff placed in there overrides the 'Civ4\Assets'. This is useful for creating general 'patches'.

          Comment


          • #6
            CustomAssets Overrides the generic files altogether. As in I don't even have to "Load Mod"????
            ---- "What gunpowder did for war, Blake has done for the AI" - Diadem ----

            Comment


            • #7
              If I want to change the specs, for say 1 unit in the XML files, do I need to copy the whole file to the CustomAssests directory and modify that, or just a file containing the modified section for that unit?

              (Hope this hasn't been covered before. I looked but didn't see anything immediately from the subjects.)

              Comment

              Working...
              X