View Full Version : Vrenir's XML Self-Help Thread (please assist)


Vrenir
Aug 21, 2009, 05:22 PM
I have slowly but surely begun to mod BtS. I'm only touching the XML so far, because I have absolutely no programming knowledge and seem to crash the game often enough with just this "simple stuff." Anyway, this is a thread where I hope I can get help figuring out and correcting my periodic foolish errors.

1) I am trying to change what bonuses are available at what techs. I cut and pasted the CivIVBonusInfos file from CivIV assets into my BtS mod's matching folder and modified it. Now, when I try to load the game, it tells me that the TerrainSchema doesn't match the BonusInfos file. There is a new TerrainSchema in the BtS assets, which I am using, but there is no BonusInfos in BtS, only in CivIV. How do I get around this seeming incompatibility? Am I just overlooking something?

SOLVED: Use Warlords version of the file.

2) Does anyone know where all the Great General files are? I changed his UnitInfo, UnitClassInfo, Civlopedia, GameText, and GameInfoObjects, and that seemed to do the trick. However, the game no longer generated him from combat; instead, it crashed at each generation point. I changed everything for him back, and the game works again, but I'd like to keep my changes if possible. Is there another file that I missed?

SOLVED: Leadership Promotion is needed for a unit to join another unit as a Great General.

3) I have redone the entire tech tree and it works fine for me in playtesting. However, none of the other civs ever research beyond the initial Era. I have added Advisors to all of them. All have AI Weights = 0, but so do the techs that the other civs do research properly. None are disabled. All have Flavors at the bottom. Could it have anything to do with the Era labels? I have techs assigned to Ancient, Classical, Renaissance, Industrial, and Modern. Could the lack of a Medieval tech be a problem for the AI? The Era still exists, but it has nothing assigned to it. Help please.

SOLVED: Eras must indeed be sequenced in order for AIs to progress through their techs.

4) When I open up the Civlopedia, my added icon for Humanism (the Greco-Roman Coin from Warlords) shows up and looks beautiful. When I open up the Religion Advisor, I get a pink box where it is supposed to be. Could somebody please explain to me how this can be fixed?

God-Emperor
Aug 21, 2009, 06:10 PM
Have you tried the one in the Warlords assets folder?

Search order for a BtS mod is: mod, BtS, Warlords, Original.

Vrenir
Aug 21, 2009, 06:29 PM
I think that was the problem. In the meantime, I actually lifted a version of the file from ThomasWar and removed his additions, creating my own compatible file. The Warlords version appears to be what I was supposed to be using though. Thanks for your pointer.

EDIT: This modding stuff is very tedious, isn't it? I'm trying to start from a nearly blank slate, and deleting parts of files while making sure to delete every corresponding part of every other file is quite the job. At least it's obvious when you don't, as the game crashes and sort of tells you where you need to look for the problems. OK, vent over; back to work.

Vrenir
Aug 22, 2009, 03:28 PM
I've been learning a great deal through this process, but it occurs to me, does anybody know of a file somewhere that has most the basic components pre-removed from the game, something that can be used as the basis of an overhaul like Planetfall or Fall from Heaven?

I'm trying to restructure the whole game, making fewer eras with more distinct gameplay. The idea is a refit mod for lower-level computers balanced both globally and historically with a lot of flavor (sort of CivIV mixed with CivRev and Spore). Anyway, I'm working on the new Ancient Era (I want to rename it Mythic at some point), and getting rid of extra resources, techs, buildings, and units is proving to be a beast of a job. Any helpful tips from people who have implemented reboots before would be much appreciated.

civ editor11
Aug 22, 2009, 03:48 PM
Be very careful what you remove. If you remove a tech you have to remove or change everything that requires it. This can crash the game.

kiwitt
Aug 23, 2009, 02:55 PM
Notepad++ with the XML plugin does make editting the XML code easier, than my initial modding start with just notepad.

Vrenir
Aug 23, 2009, 07:30 PM
Well, I successfully stripped down the XML for my mod. It plays and everything with no errors at last. Now I just need to begin adding material in and balancing. That sounds like much more fun to me.

I tried to go ahead and strip it even further to produce a nearly blank template for others to use, but somehow I ended up screwing over the game. I get no XML errors on the load, but it crashes before the main menu with a dll error of some sort that I have no skill to diagnose whatsoever. Oh well, it was a nice thought. At least my mod works.

