Following Firaxis tutorial and loading the mod crashes the game

Draffin

Chieftain
Joined
Oct 28, 2015
Messages
21
Location
Amsterdam, Nederlands
So I've followed the second firaxis mod tutorial through and it seems now when I attempt to load the mod, the game just doesn't load. The loading splash screen doesn't appear and all I have is the Civ:BE mouse cursor on a black screen. If I alt+tab I find this error has popped up. The game crashes shortly after.

Spoiler :

Unhandled Exception
Code: EXCEPTION_ACCESS_VIOLATION
Error reading address 0xe0

Call Stack
-----------------------------------------------------
??? ! ??? ???, line 0
??? ! ??? ???, line 0
??? ! ??? ???, line 0
??? ! ??? ???, line 0
??? ! ??? ???, line 0
??? ! ??? ???, line 0
??? ! ??? ???, line 0
??? ! ??? ???, line 0


I've gone through and double checked my code for syntax errors, tried removing different aspects and nothing seems to make a difference. Any help would be greatly appreciated.

Here's the link to the youtube tutorial
https://www.youtube.com/watch?v=crNgMqqbCqY

Here's my code
Spoiler :

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 11/4/2015 8:12:17 PM -->
<GameData>

	<BuildingClasses>
		<Row>
			<Type>BUILDINGClASS_ENTROPY_NULLIFIER</Type>
			<DefaultBuilding>BUILDING_ENTROPY_NULLIFER</DefaultBuilding>
			<Description>TXT_KEY_BUILDING_ENTROPY_NULLIFER</Description>
			<MaxGlobalInstances>1</MaxGlobalInstances>
		</Row>
	</BuildingClasses>

	<Buildings>
		<Row>
			<Type>BUILDING_ENTROPY_NULLIFER</Type>
			<BuildingClass>BUILDINGCLASS_ENTROPY_NULLIFER</BuildingClass>
			<Cost>1500</Cost>
			<ConquestProbability>100</ConquestProbability>
			<PrereqTech>TECH_PLANETARY_ENGINEERING</PrereqTech>
			<Description>TXT_KEY_WONDER_ENTROPY_NULLIFER_DESC</Description>
			<Help>TXT_KEY_WONDER_ENTROPY_NULLIFER_HELP</Help>
			<Civilopedia>TXT_KEY_WONDER_ENTROPY_NULLIFER_PEDIA</Civilopedia>
			<Quote>TXT_KEY_TECH_PIONEERING_QUOTE</Quote>
			<ArtDefineTag>TECTONIC_ANVIL</ArtDefineTag>
			<HurryCostModifier>-1</HurryCostModifier>
			<DisplayPosition>4</DisplayPosition>
			<IconAtlas>BW_ATLAS_2</IconAtlas>
			<PortraitIndex>24</PortraitIndex>
			<WonderSplashImage>Wonder_Tectonic_Anvil.dds</WonderSplashImage>
			<WonderSplashAudio>AS2D_TECH_SPEECH_PIONEERING</WonderSplashAudio>
		</Row>
	</Buildings>

	<Building_ResourceQuantityRequirements>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFER</BuildingType>
			<ResourceType>RESOURCE_GEOTHERMAL_ENERGY</ResourceType>
			<Cost>5</Cost>
		</Row>
	</Building_ResourceQuantityRequirements>

	<LocalizedText>
		<Row Language="en_US" Tag="TXT_KEY_WONDER_ENTROPY_NULLIFER_DESC">
			<Text>Entropy Nullifer</Text>
		</Row>

		<Row Language="en_US" Tag="TXT_KEY_WONDER_ENTROPY_NULLIFER_PEDIA">
			<Text>Does great things, Nicole is a babe</Text>
		</Row>

		<Row Language="en_US" Tag="TXT_KEY_WONDER_ENTROPY_NULLIFER_HELP">
			<Text>A wonder that converts Geothermal energy into other Strategic Resources.</Text>
		</Row>
	</LocalizedText>
	
	<Building_ResourceQuantity>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFER</BuildingType>
			<ResourceType>RESOURCE_PETROLEUM</ResourceType>
			<Quantity>3</Quantity>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFER</BuildingType>
			<ResourceType>RESOURCE_TITANIUM</ResourceType>
			<Quantity>3</Quantity>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFER</BuildingType>
			<ResourceType>RESOURCE_XENOMASS</ResourceType>
			<Quantity>1</Quantity>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFER</BuildingType>
			<ResourceType>RESOURCE_FLOAT_STONE</ResourceType>
			<Quantity>1</Quantity>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFER</BuildingType>
			<ResourceType>RESOURCE_FIRAXITE</ResourceType>
			<Quantity>1</Quantity>
		</Row>
	</Building_ResourceQuantity>

	<Building_Flavors>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<FlavorType>FLAVOR_PRODUCTION</FlavorType>
			<Flavor>180</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<FlavorType>FLAVOR_WONDER</FlavorType>
			<Flavor>30</Flavor>
		</Row>
	</Building_Flavors>

