Quick Modding Questions Thread

Most of the XML files can have comments in them. A few of them mess up the parsing and give errors if you do (nobody knows why - they all should be using the same parser), possibly only some of the audio and art related files, but I'm not sure.

The unit and building infos work fine with comments in them, as far as I have seen. I've used some myself, although only single lines.

I try to keep a change log file with detailed information on what is changed.
 
How do I disable the spawning of barb cities while keeping barb unit spawns unchanged?
 
Does anyone know what this error message means?

Assert Failed

File: CvGlobals.cpp
Line: 3493
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type TECH_SPIRITUALITY not found, Current XML file is: xml\GameInfo/CIV4ReligionInfo.xml

----------------------------------------------------------

Spirituality is a tech I added.
 
Perhaps its due to the parser is looking for Tech info in the Religion info XML?
 
No, I think it's because the parser can't find TECH_SPIRITUALITY (For some reason), which is a discover tech for a religion.

I don't think that the expression it showed is at fault.
 
Already checked for typos. After you wrote that, I checked again. They're both spelled the same. I wonder, could this be caused by one of the schema files being messed up?
 
No, that would already throw an error during loading. Edit: I mean one of the "regular" XML parsing errors.

The error is strange. It complains that it can't find a tech in the religionInfos...that doesn't really make sense.
Any other maybe related errors? What's the effect ingame?
 
No, I think it's complaining that it can't find a tech that's referenced in religioninfos.
 
Right, right...it's definitely to late for me.
But this would still mean, that it's not in TechInfos.

How did you check that both are spelled the same? I don't trust it, unless you've copied the entry from one file and searched in the second (because sometimes you're sitting in front of it, and you can't see it. Once i had 2 underscores in a unitClass...hell...could not see it, no matter what i did. Saw it after i replaced the definition in UnitClassInfos with the text string from UnitInfos).
 
I don't trust it, unless you've copied the entry from one file and searched in the second.

That's exactly what I did.
Same result.
Identical.
 
I guess this thread is reserved for random modding question...

So I've been trying to make a mod and it crashes on my at random. I'll explain the problem in detail here:

First of all, I use a huge Earth map (I don't remember, but I download it on this website somewhere) and a .dll for 50 civ. And the mod adds in a few units and techs and leader replacement but the are not the problem (I've tested them). I put in all the cities and some units.

Possibly there are about over 1000+ cities on the map (enough that France, Germany, Italy, Spain each has about 6-7 cities in that small Europe, China has about 40, Russia about 50, etc.)

It all works fine until I realize that well these cities are sizes 20-30+ and they do not have enough food to support the population. So I create a new great specialist call farmer that add +1 food to the city per. (Basically the dumb down versio of the Great Merchant) so I add as many as neccessary to each city to each Civ so they don't starve. (Washington needed like 20 of them). So I was working on Poland, and it loaded fine. After I added 17 merchants to Warsaw etc and tried to reload the scenario, it loaded fine until "Waiting for your turn", and when it's my turn the game CRASHES.

One thing it NEVER crashes if I am the first civilization on the menu list.

So I was like ok. I log in the scenario as the first civ on the list (US) and add like 3 Lions on the map and save.

I tried to load in as Poland again and it works fine - surprisingly. (I don't understand why the 3 lions make any different)

So tried to work with Greece and Greece loaded fine until I give the merchants to the cities in Greece and it crashes on "Waiting for you turn" again.

So now I log in as US and delete the 3 lions and try again as Greece and it still crashes on my turn. I add 6 lions and it still crashes...

But when I log in as Canada or Japan or South Korea, it is fine. I don't understand this behavior of the crashes. If anyone know how it works please help.
 
You know you can't edit schema files unless the DLL is changed as well.

A. I have been editing the DLL appropriately.
B. I thought if you correctly edited the schema, you didn't have to change the dll unless you wanted it to actually do something.
 
Probably a stupid question, but, can I copy the 'Missionary requires Monastery' thing for some other unit (like 'Merchant requires Guild' or, to use already existing units and buildings, 'Warrior requires Market') only using Python? I'm not asking for the code, just wether it can be done.

And, adding new XML tags require SDK changes, right?

Thanks in advance.
 
Probably a stupid question, but, can I copy the 'Missionary requires Monastery' thing for some other unit (like 'Merchant requires Guild' or, to use already existing units and buildings, 'Warrior requires Market') only using Python? I'm not asking for the code, just wether it can be done.
Sure, no problem. It will cause your mod to lag, however.

There is a cannotTrain call-up in CvGameUtils. It returns False by default - what you do is add some code with some condition that makes the cannotTrain() method return True - when appropriate. Namely when the prerequisite building is not present in the city in question. This would be the Python fix, anyway.

If you detail the full design for all unit/building combos (including all the XML tags referenced) I could write some sample code for you.
 
Why would my game lag (what do you exactly mean by the way, the inbetween turn time takes longer?), and more importantly, how to prevent it / work around it? Or would I have to use the SDK for that? The Missionary requires Monastery thing doesn't make the game lag, right?
 
Back
Top Bottom