My mod seems to create an "Unhandled Exemption" error. Any ideas on how to fix it?

Galgus

Emperor
Joined
Aug 22, 2012
Messages
1,705
The mod itself is not yet functional with some more mundane bugfixes still needed to work, but as-is it is crashing the game when I try to start a landing with the mod enabled.

It started doing this when I fixed an issue in one of its XML folders - before then it simply did not work and the landing was allowed to go through.

When I tried to launch it to test if that particular XML file was working then, this happened.

It uses lua code that I don't have a great grasp of which was provided by a better modder, but I know from testing the lua works when used properly.

Does anyone know what could cause a mod to crash the game on start rather than simply not loading?

I can provide any log files you think would be relevant, though I don't know what to look for with this.
 
Most likely cause is a missing reference. A building that has no BuildingClass, or maybe you have deleted stuff that is still used by other files.
 
Thanks, looking over it I think part of the problem may have been missing ConquestProbability entries.

On a separate issue, how does one properly alter building quests?

I think I may be using the Update function wrong with them: this is a part of such code.

Code:
<PlayerPerks_BuildingYieldEffects>
		<Update>
			<PlayerPerkType>PLAYERPERK_PROGENITOR_GARDENS_SCIENCE_MOD</PlayerPerkType>
			<BuildingClassType>BUILDINGCLASS_GAIAN_WELL</BuildingClassType>
			<YieldType>YIELD_SCIENCE</YieldType>
			<PercentYield>0</PercentYield>
		</Update>
	</PlayerPerks_BuildingYieldEffects>
	
	<PlayerPerks_GeneralBuildingEffects>
		<Update>
			<PlayerPerkType>PLAYERPERK_PROGENITOR_GARDENS_HEALTH_MOD</PlayerPerkType>
			<BuildingClassType>BUILDINGCLASS_PROGENITOR_GARDEN</BuildingClassType>
			<PercentHealth>0</PercentHealth>
		</Update>
	</PlayerPerks_GeneralBuildingEffects>
	
	<PlayerPerks_GeneralBuildingEffects>
		<Row>
			<PlayerPerkType>PLAYERPERK_PROGENITOR_GARDENS_HEALTH_MOD</PlayerPerkType>
			<BuildingClassType>BUILDINGCLASS_PROGENITOR_GARDEN</BuildingClassType>
			<FlatHealth>3</FlatHealth>
		</Row>
	</PlayerPerks_GeneralBuildingEffects>
	
	<PlayerPerks_BuildingYieldEffects>
		<Row>
			<PlayerPerkType>PLAYERPERK_PROGENITOR_GARDENS_SCIENCE_MOD</PlayerPerkType>
			<BuildingClassType>BUILDINGCLASS_PROGENITOR_GARDEN</BuildingClassType>
			<YieldType>YIELD_CAPITAL</YieldType>
			<FlatYield>4</FlatYield>
		</Row>
	</PlayerPerks_BuildingYieldEffects>
 
No, ConquestProbability shouldn't cause any issues, there's a base value defined for that. Your idea is correct, but your syntax is wrong, here's how it's done properly:

Code:
<PlayerPerks_BuildingYieldEffects>
	<Update>
		<Where PlayerPerkType="PLAYERPERK_PROGENITOR_GARDENS_SCIENCE_MOD" BuildingClassType="BUILDINGCLASS_GAIAN_WELL" YieldType="YIELD_SCIENCE"/>
		<Set PercentYield="15"/>
	</Update>
</PlayerPerks_BuildingYieldEffects>

<Update> always needs the 'Where'. BUT you actually want to set a yield-value of 0, so you should use the <Delete>-Tag instead:

Code:
<PlayerPerks_BuildingYieldEffects>
	<Delete
		<PlayerPerkType>PLAYERPERK_PROGENITOR_GARDENS_SCIENCE_MOD</PlayerPerkType>
		<BuildingClassType>BUILDINGCLASS_GAIAN_WELL</BuildingClassType>
		<YieldType>YIELD_SCIENCE</YieldType>
		<PercentYield>5</PercentYield>
	</Delete>
</PlayerPerks_BuildingYieldEffects>

Not sure if it makes any difference here, but if you update to 0 in the normal building table it will show a yield of 0, instead of nothing.

The incorrect syntax may very wll be the cause of the ctd, because it makes the whole file invalid.
 
Back
Top Bottom