• 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

@Afforess

Ok I am having trouble with the following (in red) ...

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


How do I do those?

EDIT: Can you take a look. For some reason all my civic stats are combining into one single civic.

*Attachment removed*
 
As for the entries all merging together, it is because you are creating the same civic over and over again:
Code:
<Type>CIVIC_NONE</Type>

Look at the Ideology Civics. They each have a unique type.

For the other traits, look for civics that do similar things already, and cut-n-paste the code from them.
 
Ah ok.

However I could not find any that had "Slower City growth". Is it called something else? Note I am going by your post about the civics.

In short I pretty much used other examples to get what I filled in so far. But could not find examples for the ones in red.

Note that I could find an example for "50% Faster Construction of Landfill" however I am wondering if it will give an error since the landfill is part of the NIMBY mod. If someone doesn't use NIMBY will it give them an error? What should I do?

I also found a possible example for the "-1 Commerce from all water tiles" using the lighthouse however will it work for civics too?

As for "-1 Diplomacy "You take advantage of other countries!"" I have no idea that you can even do this? Please give me an example.
 
Okay, for the terrain there are no examples because I never used it, but did code it. Here is the XML:


Code:
			<TerrainYieldChanges>
				<TerrainYieldChange>
					<TerrainType>TERRAIN_PLAINS</TerrainType>
					<TerrainYields>
						<iYield>0</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</TerrainYields>
				</TerrainYieldChange>
			</TerrainYieldChanges>

For Diplomacy Attitude changes, check the Civic Diplomacy mod XML, it looks like this:

Code:
			<CivicAttitudeChanges>
				<CivicAttitudeChange>
					<CivicType>CIVIC_HEREDITARY_RULE</CivicType>
					<iAttitudeChange>1</iAttitudeChange>
					<Description>TXT_KEY_CIVIC_ATTITUDE_MONARCHY_TO_MONARCHY</Description>
				</CivicAttitudeChange>
			</CivicAttitudeChanges>

Warning: MAKE SURE YOU LOOK AT ONE OF THE TEXT ENTRIES USED IN CIVIC DIPLOMACY! They are different than normal.

Slower growth is the same tag as buildings, <iPopulationgrowthratepercentage>, you should be able to copy and paste that. See the Better RoM slavery civic for an example.

Don't worry about things that players may or may not be using yet (e.g NIMBY stuff). We will worry about that when you get everything working.
 
Okay, for the terrain there are no examples because I never used it, but did code it. Here is the XML:


Code:
			<TerrainYieldChanges>
				<TerrainYieldChange>
					<TerrainType>TERRAIN_PLAINS</TerrainType>
					<TerrainYields>
						<iYield>0</iYield>
						<iYield>0</iYield>
						<iYield>0</iYield>
					</TerrainYields>
				</TerrainYieldChange>
			</TerrainYieldChanges>

What are the types of terrain? Also is a coast called TERRAIN_COAST or TERRAIN_SHALLOWS or something else?

EDIT: I found it ...


TERRAIN_SHELF = Coast
TERRAIN_OCEAN = Ocean


EDIT2: Ok so the shelf did not work. Weird.
 
@Afforess

Arg.. Ok I put in this (from the lighthouse)...

Code:
			<SeaPlotYieldChanges>
				<iYield>0</iYield>
				<iYield>0</iYield>
				<iYield>-1</iYield>
			</SeaPlotYieldChanges>
and then got this error

4506603840_84c69edfed_o.jpg


Where can I get an updated schema for it?
 
You can't use Sea Plot Yield Changes. I gave you the correct code above. Look in the Civ4TerrainInfos for the name of the coastal terrain.
 
@Afforess

My image icons are not showing up. This is what I put for the code.

Code:
<Button>,Modules/Hydro/Garbage/Art/trashsea.dds,Art/Interface/Buttons/RoM_Civic_Atlas.dds,7,4</Button>

Should this part be diffrent?

Code:
Art/Interface/Buttons/RoM_Civic_Atlas.dds

Also what's the 2 numbers mean?

Code:
7,4

I have noticed each is diffrent for the ideology code. But how do you know what to use? Here are some examples ...

Code:
<Button>,Modules/Afforess/Ideology Civics/Art/Objectivism.dds,Modules/Afforess/Required/Afforess_Atlas.dds,6,11</Button>

<Button>,Modules/Afforess/Ideology Civics/Art/Individualism.dds,Modules/Afforess/Required/Afforess_Atlas.dds,8,7</Button>

<Button>,Modules/Afforess/Ideology Civics/Art/Capitalism.dds,Modules/Afforess/Required/Afforess_Atlas.dds,4,2</Button>

<Button>,Modules/Afforess/Ideology Civics/Art/Centrism.dds,Modules/Afforess/Required/Afforess_Atlas.dds,6,2</Button>

<Button>,Modules/Afforess/Ideology Civics/Art/Egalitarianism.dds,Modules/Afforess/Required/Afforess_Atlas.dds,4,4</Button>

<Button>,Modules/Hydro/Garbage/Art/landfills.dds,Art/Interface/Buttons/RoM_Civic_Atlas.dds,7,4</Button>

<Button>,Modules/Afforess/Ideology Civics/Art/Progressivism.dds,Modules/Afforess/Required/Afforess_Atlas.dds,7,12</Button>

