Quick Modding Questions Thread

Here are the exceptions I got:

Spoiler :
s8o5l.jpg
 
I guess it's an ethnic scout, not the standard scout, right?

Such a bug is often caused by a wrong .nif/.kfm match.
It happens when you have a custom unit, and the .kfm file doesn't find a matching .nif file in the same folder (because the .nif name is hardcoded in the .kfm).
You can fix that by just renaming the .nif and adjusting the art defines for the unit.
 
I haven't put any ethnics (or any unit graphics in) this error only occurred after I copied HiTM's civ colors and colorvals to the Interface folder in XML.
 
@Radio Noer

It looks like you didn't copy the colors right. That assertion fails because the key is out of bounds. You can copy and paste all color definitions XML and Texas' civ XML here, or double check for yourself.

CIV4ColorVals.xml should contain two new colorvals definitions (COLOR_PLAYER_STUFF...)

CIV4PlayerColorInfos.xml should contain one new playercolorinfo definition (PLAYERCOLOR_STUFF) with keys from the previous file.

Then CIV4CivilizationInfos.xml should use PLAYERCOLOR_STUFF from CIV4PlayerColorInfos.xml. It's a common mistake to confuse PLAYERCOLOR_STUFF with COLOR_STUFF or COLOR_PLAYER_STUFF which would create exactly the problem you're experiencing, so check the spelling.

EDIT: If you fixed that already, then it's just the path to button that is wrong. Check for commas at the beginning of the path, they are the most common reason for button errors. Commas should only be used for atlases.
 
Here's my entry for Texas

Code:
		<CivilizationInfo>
			<Type>CIVILIZATION_TEXAS</Type>
			<Description>Republic of Texas</Description>
			<ShortDescription>Texas</ShortDescription>
			<Adjective>Texan</Adjective>
			<Civilopedia>TXT_KEY_CIV_TEXAS_PEDIA</Civilopedia>
			[B]<DefaultPlayerColor>PLAYERCOLOR_TEXAS</DefaultPlayerColor>[/B]
			<ArtDefineTag>ART_DEF_CIVILIZATION_TEXAS</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
			<UnitArtStyleType>UNIT_ARTSTYLE_EUROPEAN</UnitArtStyleType>
			<bPlayable>1</bPlayable>
			<bAIPlayable>1</bAIPlayable>

Here's the PlayerColorInfos

Code:
		<PlayerColorInfo>
			<Type>PLAYERCOLOR_DARK_INDIGO_AND_WHITE</Type>
			<ColorTypePrimary>COLOR_PLAYER_DARK_INDIGO</ColorTypePrimary>
			<ColorTypeSecondary>COLOR_PLAYER_WHITE</ColorTypeSecondary>
			<TextColorType>COLOR_PLAYER_DARK_INDIGO_TEXT</TextColorType>
		</PlayerColorInfo>
		<PlayerColorInfo>
			<Type>PLAYERCOLOR_ORANGE_AND_GREEN</Type>
			<ColorTypePrimary>COLOR_PLAYER_ORANGE</ColorTypePrimary>
			<ColorTypeSecondary>COLOR_PLAYER_DARK_GREEN</ColorTypeSecondary>
			<TextColorType>COLOR_PLAYER_ORANGE_TEXT</TextColorType>
		</PlayerColorInfo>
		<PlayerColorInfo>
			<Type>PLAYERCOLOR_ISRAEL_BLUE</Type>
			<ColorTypePrimary>COLOR_PLAYER_ISRAEL_BLUE</ColorTypePrimary>
			<ColorTypeSecondary>COLOR_PLAYER_WHITE</ColorTypeSecondary>
			<TextColorType>COLOR_PLAYER_ISRAEL_BLUE</TextColorType>
		</PlayerColorInfo>
		<PlayerColorInfo>
			<Type>PLAYERCOLOR_POLAND</Type>
			<ColorTypePrimary>COLOR_PLAYER_CRIMSON</ColorTypePrimary>
			<ColorTypeSecondary>COLOR_MAROON_TEXT</ColorTypeSecondary>
			<TextColorType>COLOR_PLAYER_WHITE</TextColorType>
		</PlayerColorInfo>
		<PlayerColorInfo>
			[B]<Type>PLAYERCOLOR_TEXAS</Type>[/B]
			<ColorTypePrimary>COLOR_PLAYER_GOLD</ColorTypePrimary>
			<ColorTypeSecondary>COLOR_PLAYER_BLACK</ColorTypeSecondary>
			<TextColorType>COLOR_BROWN_TEXT</TextColorType>
		</PlayerColorInfo>
	</PlayerColorInfos>
</Civ4PlayerColorInfos>

And here is the Colorvals

