• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

[TUTORIAL] Modular XML Modding With A New Dawn

Ok i finished up the rest of the Misc Mod since Afforess did not want to do it. I had to alter them a bit from my original idea but they still are unique from other buildings. The buildings included are; Animal Shrine, Tattoo Parlor, Chinampa and Great Chinampa.

@Afforess
Please add it to A New Dawn. Thank you. :D (See Attachment)
 
@Afforess

I have been having trouble understanding the CIV4CivicInfos when trying to make my "Garbage Civic Mod". I have been using your "Ideology Civics Mod" as a base. Thus i have the following files ...

- Garbage_CIV4CivicInfos
- Garbage_CIV4CivicOptionInfos
- Garbage_CIV4CivilizationInfos
- Garbage_CIV4CivilizationsSchema
- Garbage_CIV4GameInfoSchema
- Garbage_CIV4GameTextInfos
- Garbage_CIV4UpKeepInfo

Are these the correct files I need? Do I have enough or do I have too many. Note I am not including any new buildings for this.

I do not understand what the Garbage_CIV4UpKeepInfo is for. Or what is included in the Garbage_CIV4GameTextInfos.

Also in the Garbage_CIV4CivilizationInfos Do you need to list all civic categories or only ones in AND? Such as do I need to list the ones from your Ideology and Military mods too?

Code:
		<CivilizationInfo>
			<Type>CIVILIZATION_ABYSSINIANS</Type>
			<AndDependencyTypes>
				<DependencyType>CIVILIZATION_ABYSSINIANS</DependencyType>
			</AndDependencyTypes>
			<InitialCivics>
				<CivicType>CIVIC_CHIEFDOM</CivicType>
				<CivicType>CIVIC_OLIGARCHY</CivicType>
				<CivicType>CIVIC_TRIBAL</CivicType>
				<CivicType>CIVIC_BARTER</CivicType>
				<CivicType>CIVIC_FOLKLORE</CivicType>
				<CivicType>CIVIC_SURVIVAL</CivicType>
				<CivicType>CIVIC_NOTHING</CivicType>
				<CivicType>CIVIC_NONE</CivicType>
			</InitialCivics>
		</CivilizationInfo>

In short could you do a mini-tutorial on how you made a new Civic category please?

EDIT: This is what I want to try to do ...

Spoiler :

Department Of Waste:

None (Available at Start)
o No Upkeep
o +2 Unhealthiness in all cities
o 25% Slower City growth


Waste to Sea (Requires: Seafaring)
o No Upkeep
o +1 Unhealthiness in all cities
o -1 Diplomacy; "Your polluting the ocean!"
o -1 Commerce from all water tiles
o 10% Slower City Growth
o -20% City Maintenance


Landfills (Requires: Sanitation)
o Low Upkeep
o 50% Faster Construction of Landfill


Waste Exportation (Requires: Economics)
o High Upkeep
o +1 Healthiness in all cities
o +1 Happiness in all cities
o -1 Diplomacy "You take advantage of other countries!"


Waste Importation (Requires: Economics)
o No Upkeep
o +5 Unhealthiness in all cities
o +15% slower city growth
o +25% Wealth in all cities


Off-Planet Dumping (Requires: Space Flight)
o Astronomical Upkeep
o +2 Healthiness in all cities
o +1 Happiness in all cities


Waste to Energy (Requires: Industrialization)
o Medium Upkeep
o +1 Unhealthiness
o +10% Production
 
