Announcement

Collapse
No announcement yet.

XML-how Does It Work???

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

  • XML-how Does It Work???

    Hello,

    i have civ iv but i feel the need to change some certain things.bad thing is that things are much more complicated.although i could do everything in civ 3,in civ iv as long as i have read we need python and xml converters.i have download python but python is for making maps.i dont have the need for making maps of me,and my basic needs are what is listed:

    *to change the technology that a unit appears

    *to change the abilities of it(blitz,attack strength)

    *to change the technology that a resource appears.

    *u need a python first and then an XML in order to make your own mod?

    *can i take a mod from someone else(from here)and then process it with XML?It will work?

    i have read that XML convertor can help u in this.i dont know how XML works!
    when i m try to use it a message of that sort appears:
    "Unhandled exception has occured in your application".if you click Continue,the application will ignore this error and attempt to continue.If you click quit,the application path will close immediately.

    Could not find a part of the path"C:\Programm Files\Firaxis Games\Sid Meier's Civiliztion 5\Assets\XML\GlobalTypes.xml".

    what is this?anyone knows?


  • #2
    Civ4Wiki
    Is a good place to start.

    Also Modiki


    All the things you mentioned do not require python editing. Also python is not just for maps. A lot of the mods have changes in \Assets\Python\CvEventManager.py
    You do not have to download python or an xml converter/editor. I have only used Notepad for editing xml files. You can use any text editor you want. You just have to make sure to have your tags and your indentation in order. Other programs might help you with that but they are not requirements.


    To change the technology requirements for a unit to be built, you just need to make small changes to \Assets\XML\Units\CIV4UnitInfos.xml

    PrereqTech (The Required Technology)
    TechTypes (Additional Required Technologies, if any)


    To change a units abilities you need to make more small changes to that same file

    FreePromotions (Gives the unit free Promotions)
    iCombat (Strength of the unit)

    (There are also many more things you can change)


    To change when a resource appears you need to make small changes to \Assets\XML\Terrain\CIV4BonusInfos.xml

    TechReveal (Technology that reveals the resource)


    There are 4 places where your files can be loaded from:

    1. C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\
    2. \My Documents\My Games\Sid Meier's Civilization 4\CustomAssets\
    3. C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Mods\"ModName"\Assets\
    4. \My Documents\My Games\Sid Meier's Civilization 4\MODS\"ModName"\Assets\

    Note: Do not modify the files in #1, make a copy and place it in a different location
    Note: Currently when you load a mod from #4 you get errors when you load a savegame

    When you do not load a mod: Any files in #2 are loaded, all other necessary files are loaded from #1

    When you load a mod: Any files in the mod directory are loaded, then if there are any files in #2 that were not loaded from the mod directory, they are loaded, and then all other necessary files are loaded from #1
    (I think this is how it works)


    I hope this helps you out some. By the way that path is obviously wrong. "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML\GlobalTypes.xml" would probably work better.

    Comment


    • #3
      THANK U!!!!

      My dear friend,

      how can i help u for your help?i feel like a carpet and please walk over me.i m desperate,honeslty.i havent searched it yet,but i ll start work right now cause i just woke up.i stayed till 11 morning wake to reading and reading.i m very dissapointed from this situation.i hope i can improve it via your precious help.
      if i dont find the way to edit these default settings i swear i will throw civ iv away.!
      have 2 more questions:

      *i have read that in order to make your own mod you need to create your own folders.do i realy have to do this?i dont know what kind of folders i have to create.u know which exactly?i only want to change the techs,and units,and resource appearance.do i really have to create folders or just an edit with notepad is enough?(ihope it is)
      *please can u give an example of editing lets say IRONCLAD?regarding making it blitz,stonger power,and available only with coal(with steam power of course and not steel)?
      i havent searched it yet,but i ll start work right now cause i just woke up.i stayed till 11 morning wake to reading and reading.i m very dissapointed from this situation.i hope i can improve it via your precious help.

      feel free to contact me,my mail is aracuan_76@hotmail.com
      i will be very happy if u contact me.
      Last edited by aracuan_76; November 21, 2005, 12:31.

      Comment


      • #4
        1. Copy "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\xml\Units\CIV4UnitInfos.xml" file
        2. Paste file into the following directory "\My Documents\My Games\Sid Meier's Civilization 4\CustomAssets\xml\units" (This file will now be loaded when you start the game instead of the original)
        3. Edit this file with a text editor
        4. Search for "unit_ironclad" in the file
        5. Scroll down until you find "PrereqTech"
        6. Change "TECH_STEEL" to "TECH_STEAM_POWER"(This removes the technology Steel as a requirement)
        7. 2 lines down change "TECH_STEAM_POWER" to "NONE" (Since we moved the technology Steam Power to the first requirement)
        8. If you wanted to remove iron as a required bonus, 4 lines down change "BONUS_IRON" to "BONUS_COAL"
        Then 2 lines down change "BONUS_COAL" to "NONE"
        9. scroll down until you find iCombat
        10. change 12 to what you want the ironclad's strength to be
        11. scroll down to FreePromotions
        12. I couldn't post the code here for this, so I attached a text file. (It tells you what to change for FreePromotions, also it has the complete ironclad unit info with all the changes to the ironclad that you suggested)

        I hope this helps you out.
        Attached Files
        Last edited by tywiggins; November 22, 2005, 16:06.

        Comment


        • #5
          WOW!!!

          WOW!!!

          All i can say is wow!exclusive work.starting procees and notify you when i m ready,if it worked or not.how can i say thank u?
          honeslty i feel very oblicated!

          -AFTER 20 MINUTES-

          Hello again,i have succesfully edit this.it seems that this now will work-i will paste it in the original files of civ 4-is there any problem with this?i mean i wont damage it right?cause i want to stay as i edit it permanently.
          and someting else:a crucial and important question:
          *is there any way to make ironclads or other untis having the bombard ability to bombard other units?
          for example,is there any way to make ironclad to bomard an enemy frigate?
          a cannon to bombard an enemy musketter when they are not in town siege but somewhere else(in a hill,a desert)?
          Last edited by aracuan_76; November 21, 2005, 21:32.

          Comment


          • #6
            There are a couple of possible problems with altering the files in the program directory.

            1. If you mess up a file really bad, you might just want to go back to the original.
            2. You might run into problems when a patch comes out.

            If you copy the file over to the custom assets directory in the right place, then you don't have to worry about these things.

            As for the bombarding other units, I don't know for sure. I don't think you can change it to bombard other units. Aircraft can airbomb enemy units. You might be able to give land units some of the attributes of aircraft. But I don't think that you can give the unit the airbomb mission, which it would need. So I don't know.
            Last edited by tywiggins; November 22, 2005, 01:37.

            Comment


            • #7
              FIRST RESULTS-resourse question

              Hello again dear tywiggins!

              i hope i havent turn my self a pain in the butt.
              so far i have been editing,and u cant imagine how happy i am thanks to you who helped me so much.i have succeded in making the ironclad starting with blitz,make it faster,and stronger.soon i will expand it to other untis.the example u showed me trully open my eyes.
              However,new questions have arised:can u please answer?

              *what can i do in order to change now the resources that appearing from a tech?for example,uranium should be appearing with fission.wha changes should i di and in which folder i can find resourses for edit?

              *how can i change also the tech that a building can be available?or a wonder?

              *and how can i make units such as machine gunner to make it attacking also instead of defending only?

              i m working now on how can i make lethal bombardmenets,but i think that indeed its not possible.
              did u get my pm?

              Comment


              • #8
                Its no problem.

                To change when a resource appears:

                1. copy file "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML\Terrain\CIV4BonusInfos.xml"
                2. paste file into "\My Documents\My Games\Sid Meier's Civilization 4\CustomAssets\xml\Terrain\" directory
                3. edit file with a text editor
                4. search for uranium
                5. 5 lines down where it says TechReveal, change TECH_PHYSICS to TECH_FISSION

                save it and now fission reveals uranium


                To change the tech when a building/wonder is available it is basically the same way as it for a unit.

                1. copy file "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Assets\XML\Buildings\CIV4BuildingInfos.xml"
                2. paste file into "\My Documents\My Games\Sid Meier's Civilization 4\CustomAssets\xml\Buildings\" directory
                3. edit file with a text editor
                4. if you want to change the aqueduct's tech requirements, search for building_aqueduct
                5. Scroll down to PrereqTech
                6. If you want to make Masonry the only requirement, change TECH_MATHEMATICS to TECH_MASONRY
                7. Then two lines down change TECH_MASONRY to NONE

                save it and now the Aqueduct can now be built after masonry is discovered.


                To make the machine gunner be able to attack:
                1. open your CIV4UnitInfos.xml file
                2. search for unit_machine_gun
                3. scroll down to bOnlyDefensive
                4. Change the 1 into a 0

                save it and now the machine gunner can attack

                Comment


                • #9
                  ONCE AGAIN,U WERE RIGHT!!!

                  HI!

                  As the subject title sais,u were right for once more.through your advices i have converted the civ iv into a more realistic game!thanks again,i was ready to throw it out of the window.
                  everything have changed now.but in the following hours i m gonna take a deep analysis of the files.i want to change something more and i think its not easy-perhaps its impossible but i m gonna give a try:

                  *change railroads-
                  i will try to produce +1 trade or +1 food wherever train passes by.

                  *make artillery units bombard other units when not at siege situations

                  *try when i m taking over an enemy city to take and a technology as well.

                  i will start work right now-i m planning to achive the last and most desired(stealing tech)with a combine of liberalism ability,the internet and capturing city.this wont be easy,and mostly chances are not succeded in nothing from these above.if u have any ideas,i ll be delighted to listen.
                  i wont bother u any more,my basic requirements for the changes are ok now thanks again to you.its very nice,kind,rear, when u see that someone u dont know is taking personally my problem and helps me with this.

                  Comment


                  • #10
                    In my Terraform Mod Plus railroads give most improvements (all except for the water tiles, forts, and my terraforming improvements) either +1 food or +1 hammer. Roads and Railroads also give you +1 commerce. Units can now move 600 tiles/turn along railroads.

                    My mod also enables terraforming as the name suggests(there are even more options than there were in Civ2)


                    I don't know how you can make artillery units do as you want, but you might consider making new air units with extremely limited range. Like 2 or 3. So you base them in cities, and use them to bomb oncoming enemies.


                    I believe the best place to give a free tech when you take a city would be in the

                    "def onCityAquired" of the CvEventManager.py file


                    You would need a loop that goes through all the technologies, which is easy enough:

                    for i in range (0, gc.getNumTechInfos()):


                    I think the best function to use to determine if the player has (tech i) is

                    team.isHasTech(i)


                    I'll help you with this some more when I have more time(maybe 3-4 days)

                    Comment


                    • #11
                      very interesting

                      wow.

                      i m glad we have the same opinion.railroads brought the first majorindustrial revolution worldwide.therefore i consider it wrong to the game of firaxis that add only +1 hammer,and i consider it correct that can add +1 trade and +1 food.wherever a train was passing by these eras,the economic growth plus the civilian growth was fatser than a city that did not supported railraod station.
                      it was a crucial technologiacl advance and i it didnt acquire the importance that it was right to have in the game.
                      we all remember stories from lyckie luke comics when cities in the wild west turn themselves "ghost cities"cause they were deserted of their isolation-trains did n pass from there.
                      how did y do this?what should i do in order to do myself?is it possible just attach the file u made them so that i can paste it exactly in the file that is necessary?
                      or i can do ti manually,if u give me an example like the perfect ones before.

                      about the artillery units i m planning to change them into non siege units so that they have the ability to bombard everywhere in the map.

                      about the tech stealing a lot of work is needed.i havent thought that way u told me,and i m afraid my level of i.q. is very low to think a loop,and how to connect it.i thought something more simple,but it seems it s not easy.i havent slep many hours and now i am at work with only 2 hours sleep.lol.
                      i will leave what i thought and i m starting work on the way u told me.there should be a way.if i,u, can make it,then it would be"heaven on earth"for me...

                      Comment


                      • #12
                        My terraform mod plus can be downloaded from Terraform Mod Plus

                        Extract this file into "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Mods"

                        The speed changes and the +1 commerce for roads and railroads are in the \xml\misc\CIV4RouteInfos.xml file
                        The speed changes also require the file \xml\CIV4GlobalDefinesAlt

                        The +1 food or +1 hammer changes are in the \xml\terrain\CIV4ImprovementInfos.xml file
                        (routeyieldchanges for each improvement)

                        If you want to use all of my changes with yours, you would probably only have to alter the CIV4UnitInfos.xml file. Mostly changes to the worker, and fast worker. I believe the only other change was to give the modern armor 3 movement points. I don't think i changed any of the other files you've been working with.

                        I'll work on the tech thing when I get some time. I don't think it will take me that long, I just have other things to do.

                        Comment


                        • #13
                          YOUR MOD

                          Hi!

                          i have download your mod.i havent tried yet,but i agree in many points.it was good that u made mountains passable and of course the railroad addition.in the commerce +1 u add the yield making 0,0,1 right?

                          but in adding + 1 food and + 1 hammer,i dont know where to look-the text is very big and i didnt figure it out.there are plenty of workers actions,but what must i change?

                          also i agree in capturing the city that u must have a captured unit as well as u can abandon it.i havent copy the whole xml file cause i dont want for time being to ruin mine xml regarding units.
                          in a point that i dont agree is the one that terraforms tundra-i think this should stay as it beggin.i have made some special modifications and soon i will give it to you to have a look.
                          sorry for bothering u again,but u think it s possible to make steal tech whenever u are taking over a city?i have focus my work there.so far i havent succeded in something.however if u manage it,make a new thread and be sure that many plyers will download this perfect job.
                          Last edited by aracuan_76; November 23, 2005, 23:08.

                          Comment


                          • #14
                            yes that is correct.

                            For each improvement, I added a route yield change that gives either +1 food, or +1 hammer.

                            Mines and lumbermills already had +1 hammer.

                            My intent with the terraform was to give the player more options. If you don't like a particular terraform action, it is very simple to disable: Search the CIV4UnitInfos.xml file for that particular terraform action, and change the 1 on the next line to a 0. search again and change the 1 on the next line to a 0.

                            That makes it so that no unit can build that terraform improvement.

                            If you wanted to add a terraform action that I didn't include it would be a lot more work.

                            That will probably be my top priority when I have time. It's a holiday today in the US (Thanksgiving), so we have extra family members staying with us for a couple of days. (My computer room is being taken over for at least 1 night)

                            Would you like the free technology when you raze a city? How about when you acquire a city through diplomacy? It really won't be much extra work for these situations. I would just like to know before I write the code. I'm thinking yes for raze and no for diplomacy. Rationale is that assuming it was a fair deal to begin with, it would no longer be a fair deal after the player got the free technology.

                            Comment


                            • #15
                              i agree!

                              well,

                              i m agreeing on terraforming mountains and hills.i remember what enginners did in civ 2 and i agree.
                              i think that a tech u should add is explosives in order to do this,and electronics perhaps.i like terafforming but i think that in reality tundras and steps are in reality difficult to change,that why i told u this.also in civ 2 if i m not remeber wrong u couldn t change them.
                              i m agreeing on both sides.i mean by this,that i want when i m taking over an enemy city to have a free tech,but with the condition that the enemy civilization is more advance,so that it has some techs that i dont have.with a few words to steal one of those he posses.
                              stealing tech is my first priority,cause it will give a player a huge motive to make a war.

                              about diplomacy city trading also i agree very much.i will tell u why:
                              fisrt of all city trading is again an ability "only in papers".in live action in the game the AI cant support that.i have never been able to trade a city with ana enemy civilization.my opinion is that whenever an enemy civilization loses badly a war then u can demand cities for compensation.
                              in the first world war,all european countries tried to create alliances based on which teritories they will have after the war.they offer also cities of other countries which they didnt were hostile to them.
                              Example:France and england offer an area of greece to bulgaria,as an exchange of declaring war to germany.and as compensation to greece they were giving an area in turkey.
                              conclusion?city and area trading(geopolitical profits)were the based things for begging a war and basic terms of alliances.too bad here dont exists.i m very glad that u can change this as well!!!!
                              many wishes for your thanksgiving day.i m wishing the best for you and your family.
                              Last edited by aracuan_76; November 24, 2005, 12:22.

                              Comment

                              Working...
                              X