Bonus Production Modifier in UnitInfos

GRM7584

King
Joined
Dec 13, 2004
Messages
945
Location
Orlando, FL
I always thought the <BonusProductionModifier> tag in Civ4UnitInfos.xml worked in the same way as the equivalent tag in Civ4BuildingInfos.xml. However, thinking in this way has just given me a cascade of very non-descriptive XML errors on load [Literally: (Insert Number Here) in Info class was incorrect]. For what its worth, the tag for iProductionModifier in the UnitSchema was spelled iProductonModifier...although I've tried correcting it in the Schema as well as correcting the spelling of the tag in Civ4UnitInfos (seperately, of course). I get the sinking suspicion that I'm overlooking something obvious due to lack of coding knowledge.

Bottom line: How do I get units to build faster with resources?

(Additional: Haven't found anything on this via google/forum search, even though I'm almost certain I've heard mention of it before.)

Spoiler Sample :

An example of what is producing the error:

<BonusProductionModifiers>
_____<BonusType>Iron</BonusType>
_____<iProductionModifier>25</iProductionModifier>
</BonusProductionModifiers>

Will produce an error of:
"Tag: 25 in Info class was incorrect"
"Current XML file is: Units/CIV4UnitInfos.xml"
 
Try this:

<BonusProductionModifiers>
<BonusProductionModifier>
_____<BonusType>Iron</BonusType>
_____<iProductionModifier>25</iProductionModifier>
</BonusProductionModifier>
</BonusProductionModifiers>
 
I knew that looked wrong, but I tried to imitate the layout from the equivalent buildings tag. That seems to have done it, though, at least as far as load errors go...I still have some to correct before I get to the point where I actually find out if it works the way I want it to... :crazyeye:
 
New problem:
Is there an easy way to figure out the specifics of what causes a crash at the "Init Graphics" stage of loading a new game? I'm getting a straight ctd instead of a nice error message or informative log.
 
Newer Problem: The civilopedia isn't drawing the backgrounds for the Quote/Pediaentry and Special Abilities, but only for 3 techs, which look to me in all their facets to be the same as every other tech I set up. Its also giving me "TXT_KEY_(techname)" for a few techs which definitely have the corresponding text key (be it pedia entry or quote) and the appropriate pointer in the main techs file.
 
The draw issue with the civilopedia was evidently caused by 2 buildings dependent on the wiggy techs not having the correct pointers to icons, so that's no longer an issue, although the quote for one tech still refuses to show up.
Also, somewhere along the line, the game figured out how to make it past init graphics to draw map, although it has crashed several times on that, and for all I know it might still be an issue with initializing graphics...

Edit: And again with setup players.

Edit 2: And back to init graphics again...ugh.
 
Alright, my descriptions may not be clear enough and my problems may be too numerous and generic, but to try to get myself a bit of direction I've uploaded the current non-functional version of the mod to try to get some assistance. Its very tiny (less than 1 MB zipped) and without any new graphics.

GENERAL PUBLIC: Do not download this mod. It does not work, and it is not in the downloads database.

ELITE MODDERS: Please provide hints on what I am missing here, or what I need to tinker with to get better feedback when the thing crashes on game start. The currently semi-incomplete status of various text entries need not be mentioned unless it is having a direct effect on the game's ability to load. There is a possibility that I have excluded custom files that I need, or have unintentionally used vanilla files instead of warlords. (Edit: Speaking of which, it is warlords-only)

http://forums.civfanatics.com/uploads/53831/Nyomod_DD.zip
 
Notice Firaxis's definition of iProductionModifier in schema:

Code:
	<ElementType name="iProductonModifier" content="textOnly" dt:type="int"/>

They spelled Production wrong. So to use the attribute you are going to have to spell it the same way they did.
 
I noticed that, and changed the spelling in the schema and included it in the files...do I need to do something else for that to work? Would it be easier to just use the default schema and re-mis-spell all the relevant tags?
 
Hesitant bump; I'm not even sure where to start on getting this to load properly. I may be overlooking some feedback options, because, as I said, I get straight crashes to the desktop at various points during the "new game startup" phase, and none of the log files I found seem to contain relevant information. The mod doesn't involve any new graphics, and it initializes xml and python just fine, so that has to limit the options of what could be causing the ctds, right?
 
I noticed that, and changed the spelling in the schema and included it in the files...do I need to do something else for that to work? Would it be easier to just use the default schema and re-mis-spell all the relevant tags?
Yeah, you have to use whatever spelling they used in the schema - you can't change anything there without digging into the SDK. The way I understand it is that the game itself is looking for "producton", so that's what you have to give it.
 
I went ahead and made that quickie change (deleted 'custom' unitschema, "replace all" iproductionmodifier in unitinfos), but I'm still getting the same result: ctd at seemingly random point on load (between/including init graphics and setup map) when trying to start a new game.
 
I went ahead and made that quickie change (deleted 'custom' unitschema, "replace all" iproductionmodifier in unitinfos), but I'm still getting the same result: ctd at seemingly random point on load (between/including init graphics and setup map) when trying to start a new game.

CtD shouldnt be caused by an attribute problem (that will cause a popup saying that it is expecting "x" attribute and getting "y" instead. Sounds like its time to start removing things to isolate where the crash is occuring.
 
Kael said:
CtD shouldnt be caused by an attribute problem (that will cause a popup saying that it is expecting "x" attribute and getting "y" instead. Sounds like its time to start removing things to isolate where the crash is occuring.

So it could be any of the xml causing the ctd? Are there any particularly common assets that cause this sort of thing? I trust your advice, of course, but I want to avoid dissassembling and then attempting to reassemble piecemeal, if I can. I didn't think I'd be encountering any unexplainable errors if I was just dealing with xml, otherwise I might have planned this out a bit differently.
 
So it could be any of the xml causing the ctd? Are there any particularly common assets that cause this sort of thing? I trust your advice, of course, but I want to avoid dissassembling and then attempting to reassemble piecemeal, if I can. I didn't think I'd be encountering any unexplainable errors if I was just dealing with xml, otherwise I might have planned this out a bit differently.

Crashes on game load are usually art errors. I would start cutting resources (units and buildings) until you are able to load. Its as simple as renaming the Assets/XML/Buildings directory to Assets/XML/Buildings.old and then loading to get them out of the way. You will get lots of errors on load for reference to the missing files (andreference in the vanilla buildings files that dont exist in your) but it should load.

If it still crahses with your buildings out of the way try the same with your units. If you still get a crash with buildigns and units out of the way you will have to get into the less used pieces like leaderheads, terrain, etc.
 
It seems to be caused by FeatureInfos. After I found that out, I made a fresh copy from warlords assets and re-performed my changes, and now it works. Any clue on what might have been causing it before? All I did was to change the health effects and yield effects, although there was a slim possibility that it was previously a Vanilla copy of the features file rather than a warlords copy. I appreciate the help, for a moment I thought it was going to be a *very* long time before I had this thing in reasonable order.
 
It seems to be caused by FeatureInfos. After I found that out, I made a fresh copy from warlords assets and re-performed my changes, and now it works. Any clue on what might have been causing it before? All I did was to change the health effects and yield effects, although there was a slim possibility that it was previously a Vanilla copy of the features file rather than a warlords copy. I appreciate the help, for a moment I thought it was going to be a *very* long time before I had this thing in reasonable order.

Thats awesome. No idea on what the problem was though, an attribute error (like you would see if it was a vanilla version) should give a popup on load. But who knows, it isnt the most consistent system.
 
Alright, well, everything seems in order, but it now dumps me to the desktop upon ending the turn, without providing the standard windows "crash" popup that I was getting before when it was trying to start a new game and failing.

Edit: Updated upload, just in case.

In the python dbg log, the last event that is shown is the founding of the first AI city...
And, when the AIs are all given cities to start, the last event shown is the founding of the Player city. I'm guessing this has something to do with the AI?

The tech tree also doesn't seem to be drawing all its components...units, promotions, and the like, even though they seem to be correctly linked in xml, and show up in other techs. Is there a maximum number of icons that can show on the tech tree? Right-clicking on any of the affected techs creates the same "instant dump to desktop without error" as ending a turn.
Edit 2: It seems the right-clicking crash was caused by a tech with itself as its requirement, bugging up all techs that followed. The missing icons for promotions and some units are still missing, though.
....but! That tech tree crash being absent, I can now advance turns! Hooray!
 
Top Bottom