You have all the right files. You will have to use a different XML name for your "None" civic (You can still make the it "None" in the gametext, so players won't know the difference). The CivilizationInfos should ONLY list the civic in RoM, IIRC.

So like this:
Code:
<CivilizationInfo>
			<Type>CIVILIZATION_ABYSSINIANS</Type>
			<AndDependencyTypes>
				<DependencyType>CIVILIZATION_ABYSSINIANS</DependencyType>
			</AndDependencyTypes>
			<InitialCivics>
				<CivicType>CIVIC_CHIEFDOM</CivicType>
				<CivicType>CIVIC_OLIGARCHY</CivicType>
				<CivicType>CIVIC_TRIBAL</CivicType>
				<CivicType>CIVIC_BARTER</CivicType>
				<CivicType>CIVIC_FOLKLORE</CivicType>
				<CivicType>CIVIC_SURVIVAL</CivicType>
				<CivicType>CIVIC_NOTHING</CivicType>
				<CivicType>CIVIC_NO_CIVIC</CivicType> <!-- Your New Civic -->
			</InitialCivics>
		</CivilizationInfo>

Make sure you edit entries for all the civilizations though; otherwise glitches happen when a player has no civic in a civic category.
 
Ok I replaced the word NONE with NO_CIVIC using the notepad replace function. It seemed to work.

However what do these do? And what are they for? ...

Garbage_CIV4UpKeepInfo
Code:
<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 2 U ([url]http://www.xmlspy.com[/url]) by Jesse Smith (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Upkeep -->
<Civ4UpkeepInfo xmlns="x-schema:Garbage_CIV4GameInfoSchema.xml">
	<UpkeepInfos>
		<UpkeepInfo>
			<Type>UPKEEP_EXTREME</Type>
			<Description>TXT_KEY_UPKEEP_EXTREME</Description>
			<Strategy>TXT_KEY_UPKEEP_HIGH_HELP</Strategy>
			<iPopulationPercent>30</iPopulationPercent>
			<iCityPercent>80</iCityPercent>
		</UpkeepInfo>
	</UpkeepInfos>
</Civ4UpkeepInfo>

Garbage_CIV4GameTextInfos
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by XMLSPY 2004 Professional Ed. Release 2, Installed Multi + SMP for 3 users (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Game Text Infos -->
<Civ4GameText xmlns="http://www.firaxis.com">
	<TEXT>
		<Tag>TXT_KEY_UPKEEP_EXTREME</Tag>
		<English>Astronomical Upkeep</English>
		<French>Astronomical Upkeep</French>
		<German>Astronomischer Unterhalt</German>
		<Italian>Astronomical Upkeep</Italian>
		<Spanish>Astronomical Upkeep</Spanish>
	</TEXT>
</Civ4GameText>

I am assuming the 2nd one is the text info for the first file. Is Astronomical Upkeep a new category?
 
Yeah, if you don't need Astronomical Upkeep, you don't need the file.
 
I think I will keep it for the "Off-Planet Dumping" choice.

Ok now for the main file. Here is the base none without changes yet.

Garbage_CIV4CivicInfos
Spoiler :

Code:
		<CivicInfo>
			<CivicOptionType>CIVICOPTION_IDEOLOGY</CivicOptionType>
			<Type>CIVIC_NONE</Type>
			<Description>TXT_KEY_CIVIC_NOTHING</Description>
			<Civilopedia>TXT_KEY_CIVIC_NOTHING_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_CIVIC_NOTHING_STRATEGY</Strategy>
			<Button>,Art/Interface/Buttons/Civics/None.dds,Art/Interface/Buttons/RoM_Civic_Atlas.dds,7,4</Button>
			<TechPrereq>NONE</TechPrereq>
			<iAnarchyLength>0</iAnarchyLength>
			<Upkeep>NONE</Upkeep>
			<iAIWeight>0</iAIWeight>
			<iGreatPeopleRateModifier>0</iGreatPeopleRateModifier>
			<iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
			<iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
			<iStateReligionGreatPeopleRateModifier>0</iStateReligionGreatPeopleRateModifier>
			<iDistanceMaintenanceModifier>0</iDistanceMaintenanceModifier>
			<iNumCitiesMaintenanceModifier>0</iNumCitiesMaintenanceModifier>
			<iCorporationMaintenanceModifier>0</iCorporationMaintenanceModifier>
			<iExtraHealth>0</iExtraHealth>
			<iFreeExperience>0</iFreeExperience>
			<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
			<iImprovementUpgradeRateModifier>0</iImprovementUpgradeRateModifier>
			<iMilitaryProductionModifier>0</iMilitaryProductionModifier>
			<iBaseFreeUnits>0</iBaseFreeUnits>
			<iBaseFreeMilitaryUnits>0</iBaseFreeMilitaryUnits>
			<iFreeUnitsPopulationPercent>0</iFreeUnitsPopulationPercent>
			<iFreeMilitaryUnitsPopulationPercent>0</iFreeMilitaryUnitsPopulationPercent>
			<iGoldPerUnit>0</iGoldPerUnit>
			<iGoldPerMilitaryUnit>0</iGoldPerMilitaryUnit>
			<iHappyPerMilitaryUnit>0</iHappyPerMilitaryUnit>
			<bMilitaryFoodProduction>0</bMilitaryFoodProduction>
			<iMaxConscript>0</iMaxConscript>
			<bNoUnhealthyPopulation>0</bNoUnhealthyPopulation>
			<iExpInBorderModifier>0</iExpInBorderModifier>
			<bBuildingOnlyHealthy>0</bBuildingOnlyHealthy>
			<iLargestCityHappiness>0</iLargestCityHappiness>
			<iCivicHappiness>0</iCivicHappiness>
			<iWarWearinessModifier>0</iWarWearinessModifier>
			<iFreeSpecialist>0</iFreeSpecialist>
			<iTradeRoutes>0</iTradeRoutes>
			<bNoForeignTrade>0</bNoForeignTrade>
			<bNoCorporations>0</bNoCorporations>
			<bNoForeignCorporations>0</bNoForeignCorporations>
			<iCivicPercentAnger>0</iCivicPercentAnger>
			<bStateReligion>0</bStateReligion>
			<bNoNonStateReligionSpread>0</bNoNonStateReligionSpread>
			<iStateReligionHappiness>0</iStateReligionHappiness>
			<iNonStateReligionHappiness>0</iNonStateReligionHappiness>
			<iStateReligionUnitProductionModifier>0</iStateReligionUnitProductionModifier>
			<iStateReligionBuildingProductionModifier>0</iStateReligionBuildingProductionModifier>
			<iStateReligionFreeExperience>0</iStateReligionFreeExperience>
			<YieldModifiers/>
			<CapitalYieldModifiers/>
			<TradeYieldModifiers/>
			<CommerceModifiers/>
			<CapitalCommerceModifiers/>
			<SpecialistExtraCommerces/>
			<Hurrys/>
			<SpecialBuildingNotRequireds/>
			<SpecialistValids/>
			<BuildingHappinessChanges/>
			<BuildingHealthChanges/>
			<FeatureHappinessChanges/>
			<ImprovementYieldChanges/>
			<!-- Revolution Mod Start -->
			<iRevIdxLocal>0</iRevIdxLocal>
			<iRevIdxNational>0</iRevIdxNational>
			<iRevIdxHolyCityGood>0</iRevIdxHolyCityGood>
			<iRevIdxHolyCityBad>0</iRevIdxHolyCityBad>
			<iRevIdxSwitchTo>0</iRevIdxSwitchTo>
			<fRevIdxNationalityMod>0</fRevIdxNationalityMod>
			<fRevIdxBadReligionMod>0</fRevIdxBadReligionMod>
			<fRevIdxGoodReligionMod>0</fRevIdxGoodReligionMod>
			<fRevIdxDistanceMod>0</fRevIdxDistanceMod>
			<fRevViolentMod>0</fRevViolentMod>
			<iRevReligiousFreedom>0</iRevReligiousFreedom>
			<iRevLaborFreedom>0</iRevLaborFreedom>
			<iRevEnvironmentalProtection>0</iRevEnvironmentalProtection>
			<iRevDemocracyLevel>0</iRevDemocracyLevel>
			<bCommunism>0</bCommunism>
			<bFreeSpeech>0</bFreeSpeech>
			<bCanDoElection>0</bCanDoElection>
			<!-- Revolution Mod End -->
			<WeLoveTheKing/>
			<iAttitudeShareMod>0</iAttitudeShareMod>
			<Flavors>
			</Flavors>
		</CivicInfo>

Is there any part of this that I should know about that differs from say building code? For instance it looks like the image file is called in this directly rather than to its own separate art file list.
 
Not any real big changes. The image is the only difference, it just uses a button; instead an entire art section.
 
You have all the right files. You will have to use a different XML name for your "None" civic (You can still make the it "None" in the gametext, so players won't know the difference). The CivilizationInfos should ONLY list the civic in RoM, IIRC.

So like this:
Code:
<CivilizationInfo>
			<Type>CIVILIZATION_ABYSSINIANS</Type>
			<AndDependencyTypes>
				<DependencyType>CIVILIZATION_ABYSSINIANS</DependencyType>
			</AndDependencyTypes>
			<InitialCivics>
				<CivicType>CIVIC_CHIEFDOM</CivicType>
				<CivicType>CIVIC_OLIGARCHY</CivicType>
				<CivicType>CIVIC_TRIBAL</CivicType>
				<CivicType>CIVIC_BARTER</CivicType>
				<CivicType>CIVIC_FOLKLORE</CivicType>
				<CivicType>CIVIC_SURVIVAL</CivicType>
				<CivicType>CIVIC_NOTHING</CivicType>
				<CivicType>CIVIC_NO_CIVIC</CivicType> <!-- Your New Civic -->
			</InitialCivics>
		</CivilizationInfo>

Make sure you edit entries for all the civilizations though; otherwise glitches happen when a player has no civic in a civic category.

I am getting some major errors with these. Also I notice some civs on the ideology list have 8 choices while other have 9 choices. For example this ...

Code:
		<CivilizationInfo>
			<Type>CIVILIZATION_KOREA</Type>
			<AndDependencyTypes>
				<DependencyType>CIVILIZATION_KOREA</DependencyType>
				<DependencyType>CIVIC_BANDITS</DependencyType>
			</AndDependencyTypes>
			<InitialCivics>
				<CivicType>CIVIC_CHIEFDOM</CivicType>
				<CivicType>CIVIC_OLIGARCHY</CivicType>
				<CivicType>CIVIC_TRIBAL</CivicType>
				<CivicType>CIVIC_BARTER</CivicType>
				<CivicType>CIVIC_FOLKLORE</CivicType>
				<CivicType>CIVIC_SURVIVAL</CivicType>
				<CivicType>CIVIC_NOTHING</CivicType>
				<CivicType>CIVIC_BANDITS</CivicType>
				<CivicType>CIVIC_NONE</CivicType>
			</InitialCivics>
		</CivilizationInfo>
 
I am getting some major errors with these. Also I notice some civs on the ideology list have 8 choices while other have 9 choices. For example this ...

Code:
		<CivilizationInfo>
			<Type>CIVILIZATION_KOREA</Type>
			<AndDependencyTypes>
				<DependencyType>CIVILIZATION_KOREA</DependencyType>
				<DependencyType>CIVIC_BANDITS</DependencyType>
			</AndDependencyTypes>
			<InitialCivics>
				<CivicType>CIVIC_CHIEFDOM</CivicType>
				<CivicType>CIVIC_OLIGARCHY</CivicType>
				<CivicType>CIVIC_TRIBAL</CivicType>
				<CivicType>CIVIC_BARTER</CivicType>
				<CivicType>CIVIC_FOLKLORE</CivicType>
				<CivicType>CIVIC_SURVIVAL</CivicType>
				<CivicType>CIVIC_NOTHING</CivicType>
				<CivicType>CIVIC_BANDITS</CivicType>
				<CivicType>CIVIC_NONE</CivicType>
			</InitialCivics>
		</CivilizationInfo>

Oh yeah.. I remember that. They are problematic, because they overwrite old entries. You will need to play with dependencies...

I think I should just get rid of initial civics, and make the game choose the first civic in the Civic Category, since it is always the initial civic anyway.
 
It is in 1.72, I tested it, and it seems to work fine. Make sure that the blank (None) civic requires no technologies, and is the first in the XML order.

So wait should I write it like this?

Code:
 	        	 <InitialCivics>
				<CivicType>[B][COLOR="Red"]CIVIC_NOTRASH[/COLOR][/B]</CivicType>
				<CivicType>CIVIC_CHIEFDOM</CivicType>
				<CivicType>CIVIC_OLIGARCHY</CivicType>
				<CivicType>CIVIC_TRIBAL</CivicType>
				<CivicType>CIVIC_BARTER</CivicType>
				<CivicType>CIVIC_FOLKLORE</CivicType>
				<CivicType>CIVIC_SURVIVAL</CivicType>
				<CivicType>CIVIC_NOTHING</CivicType>
				<CivicType>CIVIC_BANDITS</CivicType>
				<CivicType>CIVIC_NONE</CivicType>
			</InitialCivics>

Should I leave out the military and ideology civics?
 
So wait should I write it like this?

Code:
 	        	 <InitialCivics>
				<CivicType>[B][COLOR="Red"]CIVIC_NOTRASH[/COLOR][/B]</CivicType>
				<CivicType>CIVIC_CHIEFDOM</CivicType>
				<CivicType>CIVIC_OLIGARCHY</CivicType>
				<CivicType>CIVIC_TRIBAL</CivicType>
				<CivicType>CIVIC_BARTER</CivicType>
				<CivicType>CIVIC_FOLKLORE</CivicType>
				<CivicType>CIVIC_SURVIVAL</CivicType>
				<CivicType>CIVIC_NOTHING</CivicType>
				<CivicType>CIVIC_BANDITS</CivicType>
				<CivicType>CIVIC_NONE</CivicType>
			</InitialCivics>

Should I leave out the military and ideology civics?

No, sorry, bad explanation. You don't need the initial civics XML at all any more. Just delete it. I meant that the CIVIC_NOTRASH should be first in the order in the Civ4CivicInfos file.
 
Wait so I don't need Garbage_CIV4CivilizationInfos anymore?

I am so confused on what I need to do. Please explain.

You still need everything that is in the Ideology folder, except the Civilization Infos and Civilization Schema.
 
Back
Top Bottom