Vrenir
Aug 26, 2009, 04:33 PM
Does anyone know where all the Great General files are? I changed his UnitInfo, UnitClassInfo, Civlopedia, GameText, and GameInfoObjects, and that seemed to do the trick. However, the game no longer generated him from combat; instead, it crashed at each generation point. I changed everything for him back, and the game works again, but I'd like to keep my changes if possible. Is there another file that I missed?

The_J
Aug 26, 2009, 05:02 PM
:confused: what do you want to do/why do you want to remove generals?

Vrenir
Aug 26, 2009, 05:32 PM
What I'm trying to do is make Great Generals like every other type of Great Person with the exception that they can also be generated through combat.

I'm also renaming each type of Great Person (Great Scientist > Scholar, Great Artist > Artist, Great Spy > Statesman). The Great General is supposed to become either General [no "great"] or Inspector [I haven't decided yet]. I know that I can just rename the unit in the Object file, but I like the XML to make sense, and so I'd prefer the UnitClass and everything to match the name that the players of my mod see.

civ editor11
Aug 26, 2009, 07:47 PM
I believe it generates the units and everything through the Dll so if you change unit name and unit class that will just crash the game. You should just leave the unit name and class alone for those and just do it in text

Vrenir
Aug 26, 2009, 07:51 PM
I was afraid that was the case. Oh well, thank you for helping me out. It will work just fine, just be a little less polished under the hood.

