Please help an idiot w/XML modding

Payeybla

Chieftain
Joined
Jun 8, 2006
Messages
14
So I'm trying to make some (I think) relatively minor adjustments to Civ 4 Warlords via XML, and all I get is a spew of errors now when I try to start the game. Here's what I tried to change:

Civs: Deleted Zulus and Koreans

Leaders: Changed traits and preferred civics on a bunch of them, made a few unavailable.

Traits: Deleted Charismatic and Protective. Made Financial halve Bank cost by 50%

Buildings: Deleted the Stable and all unique buildings.

Techs: Tweaked the requirements for rocketry

Wonders: Tweaked obsolescences, and effects of Pyramids.

Civics: Changed names of a few.

Units: Numerous changes, including deletion of a few.

Here are the errors I'm now getting:

-Failed loading trait infos
-Allocating zero or less memory in CvXM Loadutility::SetVariableListTagPair
-There are more siblings than memory allocated for them in CvXM LoadUtility::SetVariableListTagPair
- Tag: TRAIT_SPIRITUAL in Info class was incorrect (I made no alteration to this trait whatsoever!)

I have no idea what to fix in my altered files to get this thing to work. Can anyone at least give me a clue? I'm not a stupid person, but coding bewilders the hell out of me. I thought I was extremely careful sticking to the required syntax for everything I changed. Wish they had just made an editor program like Civ 3...
 
Payeybla said:
-Failed loading trait infos
-Allocating zero or less memory in CvXM Loadutility::SetVariableListTagPair
-There are more siblings than memory allocated for them in CvXM LoadUtility::SetVariableListTagPair
- Tag: TRAIT_SPIRITUAL in Info class was incorrect (I made no alteration to this trait whatsoever!)

My theory:

You put a letter (often it is just a "/") or a line too much or too less in the traits-infos. This is an "illegal" element for the xml-sheme, so the game can't load that file. Because the game can't load that file, all tags (like TRAIT_SPIRITUAL ) from that file are missing, which cause a lot of trouble ( siblings than memory allocated for them in CvXM LoadUtility::SetVariableListTagPair ).

Take a close look at the first error message, it usually says in which line the error is.
 
Thanks for the reply Chamaedrys. I tried redoing my changes to that file (which consisted only of removing the protective and charismatic traits), but the same thing keeps happening. Do I have to do more to properly delete these traits other than just removing them from the traitinfos file?

EDIT: Since I changed all the leader traits anyway, I realized I don't even have to worry about deleting those two traits. So I just went back to using the standard traitinfos file, but the same error messages keep popping up. How can there be an error with a file I haven't altered?!
 
Willowmound said:
Question: Why are you trying to make Warlords into vanilla?

I'm not. I haven't altered any of the scenarios, and I've left the Imperialistic trait in, not to mention most of the new civs. What I'm trying to make is my own ideal version of Civ 4.
 
Hi Pay,

Warning, I'm new to this so if someone with more expierence says do something differently they are probably right.

#1 always only change 1 thing at a time, test it with your XML editor (see below) test it to make sure it loads, then make a city just to be sure you haven't made an mistake that causes a memory allocation error. when this 1 thing passes, move onto the next.

#2 get a XML editor, this is not an absolute, but having "another set of eyes" is a huge help (the editor will tell you when there is a syntax problem) I use Peter's XML editor, freeware off the web, got after I got civ4, so if I can figure it out anybody can.

#3. EVERYTHING relates to something else in these dang files. All of your errors sound like you made a change in File A. which now causes File B. to ***** it's missing something. as you learn what goes where you'll figure out what relates to what.... here are a couple of things i learned.

if you changed it in the Info file, you have to add it in the class file (with units and buildings most of all) and nearly everything has a 3rd graphic file, even if you are copying another graphic so often it needs its own entry in the graphic file.

don't do this tired, stupid mistakes like a missing (or misplaced) / will make you yell at your dog. and syntax matters

<buildings>
<buidling>
<text_key_building_fartfactory>
<building>
<building>

will get you in trouble, if you miss the 's' on the 4 building.

you said you deleted a bunch of stuff, when you say deleted, as in highlight->cut? or deleted -> changed names. This will give you the #1 culprit of most of your problems. if you deleted osmething, the relating files (of what got deleted) still thinks its there, heck it expects it to be there, and is dang well going to complain about it not being there til it gets given what it wants, or you change the 2nd file.

with getting rid of the zulu's and koreans

you'll need to change the civ names (I'm sure there is a way of getting rid of them too but not having done it yet, I don't want to tell you to do something which will cause more problems) in the
CIV4CivilizationInfos
then change to the new civ names in the
CIV4LeaderHeadInfos

that should be it, and the textobjects file in "text" folder