Code:
		<ColorVal>
			<Type>COLOR_PLAYER_ISRAEL_BLUE</Type>
			<fRed>0.00</fRed>
			<fGreen>0.46</fGreen>
			<fBlue>0.66</fBlue>
			<fAlpha>1.00</fAlpha>
		</ColorVal>
		<ColorVal>
			<Type>COLOR_PLAYER_CRIMSON</Type>
			<fRed>1.00</fRed>
			<fGreen>0.09</fGreen>
			<fBlue>0.09</fBlue>
			<fAlpha>1.00</fAlpha>
		</ColorVal>
		<ColorVal>
			<Type>COLOR_MAROON_TEXT</Type>
			<fRed>0.7</fRed>
			<fGreen>0.3</fGreen>
			<fBlue>0.4</fBlue>
			<fAlpha>1.00</fAlpha>
		</ColorVal>
		<ColorVal>
			<Type>COLOR_PLAYER_GOLD</Type>
			<fRed>1.00</fRed>
			<fGreen>0.77</fGreen>
			<fBlue>0.11</fBlue>
			<fAlpha>1.00</fAlpha>
		</ColorVal>
		<ColorVal>
			<Type>COLOR_PLAYER_MINTCREAM</Type>
			<fRed>0.96</fRed>
			<fGreen>1.00</fGreen>
			<fBlue>0.98</fBlue>
			<fAlpha>1.00</fAlpha>
		</ColorVal>

The button is fine, as I made it myself and it hasn't caused any issues before.
 
Then uh, are you absolutely sure it's just the colors? What if you change Texas' colors to something usual like PLAYERCOLOR_GRAY?
 
I changed the Playercolor to gray and the same error came up, the only thing I've done is add the colors. Even deleting the files hasn't helped. I'm getting another exception that I thought was unrelated, but maybe this is the real issue?

M10uN.jpg
 
I guess I might maybe move this discussion later to its own thread.

At problem: ..er...do you have a backup?

Not sure what the error is about, but if it crashes something in the basic loading process, then it might also result in a missing interface.
In this case it might be...er...that...um...maybe there's a bug module merged incorrectly?
Don't really know :dunno:.
 
Hi guys a second Q.

I have followed the tutorial for adding custom order and select files to a Civ, but it is not working.. I am 99.99% sure that my tags are right, so the question is:

Does it make a difference that part of the sound xml file is looking for sounds in my mod, and the rest of the file is looking for sounds in BtS, do I need to add something to my file paths to make it find my mod specific sounds or some other mod specific element not covered in the tutorial?

thanks for any help, I am stumped..

I have a custom menu screen music file working, so I know I can at least make something work in the mod...
 
I asked this question here a while ago but I think it might have been misunderstood.

I have a slave unit which has the same animations as a worker. the slave unit also has very small Great Engineer and Great Merchant abilities ie it can hurry a building a little or do a tiny trade mission in a foreign city. these abilities were put in just by adding the appropriate xml tags to the unit.

now I want to add animations to those 2 actions, the Great Engineer ability and the Great Merchant. I don't want to change or add any animations, just use pre-existing ones already attached to the worker unit: the cottage building animation and the surrender/capture animation.

so, what I need to know is how to attach an animation to a mission/action.

thanks
 
@srpt

All you need is this: http://forums.civfanatics.com/showthread.php?t=263215

+ the code for "Activate" action, which is 1015. Unfortunately there's just one such action so you can't have different animations for hurry & trade missions.

If you want to use the surrender animation, do this:
1. Use KonverterFM to decode worker's KFM to XML file (use any name, don't leave it blank).
2. In the XML file add this:
Code:
		<Animation>
			<Event>1015</Event>
			<Variation>0</Variation>
			<File>Worker_MD_Surrender.kf</File>
		</Animation>
3. Use KonverterFM to encode the XML back to KFM.

That's it.
 
I fixed it by deleting the debug dll? I don't really care why it worked, but it did, and now Texas won't be just another shade of generic yellow.

That's damn strange o_O.

how is the 'auto connect trade routes across water' controlled?

Would it be possible to have the same 'auto connect' feature across land?

See the TechInfos.xml, take a look at Astronomy.
Can be done for every terrain.

Hi guys a second Q.

I have followed the tutorial for adding custom order and select files to a Civ, but it is not working.. I am 99.99% sure that my tags are right, so the question is:

Does it make a difference that part of the sound xml file is looking for sounds in my mod, and the rest of the file is looking for sounds in BtS, do I need to add something to my file paths to make it find my mod specific sounds or some other mod specific element not covered in the tutorial?

thanks for any help, I am stumped..

I have a custom menu screen music file working, so I know I can at least make something work in the mod...

It will always look first at your mods folder, then at BtS, WL and last Vanilla.
So no, there's nothing else needed there.
 
Spoiler :
@srpt

All you need is this: http://forums.civfanatics.com/showthread.php?t=263215