</GameData>

Thank you in advance.
 
Code:
<BuildingClasses>
		<Row>
			<Type>[B]BUILDINGClASS[/B]_ENTROPY_[U]NULLIFIER[/U]</Type>
			<DefaultBuilding>BUILDING_ENTROPY_NULLIFER</DefaultBuilding>
			<Description>TXT_KEY_BUILDING_ENTROPY_NULLIFER</Description>
			<MaxGlobalInstances>1</MaxGlobalInstances>
		</Row>
	</BuildingClasses>

<Buildings>
		<Row>
			<Type>BUILDING_ENTROPY_NULLIFER</Type>
			<BuildingClass>BUILDINGCLASS_ENTROPY_[u]NULLIFER[/u]</BuildingClass>
			<Cost>1500</Cost>
			<ConquestProbability>100</ConquestProbability>
Bold: There's a small l in the "BUILDINGClASS", must be a big L. Variables are case-sensitive.

Underlined: The names don't match up, you're refering to the wonder as "NULLIFIER" once and then as "NULLIFER".

After fixing both of them your code loads fine. Copy-paste just in case your can't get yours to work:

Spoiler :

Code:
<GameData>

	<BuildingClasses>
		<Row>
			<Type>BUILDINGCLASS_ENTROPY_NULLIFIER</Type>
			<DefaultBuilding>BUILDING_ENTROPY_NULLIFIER</DefaultBuilding>
			<Description>TXT_KEY_BUILDING_ENTROPY_NULLIFIER</Description>
			<MaxGlobalInstances>1</MaxGlobalInstances>
		</Row>
	</BuildingClasses>

	<Buildings>
		<Row>
			<Type>BUILDING_ENTROPY_NULLIFIER</Type>
			<BuildingClass>BUILDINGCLASS_ENTROPY_NULLIFIER</BuildingClass>
			<Cost>1500</Cost>
			<ConquestProbability>100</ConquestProbability>
			<PrereqTech>TECH_PLANETARY_ENGINEERING</PrereqTech>
			<Description>TXT_KEY_WONDER_ENTROPY_NULLIFIER_DESC</Description>
			<Help>TXT_KEY_WONDER_ENTROPY_NULLIFIER_HELP</Help>
			<Civilopedia>TXT_KEY_WONDER_ENTROPY_NULLIFIER_PEDIA</Civilopedia>
			<Quote>TXT_KEY_TECH_PIONEERING_QUOTE</Quote>
			<ArtDefineTag>TECTONIC_ANVIL</ArtDefineTag>
			<HurryCostModifier>-1</HurryCostModifier>
			<DisplayPosition>4</DisplayPosition>
			<IconAtlas>BW_ATLAS_2</IconAtlas>
			<PortraitIndex>24</PortraitIndex>
			<WonderSplashImage>Wonder_Tectonic_Anvil.dds</WonderSplashImage>
			<WonderSplashAudio>AS2D_TECH_SPEECH_PIONEERING</WonderSplashAudio>
		</Row>
	</Buildings>

	<Building_ResourceQuantityRequirements>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<ResourceType>RESOURCE_GEOTHERMAL_ENERGY</ResourceType>
			<Cost>5</Cost>
		</Row>
	</Building_ResourceQuantityRequirements>

	<LocalizedText>
		<Row Language="en_US" Tag="TXT_KEY_WONDER_ENTROPY_NULLIFIER_DESC">
			<Text>Entropy Nullifier</Text>
		</Row>

		<Row Language="en_US" Tag="TXT_KEY_WONDER_ENTROPY_NULLIFIER_PEDIA">
			<Text>Does great things, Nicole is a robot sent by Doctor Doom</Text>
		</Row>

		<Row Language="en_US" Tag="TXT_KEY_WONDER_ENTROPY_NULLIFIER_HELP">
			<Text>A wonder that converts Geothermal energy into other Strategic Resources.</Text>
		</Row>
	</LocalizedText>

	<Building_ResourceQuantity>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<ResourceType>RESOURCE_PETROLEUM</ResourceType>
			<Quantity>3</Quantity>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<ResourceType>RESOURCE_TITANIUM</ResourceType>
			<Quantity>3</Quantity>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<ResourceType>RESOURCE_XENOMASS</ResourceType>
			<Quantity>1</Quantity>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<ResourceType>RESOURCE_FLOAT_STONE</ResourceType>
			<Quantity>1</Quantity>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<ResourceType>RESOURCE_FIRAXITE</ResourceType>
			<Quantity>1</Quantity>
		</Row>
	</Building_ResourceQuantity>

	<Building_Flavors>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<FlavorType>FLAVOR_PRODUCTION</FlavorType>
			<Flavor>180</Flavor>
		</Row>
		<Row>
			<BuildingType>BUILDING_ENTROPY_NULLIFIER</BuildingType>
			<FlavorType>FLAVOR_WONDER</FlavorType>
			<Flavor>30</Flavor>
		</Row>
	</Building_Flavors>