read all the tutorials here, and MAKE SURE YOU ARE ONLY MESSING WITH FILES IN THE mydocuments/mygames/civ4/warlords/custom asset folder...you will have to add each file (copy n paste) as you work with it, but this file "overrides" the normal files in the civ4/warlords/ file. this way if you make a horrendous hours-to-fix mistake you can rename the customasset folder to something profane (or customasset2) and still be able to play your normal game. unless you are making a true mod from scratch (also a good idea, but I'm to lazy to reload each time)

otherwise, get some music you like, be patient, it's not rocket science, it's just cross all the T's dot all the i's grunt work, and when you make a mistake realize you can unmake it. every couple of days make a full back up of your work in progress

trust me, I know how you feel, knowing your not dumb, but not having a clue as to what your doing. the people on these boards are a lot of help most times, but ya got me if I can do you any good, so 1 by 1 as you have "can't figure this out' times, post and I'll answer as soon as I can.
 
micmc says many wise things.

I'd like to add: try not to type any more than you need to! Copy + paste all tags. That way you won't accidentally forget a letter or a slash. Saves you trouble.
 
micmc said:
you said you deleted a bunch of stuff, when you say deleted, as in highlight->cut? or deleted -> changed names. This will give you the #1 culprit of most of your problems. if you deleted osmething, the relating files (of what got deleted) still thinks its there, heck it expects it to be there, and is dang well going to complain about it not being there til it gets given what it wants, or you change the 2nd file.

I just highlighted the stuff I wanted gone and hit delete. I'm guessing there's a better way of making it not appear in the game anymore?

THanks very much, by the way, for taking the time to reply.:)
 
the easiest way is to play custom games, and choose to not have them in the game....

after that, go to
/assett/xml/civilization/Civ4civilizationinfo.xml you'll see the following

<CivilizationInfo>
<Type>CIVILIZATION_ZULU</Type>
<Description>TXT_KEY_CIV_ZULU_DESC</Description>
<ShortDescription>TXT_KEY_CIV_ZULU_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_ZULU_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_ZULU_PEDIA</Civilopedia>
<DefaultPlayerColor>PLAYERCOLOR_LIGHT_YELLOW</DefaultPlayerColor>
<ArtDefineTag>ART_DEF_CIVILIZATION_ZULU</ArtDefineTag>
<ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
<bPlayable>1</bPlayable>
<bAIPlayable>1</bAIPlayable>

mark the <bAIPlayable>1</bAIPlayable> to <bAIPlayable>-1</bAIPlayable> and that should make them not appear in any games, I have not done this or tested it, but that would be my best guess.

or you could change the name "zulu" in the above mentioned file and in
/assets/xml/civlizations/leaderheadinfo I don't think there is another file...you will have to change the artwork designation to another leaderhead, or your new nation will still have shaka burping at you. check the tutorials on 'adding a civ' just to be sure I didn't miss anything.

and yeah, deleting anything..bad idea, treat all the litte lines, /'s and postions (esp. in python, not as much xml) like your fingers, your ring finger might not really do much, but you'll miss it if it's gone.
 
Copy n' paste is only way to get a long with xml. Doing so will avoid a lot of mistakes, BUT: it doesn't provide 100% savety. So when you copy n paste in a file, mistakes can still happen ( copy over a the wrong line, i's, b's, /'s,...).

@mimic: The "-1" is often used to change the costs of something into unbuildable. But for this tag are just two options: Ai playable or not, so I think it has to changed to "0".
 
thanks cham...like I said I was assuming, which is always a mistake, but I like the zulu's, echo's back to the times I was hiding out in washington hoping they didn't get through europe before I got enough of a navy to stop them at the coast....I am however about a step away from killing the inca out of my games, that smug little bastard backdoored me (in the bad way) and invaded me while I was just beginning to invade him...such manners.
 
As the others have said, if you delete something, expect it to yell at you when it tries to load. For your case, you deleted some of the traits. These traits are referred to in the LeaderHeadInfos file, the BuildingInfos file, and possibly some others I'm forgetting at the moment. When those files load, they expect to see the traits defined that you deleted. So you have to hunt down all of the places that trait was used in order to safely delete it from TraitInfos without causing an error. The same pretty much applies for the other stuff as well. Deleting a unit will cause an error in the CivilizationInfos file if it was a unique unit. Deleting a technology can cause all sorts of problems in several files dependent on that technology. Sound like I have experience? :crazyeye: I've just been trying to do basically the same thing for the last couple of days and not getting anywhere fast. I've resigned myself to just scrapping the files with deletions and adding my changes to a copy of the original files. This at least let me get into the game and start making progress. I will probably go back later and try to figure out how to delete all of the other crap without causing problems. If I am ever successful, I'll let you know ;)
 
If you don't want to delete something and you want to disabel it in the xml files, do this:
<!-- TEXT HERE --> (put the code that you want to disable where TEXT HERE is.)
 
Thanks for all the replies, everyone. I finally buckled down and hunted down all the little tidbits in all the different files that I needed to get rid of or alter, and I'm currently playing an enjoyable game as the Ottomans with all of my changes working fine so far. I still want to do somemore things, like add the Babylonians and Iroquois back in and find a substitute for the Arabian Camel Archer unit, but those can wait til I have enough patience built up to deal with modding again.
 
Hey Pay, what editor are you using for your XML changes? If you are using anything less than Altova XMLSpy, then you are doing yourself a MASSIVE disservice-and might even be a major contributor to the errors you are encountering ;). You can get a free Home Version off of their web page. Good Luck, btw, from a fellow XML modder ;).

Aussie_Lurker.
 
Back
Top Bottom