+ the code for "Activate" action, which is 1015. Unfortunately there's just one such action so you can't have different animations for hurry & trade missions.

If you want to use the surrender animation, do this:
1. Use KonverterFM to decode worker's KFM to XML file (use any name, don't leave it blank).
2. In the XML file add this:
Code:
		<Animation>
			<Event>1015</Event>
			<Variation>0</Variation>
			<File>Worker_MD_Surrender.kf</File>
		</Animation>
3. Use KonverterFM to encode the XML back to KFM.

That's it.

I realize now it was me who misunderstood. I did not understand that the tags that attached the animation to the event were embedded in the kfm. I thought they must be in the xml or cpp files somewhere, but that I could not find them.

thank you, and the you to The_J for pointing me to that utility in the first place.
 
Hello :)

I got another qeird bug.

I have decided to make Hammam into a stand alone building.
I have removed entries for it for Ottomans in the CIV4CivilizationInfos file

and made proper changes to building files like this:

Spoiler :


<BuildingInfo>
<BuildingClass>BUILDINGCLASS_OTTOMAN_HAMMAM</BuildingClass>
<Type>BUILDING_OTTOMAN_HAMMAM</Type>
<SpecialBuildingType>NONE</SpecialBuildingType>
<Description>TXT_KEY_BUILDING_OTTOMAN_HAMMAM</Description>
<Civilopedia>TXT_KEY_BUILDING_OTTOMAN_HAMMAM_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_OTTOMAN_HAMMAM_STRATEGY</Strategy>
<Advisor>ADVISOR_GROWTH</Advisor>
<ArtDefineTag>ART_DEF_BUILDING_OTTOMAN_HAMMAM</ArtDefineTag>
<MovieDefineTag>NONE</MovieDefineTag>
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<bStateReligion>0</bStateReligion>
<PrereqReligion>NONE</PrereqReligion>
<PrereqCorporation>NONE</PrereqCorporation>
<FoundsCorporation>NONE</FoundsCorporation>
<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>
<VictoryPrereq>NONE</VictoryPrereq>
<FreeStartEra>ERA_RENAISSANCE</FreeStartEra>
<MaxStartEra>NONE</MaxStartEra>
<ObsoleteTech>NONE</ObsoleteTech>
<PrereqTech>TECH_MASONRY</PrereqTech>
<TechTypes>
<PrereqTech>NONE</PrereqTech>
<PrereqTech>NONE</PrereqTech>
</TechTypes>
<Bonus>NONE</Bonus>
<PrereqBonuses/>
<ProductionTraits/>
<HappinessTraits/>
<NoBonus>NONE</NoBonus>
<PowerBonus>NONE</PowerBonus>
<FreeBonus>NONE</FreeBonus>
<iNumFreeBonuses>0</iNumFreeBonuses>
<FreeBuilding>NONE</FreeBuilding>
<FreePromotion>NONE</FreePromotion>
<CivicOption>NONE</CivicOption>
<GreatPeopleUnitClass>NONE</GreatPeopleUnitClass>
<iGreatPeopleRateChange>0</iGreatPeopleRateChange>
<iHurryAngerModifier>0</iHurryAngerModifier>
<bBorderObstacle>0</bBorderObstacle>
<bTeamShare>0</bTeamShare>
<bWater>0</bWater>
<bRiver>0</bRiver>
<bPower>0</bPower>
<bDirtyPower>0</bDirtyPower>
<bAreaCleanPower>0</bAreaCleanPower>
<DiploVoteType>NONE</DiploVoteType>
<bForceTeamVoteEligible>0</bForceTeamVoteEligible>
<bCapital>0</bCapital>
<bGovernmentCenter>0</bGovernmentCenter>
<bGoldenAge>0</bGoldenAge>
<bAllowsNukes>0</bAllowsNukes>
<bMapCentering>0</bMapCentering>
<bNoUnhappiness>0</bNoUnhappiness>
<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
<bNeverCapture>0</bNeverCapture>
<bNukeImmune>0</bNukeImmune>
<bPrereqReligion>0</bPrereqReligion>
<bCenterInCity>1</bCenterInCity>
<iAIWeight>0</iAIWeight>
<iCost>100</iCost>
<iHurryCostModifier>0</iHurryCostModifier>
<iAdvancedStartCost>100</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<iMinAreaSize>-1</iMinAreaSize>
<iConquestProb>66</iConquestProb>
<iCitiesPrereq>0</iCitiesPrereq>
<iTeamsPrereq>0</iTeamsPrereq>
<iLevelPrereq>0</iLevelPrereq>
<iMinLatitude>0</iMinLatitude>
<iMaxLatitude>90</iMaxLatitude>
<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
<iGlobalGreatPeopleRateModifier>0</iGlobalGreatPeopleRateModifier>
<iAnarchyModifier>0</iAnarchyModifier>
<iGoldenAgeModifier>0</iGoldenAgeModifier>
<iGlobalHurryModifier>0</iGlobalHurryModifier>
<iExperience>0</iExperience>
<iGlobalExperience>0</iGlobalExperience>
<iFoodKept>0</iFoodKept>
<iAirlift>0</iAirlift>
<iAirModifier>0</iAirModifier>
<iAirUnitCapacity>0</iAirUnitCapacity>
<iNukeModifier>0</iNukeModifier>
<iNukeExplosionRand>0</iNukeExplosionRand>
<iFreeSpecialist>0</iFreeSpecialist>
<iAreaFreeSpecialist>0</iAreaFreeSpecialist>
<iGlobalFreeSpecialist>0</iGlobalFreeSpecialist>
<iMaintenanceModifier>0</iMaintenanceModifier>
<iWarWearinessModifier>0</iWarWearinessModifier>
<iGlobalWarWearinessModifier>0</iGlobalWarWearinessModifier>
<iEnemyWarWearinessModifier>0</iEnemyWarWearinessModifier>
<iHealRateChange>0</iHealRateChange>
<iHealth>2</iHealth>
<iAreaHealth>0</iAreaHealth>
<iGlobalHealth>0</iGlobalHealth>
<iHappiness>1</iHappiness>
<iAreaHappiness>0</iAreaHappiness>
<iGlobalHappiness>0</iGlobalHappiness>
<iStateReligionHappiness>0</iStateReligionHappiness>
<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
<iSpaceProductionModifier>0</iSpaceProductionModifier>
<iGlobalSpaceProductionModifier>0</iGlobalSpaceProductionModifier>
<iTradeRoutes>0</iTradeRoutes>
<iCoastalTradeRoutes>0</iCoastalTradeRoutes>
<iGlobalTradeRoutes>0</iGlobalTradeRoutes>
<iTradeRouteModifier>0</iTradeRouteModifier>
<iForeignTradeRouteModifier>0</iForeignTradeRouteModifier>
<iGlobalPopulationChange>0</iGlobalPopulationChange>
<iFreeTechs>0</iFreeTechs>
<iDefense>0</iDefense>
<iBombardDefense>0</iBombardDefense>
<iAllCityDefense>0</iAllCityDefense>
<iEspionageDefense>0</iEspionageDefense>
<iAsset>5</iAsset>
<iPower>0</iPower>
<fVisibilityPriority>1.0</fVisibilityPriority>
<SeaPlotYieldChanges/>
<RiverPlotYieldChanges/>
<GlobalSeaPlotYieldChanges/>
<YieldChanges/>
<CommerceChanges/>
<ObsoleteSafeCommerceChanges/>
<CommerceChangeDoubleTimes/>
<CommerceModifiers/>
<GlobalCommerceModifiers/>
<SpecialistExtraCommerces/>
<StateReligionCommerces/>
<CommerceHappinesses/>
<ReligionChanges/>
<SpecialistCounts/>
<FreeSpecialistCounts/>
<CommerceFlexibles/>
<CommerceChangeOriginalOwners/>
<ConstructSound>AS2D_BUILD_AQUEDUCT</ConstructSound>
<BonusHealthChanges/>
<BonusHappinessChanges/>
<BonusProductionModifiers/>
<UnitCombatFreeExperiences/>
<DomainFreeExperiences/>
<DomainProductionModifiers/>
<BuildingHappinessChanges/>
<PrereqBuildingClasses/>
<BuildingClassNeededs/>
<SpecialistYieldChanges/>
<BonusYieldModifiers/><BonusCommerceModifiers/>
<ImprovementFreeSpecialists/>
<Flavors>
<Flavor>
<FlavorType>FLAVOR_GROWTH</FlavorType>
<iFlavor>10</iFlavor>
</Flavor>
</Flavors>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
</BuildingInfo>


and

Spoiler :

<BuildingClassInfo>
<Type>BUILDINGCLASS_OTTOMAN_HAMMAM</Type>
<Description>TXT_KEY_BUILDING_OTTOMAN_HAMMAM</Description>
<iMaxGlobalInstances>-1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iMaxPlayerInstances>-1</iMaxPlayerInstances>
<iExtraPlayerInstances>0</iExtraPlayerInstances>
<bNoLimit>0</bNoLimit>
<bMonument>0</bMonument>
<DefaultBuilding>BUILDING_HAMMAM</DefaultBuilding>
<VictoryThresholds/>
</BuildingClassInfo>


my problem is following: I can build the Hamman, but it will not show up on the Technology Tree screen layout. It shows up when I look up detail info for the tech that needs to build it, but not on the tech tree.

I have a feeling I have a tag wrong somewhere, could please look over it?

thanks!
 
Back
Top Bottom