xienwolf
Aug 26, 2009, 07:56 PM
Generals are generated by the DLL by racking up combat XP, and when the goal is met it checks every unit in the XML for all the ones with something listed in <LeaderPromotion> or <iLeaderExperience>. Then it spawns that unit. (if multiple units list either of those, the first one found is used, starting with a random unit info for the loop. So if listed one after the other, it is almost always the first one listed. If spaced evenly, it is fairly equally weighted random.

Vrenir
Aug 26, 2009, 11:02 PM
Thank you, Xienwolf. Do you also know how to make promotions repeatable? I know that I've seen this on Hero units in FfHII where they have multiple copies of Combat I through V.

xienwolf
Aug 27, 2009, 05:55 PM
To my knowledge, only in Fall Further is it possible to get the exact same promotion on a unit multiple times. In base FfH there are just some promotions which have multiple "ranks" to them, you purchase 5 different promotions to go from Combat I through Combat V, and you still have all 5 of them at the end. It is just that using the <PromotionNextLevel> tag, the bottom 4 are hidden from primary view. How that tag works is that if you have Promotion A which Lists Promotion B as a NextLevel, then when you gain Promotion B, you will still have Promotion A, but it will not show in the unit detail view (it still shows on mouseover)

The_J
Aug 27, 2009, 07:01 PM
What I'm trying to do is make Great Generals like every other type of Great Person with the exception that they can also be generated through combat.

Can't see a reason for renaming with what you've mentioned.

Vrenir
Aug 29, 2009, 06:46 PM
I am "almost done" with the Ancient/Classical portion of my mod.

Left to do is:
- Reintegrate a selection of appropriate Events
- Officially integrate the Ancient and Classical eras into the Mythic Era in XML
- Create distinct Art XML files for superior file organization and further tweaking
- Reorganize the lines of my larger XML files for easier browsing

Then I plan to release version 1.0 of my first ever mod. I've playtested at each stage and I'm pretty pleased with it. Thank you very much to all who helped me start to find my way through the XML jungle.

Vrenir
Nov 09, 2009, 07:12 PM
Alright, I've been working quietly for a while, but I've run into another problem.

I have redone the entire tech tree and it works fine for me in playtesting. However, none of the other civs ever research beyond the initial Era. I have added Advisors to all of them. All have AI Weights = 0, but so do the techs that the other civs do research properly. None are disabled. All have Flavors at the bottom. Help please.

EDIT: Could it have anything to do with the Era labels? I have techs assigned to Ancient, Classical, Renaissance, Industrial, and Modern. Could the lack of a Medieval tech be a problem for the AI? The Era still exists, but it has nothing assigned to it.

SOLVED: I experimented by changing one tech to Medieval Era and the AIs used it as a bridge. Thus, it appears that the problem is solved. My intent now is to migrate the techs back one Era each to retain my current setup but make it functional.

Vrenir
Jan 15, 2010, 09:34 AM
The epic task continues...

I have successfully modified the Gamefont TGA file to alter both the Religions and Corporations. I have also located and linked the XML to the icons I wish to use. Everything works as it should, except for one thing. When I open up the Civlopedia, the icon for Humanism (the Greco-Roman Coin from Warlords) shows up and looks beautiful. When I open up the Religion Advisor, I get a pink box where it is supposed to be.

I know that many here have modified the religions in their mods, and even used the exact icon that I am trying to. Could somebody please explain to me how this can be fixed?

ripple01
Jan 15, 2010, 09:36 AM
Has Humanism been founded yet? Each icon has a .dds file for the religion icon once it has been founded, and one that is grayed out for when it has not been founded yet. It has been awhile since I looked at these so I can't remember the exact filenames, but if you look at the ones from vanilla, it should be fairly self-explanatory.

Cheers,
ripple01

Vrenir
Jan 15, 2010, 09:41 AM
I think so. What you are talking about appears to be the Name_d icon file. I was unable to find the Greco-Roman Coin icon in such a format, but before bothering to replace the GameFonts TGA icons again, I tried using another Name_d file as Humanism_d. It is still pink. Curiously though, there appears to be no place in the XML where the Name_d file is linked to. Is it not in the Religion XML document?

ripple01
Jan 15, 2010, 10:39 AM
I don't think the Name_d files are referenced in the XML; I think the game just knows to display them when the religion is unfounded. Do you have Photoshop or GIMP? There should be an option in either program to convert the .dds to grayscale.

That is wierd that the test you performed didn't work; it seems like it should have.

Cheers,
ripple01

Vrenir
Feb 13, 2010, 10:05 PM
The pink Religion Icon is still unsolved, but I now have a more functional game problem.

I have five mini-tech-trees organized by geographic area, organized as follows:

African Heritage (civic) -> Commerce (corp) -> Multi-Nationalism (corp)
American Heritage (civic) -> Way of Peace (corp) -> Revival (corp)
Asian Heritage (civic, rel) -> Meditation (rel) -> Filial Piety (rel)
Eastern Heritage (civic, rel) -> Messianism (rel) -> Recitation (rel, corp)
European Heritage (civic) -> Skepticism (rel) -> Manifest Destiny (corp, corp)

Each civ enters the game with a Heritage tech, and the idea is to make these civics, religions, and corporations able to be founded by only those civs that would be appropriate. The problem is that this doesn't seem to always work.

First, India's custom Palace includes the ability to spread Hinduism, which automatically enters it into the game. Indian players receive the founding movie and the religion becomes present in their city. However, they never receive the star icon making it the religion's Holy City.

Second, In the event that India does not play in a game, Hinduism is somehow founded by another Asian civ on the first turn. My suspicion is that having the prerequisite tech Asian Heritage, the computer simply assigns the religion discovery to whatever non-Indian player possesses the tech. I don't know that there is any way to prevent this so that China does not found Hinduism in India's absence every game.

Third and finally, I've witnessed some odd religion foundings with no discernible cause. For example, Turkey founds Confucianism. This makes no sense, since Turkey is assigned the Eastern Heritage tech and Confucianism requires the Asian Heritage derivative Filial Piety. My only thought is that perhaps Turkey gained the Code of Laws tech which is the other Filial Piety prerequisite and somehow jumped over. My setup is currently to have both tech prerequisites under the AndPreReqs XML tag.

Note that Choose Religions is not active. Even more oddly, when I open up Worldbuilder to examine Turkey (or any other civ with similar oddities), they do not show ownership of the tech Filial Piety, which should mean that they cannot have founded Confucianism, yet they have.

Has anyone seen anything like these? None of them are game-breaking, but they are odd and run counter to the realism I was trying to portray.

The_J
Feb 14, 2010, 12:54 PM
First: No holy religion is normal, if you don't trigger it by hand or by tech :/.

Second: First turn religion foundings normaly happen, when a civ starts with a technology, which is prerequisite of a religion. Doesn't matter, which, that happens somehow randomly, i think.

Third: Are your technologies maybe still tradable ;)?