• 📚 A new project from the admin: Check out PictureBooks.io, an AI storyteller that lets you create personalized picture books for kids in seconds. Give it a try and let me know what you think!

Fatal Error when Modding Tech Tree

neutral_leader

Chieftain
Joined
Dec 11, 2007
Messages
34
Location
Colorado Springs
I've been working on a little modding project of my own (my first), rooted heavily in the good old Alpha Centauri, my longing for which even Civ 4 cannot satisfy. However, after diagnostically testing some of my xml glitches, I have discovered that any time I add a new prerequisite, in the "and" or the "or" category to any technology, it causes the game to crash after I hit return on the first turn, right when the screen should pop up to let you choose your first technology to research. All other modifications to CIV4TechInfos.xml work fine.

Has anyone else had this problem? Any ideas on how to fix it? I'm running it on an iBook G4 (OS 10.3.9), if anyone's curious, but I don't think it's a platform-specific issue. I'd appreciate any ideas. Thanks!
 
Post the code for the offending tech and we can see what's causing the crash.
 
Here's what I've edited the prerequisites for Mysticism to look like:

<OrPreReqs/>
<AndPreReqs>
<PrereqTech>TECH_MINING</PrereqTech>
<PrereqTech>TECH_CORPORATION</PrereqTech>
</AndPreReqs>

As opposed to the standard:

<OrPreReqs/>
<AndPreReqs/>

It's not just for mysticism though, it seems to crash no matter which technology I add a prereq to.
 
I've had similar problems. My guess is that it's the python (?) that builds the tech tree screen is where the bug is, and causes the CTDs. If the xml had syntax issues it would be show up in the xml.log. It just doesn't seem to handle the boolean relations as one would expect.

There is a thread from a year ago for my troubles. Suffice to say it wasn't apparent where the problem was, so I just rebuilt the whole file from scratch... That seemed to work fine, but my mod is currently suffering a CTD that appears to be related to the tech tree. The situation is: 1-4-1, where the the 4 can be researched in any order, but all must be researched to get to the next 1.
 
Hmm... I don't know anthing about Python. Do you mean to say that you started with a blank xml file and wrote from there, following the syntax of the original?

As far as adding "And" is concerned, that doesn't follow the pattern of the Firaxis code, but I gave it a shot anyway. No luck. Thanks though.
 
The original code posted correctly. However, here is the thing.

TECH_MINING
TECH_CORPORATION

you sure there are these additional techs and are you sure its spelled exactly like that?

Likewise, are any of your civilizations that start require the tech that is crashing?

The bad thing about XML is the error messages are not 100% accurate. The error could be the line of code right above what is causing the error.


Look at this...

Code:
			<Flavors>
				<Flavor>
					<FlavorType>FLAVOR_RELIGION</FlavorType>
					<iFlavor>9</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_GOLD</FlavorType>
					<iFlavor>1</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_CULTURE</FlavorType>
					<iFlavor>8</iFlavor>
				</Flavor>
				<Flavor>
					<FlavorType>FLAVOR_GROWTH</FlavorType>
					<iFlavor>2</iFlavor>
				</Flavor>
			<Flavors/>
			<OrPreReqs/>
			<AndPreReqs>
				<PrereqTech>TECH_MINING</PrereqTech>
				<PrereqTech>TECH_CORPORATION</PrereqTech>
			</AndPreReqs>


----do you spot the error?

<Flavors/> should be </Flavors>

XML is funny like that. Likewise if one of the techs was called....

TECH_CoRPORATION

you get errors too. Besides you do not want two "ands" and not a single "or"

"ors" are very important for aesthetic appeal and for creating arrows.

Rere to this thread for tech breakdown and the ANDs versus ORs:

http://forums.civfanatics.com/showthread.php?t=140232



personally I would do this (you may want to switch mining with corporation)

Code:
			<OrPreReqs>
				<PrereqTech>TECH_MINING</PrereqTech>
			</OrPreReqs>
			<AndPreReqs>
				<PrereqTech>TECH_CORPORATION</PrereqTech>
			</AndPreReqs>
 
Back
Top Bottom