</GameData>
 
Ryika, you're a great person.

Did you just do that by looking at it or do you have an IDE or debugger stashed on you somewhere?

Thank you again!
 
No, I just had that kind of problem a while ago myself.

If the game crashes and the problem is a building, then the cause is usually that the Buildingclass isn't correct (or missing IDs, if you hard-deleted stuff) - because pretty much everything else will just invalidate the file and make the stuff not load (+give an error).

A mismatched Buildingclass however is not an error in the code, so the game will think everything's fine, load stuff into the database and then when it tries to find the Buildingclass for that building in the table, finds nothing and crashes.
 
Ok, soooooo.

I made the changes and the game doesn't crash any more. Thank you again for that.

However the Wonder doesn't appear in the tech tree nor in the production queue for a city (I changed the required tech to habitation and so expected it to appear). It does exist in the civilopedia though.

I tried replicating the example from the first tutorial which had worked fine, but to no avail. I assume it has something to do with the following lines of code that are in bold...?

Code:
<Buildings>
		<Row>
			<Type>BUILDING_ENTROPY_NULLIFER</Type>
			<BuildingClass>BUILDINGCLASS_ENTROPY_NULLIFIER</BuildingClass>
			<Cost>1500</Cost>
			<ConquestProbability>100</ConquestProbability>
			<PrereqTech>TECH_PLANETARY_ENGINEERING</PrereqTech>
			<Description>TXT_KEY_WONDER_ENTROPY_NULLIFER_DESC</Description>
			<Help>TXT_KEY_WONDER_ENTROPY_NULLIFER_HELP</Help>
			<Civilopedia>TXT_KEY_WONDER_ENTROPY_NULLIFER_PEDIA</Civilopedia>
			<Quote>TXT_KEY_TECH_PIONEERING_QUOTE</Quote>
			<ArtDefineTag>TECTONIC_ANVIL</ArtDefineTag>
			<HurryCostModifier>-1</HurryCostModifier>
			[B]<DisplayPosition>4</DisplayPosition>
			<IconAtlas>BW_ATLAS_2</IconAtlas>
			<PortraitIndex>24</PortraitIndex>
			<WonderSplashImage>Wonder_Tectonic_Anvil.dds</WonderSplashImage>
			<WonderSplashAudio>AS2D_TECH_SPEECH_PIONEERING</WonderSplashAudio>[/B]
		</Row>
	</Buildings>
I have no idea what the DisplayPosition, IconAtlas, PortraitIndex, SplashImage or SplashAudio do though.

Thanks again!
 
DisplayPosition determines where Wonders show up on the map.
IconAtlas + PortraitIndex define the Icon that is used for the Building
SplashImage and SplashAudio are the Pic/Soundfile used when the Wonder is completed

None of these should cause any problems and the Wonder shows up just fine for me. Habitation already has already 5 Symbols though, I don't think it can show more than them. Try Planetary Survey or something else.
 
I've noticed that Habitation will only ever show 5 things on the 'recently researched' view that shows up in the top left corner on the start of the game, but will display more when you go into the tech web. So if it's tied to that, it should still show up there. Maybe do another run through for spell checking - if in the table you try and call a column name that doesn't exist, the code just won't process the table. It might still process the localized text table if it's on a different xml page though, explaining why the civilopedia shows up without the building itself. What does the civilopedia say about the wonder?
 
Weird.

The civilopedia shows the entry that I added (and my girlfriends addendum).

Hmm ok, I didn't copy your edits last time Ryika I just changed them on my end manually, so I'll double check again. And then if no luck I'll just try pasting in what you posted.

@GenEngineer - You're right, the first tutorial I did had the extra building just go off the end of the habitation entry but it still worked fine. I'll check that spelling.
 
Riddle solved.

I'm just really really bad at typing 'Nullifier'.

Thanks again for your help guys. I'm sure it won't be the last time I'll need it. I'll pay more attention to my typos in the future.

@Ryika - When you say DisplayPosition is where the wonder appears on the map. You mean on the game map when the little model appears somewhere around the city? (I didn't even notice these happening in BE, but I know they do in Civ 5)
 
Top Bottom