<Button>,Modules/Afforess/Ideology Civics/Art/Socialism.dds,Modules/Afforess/Required/Afforess_Atlas.dds,4,14</Button>
 
Just use the button path like you do for your buildings. I did it differently for ideology's, because I was referencing an atlas file (Basically, a file with 50 or so buttons in it). Just remove all that, and reference the buttons like you always have.
 
@Afforess

Ok most things are working now except for the following ...

For Diplomacy Attitude changes, check the Civic Diplomacy mod XML, it looks like this:

Code:
			<CivicAttitudeChanges>
				<CivicAttitudeChange>
					<CivicType>CIVIC_HEREDITARY_RULE</CivicType>
					<iAttitudeChange>1</iAttitudeChange>
					<Description>TXT_KEY_CIVIC_ATTITUDE_MONARCHY_TO_MONARCHY</Description>
				</CivicAttitudeChange>
			</CivicAttitudeChanges>

Warning: MAKE SURE YOU LOOK AT ONE OF THE TEXT ENTRIES USED IN CIVIC DIPLOMACY! They are different than normal.

I am not quite understanding the dipomacy code. How do you just make it so i can get ...

-1 Diplomacy; "Your polluting the ocean!"

and

-1 Diplomacy "You take advantage of other countries!"

Do you have to have an opposite civic? Such as all with "Waste in Sea" get +1 diplomacy while those with other civics get -1 diplomacy? If so which ones should go to which? Or can you have it negative to everything no matter if the other civ has "Waste in Sea" civic?

Don't worry about things that players may or may not be using yet (e.g NIMBY stuff). We will worry about that when you get everything working.

I could not find an example for ...

50% Faster Construction of Landfill

However I could find ones for + Health with x building or + Happy with x building. How do I do double construction for the Landfill building?
 
Let me break it down for you. Here is the code for the Monarchy civic effect:
Code:
			<CivicAttitudeChanges>
				<CivicAttitudeChange>
					<CivicType>CIVIC_HEREDITARY_RULE</CivicType>
					<iAttitudeChange>1</iAttitudeChange>
					<Description>TXT_KEY_CIVIC_ATTITUDE_MONARCHY_TO_MONARCHY</Description>
				</CivicAttitudeChange>
			</CivicAttitudeChanges>

And the corresponding text entry:

Code:
	<TEXT>
		<Tag>TXT_KEY_CIVIC_ATTITUDE_MONARCHY_TO_MONARCHY</Tag>
		<English>%D1_AttitudeChange: "Royalty should work together"</English>
		<French>%D1_AttitudeChange: "Royalty should work together"</French>
		<German>%D1_AttitudeChange: "Royalty should work together"</German>
		<Italian>%D1_AttitudeChange: "Royalty should work together"</Italian>
		<Spanish>%D1_AttitudeChange: "Royalty should work together"</Spanish>
	</TEXT>

The first part, <CivicType> tells the game which civic that this civic will cause an effect towards. It can be any civic, even itself, which is the case here. The next value is an integer, the attitude change that occurs. The last part is a reference to TXT_KEY, which should describe to players why this effect is going on.

As for the text key, the %D1_AttitudeChange is a variable. It will take the value of the iAttitudeChange you set in the XML. If you set a -3 in the XML, it will appear as -3: in game. The rest is just the description.

For the faster construction, look in the Better RoM Civics module for that effect.
 
4506381573_7092f9f63d_o.jpg


Ok I got the landfill construction to work however I am not sure if this is backwards from what its suppose to be. Did I do it right by putting all the -1 diplomacy under one civic or should it be spread out over each civic?

You aren't thinking about it quite correctly. Imagine 2 players. Player 1 is using the garbage civic shown in the screenshot. Player 2 is using Waste to Sea. Player 1 will have -1 diplomacy with Player 2. Player 2 will have no diplomacy changes with player 1.
 
@Afforess

Yay! I finally got this working! Seems like I got all the bugs out. I put the file in my main thread for you to download and put into the next AND update.

Hydro's Mods for AND
http://forums.civfanatics.com/showthread.php?t=355061

That was way too difficult for something that was suppose to be so simple. Well at least I learned from it. Thanks for all your help Affforess.
 
That was way too difficult for something that was suppose to be so simple. Well at least I learned from it. Thanks for all your help Affforess.

Yeah, Civics are pretty different. They require a lot more thought and work than buildings. Fortuantly, you don't need to make them as often. Also, the second time around is a lot easier.
 
Yeah I was thinking of maybe doing the Energy Civic in the future too.

I am not in the mood to make them but I did have some ideas for possible civic buildings for my Garbage Mod.

- Garbage Anywhere = Bonfire
- Waste to Sea = Garbage Docks
- Landfill = ?
- Waste Exportation = Waste Exportation Center
- Waste Importation = Waste Importation Center
- Off-Planet Dumping = Garbage Launch Pad
- Waste to Energy = ?

But really we probably don't need civic buildings for this civic. But feel free to add buildings for it if you feel inspired too. Same goes for tweaking the civics since I just used your stats anyways. In short this was more about me learning how to make a civic mod than the mod itself.
 
Back
Top Bottom