Newbie Idiot Request: Help Creating First Ever Civ

Meaniehead

Chieftain
Joined
Oct 30, 2016
Messages
41
Hey all, I'm a complete newbie at creating mods, so if y'all don't have time for someone who's not even sure what questions to ask I understand. On the other hand, if you can help a newbie idiot I'd be really grateful. Anyhow, I'm creating my first mod - a Civ for Yorkshire (which is actually a single county in England but with a chip on our shoulder larger than that of Texas probably). It's meant to be a little tongue-in-cheek but ultimately very playable. However, being a complete novice at this, I'm having several problems already.

I'm using the excellent Pech civilization as a skeleton, because it seems to have a number of items in it that are similar to, though different from, things I need for my Yorkshire civ. This includes modified plot resources, modified buildings, modified units etc. Right now, I'm working on the Yorkshire trait "Where There's Muck There's Brass" which adds +1 Gold to the resource production improvements that are/were common in Yorkshire (Fishing Boats, Farms, Pastures, Quarries and Mines). I've tried adding 1 improvement at a time and found some work while others don't.

This works (or at least seems to):*

INSERT INTO TraitModifiers
( TraitType, ModifierId ) VALUES
( 'TRAIT_CIVILIZATION_JUNGLE_RICHES', 'TRAIT_PASTURE_BONUS_GOLD_YIELD' ),
( 'TRAIT_CIVILIZATION_JUNGLE_RICHES', 'TRAIT_QUARRY_BONUS_GOLD_YIELD' ),
( 'TRAIT_CIVILIZATION_JUNGLE_RICHES', 'TRAIT_MINE_BONUS_GOLD_YIELD' );


INSERT INTO Modifiers
( ModifierId, ModifierType, RunOnce, Permanent, SubjectRequirementSetId ) VALUES
( 'TRAIT_PASTURE_BONUS_GOLD_YIELD', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', '0', '0', 'PLOT_HAS_PASTURE_REQUIREMENTS' ),
( 'TRAIT_QUARRY_BONUS_GOLD_YIELD', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', '0', '0', 'PLOT_HAS_QUARRY_REQUIREMENTS' ),
( 'TRAIT_MINE_BONUS_GOLD_YIELD', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', '0', '0', 'PLOT_HAS_MINE_REQUIREMENTS' );


INSERT INTO ModifierArguments
( ModifierId, Name, Value ) VALUES
( 'TRAIT_PASTURE_BONUS_GOLD_YIELD', 'YieldType', 'YIELD_GOLD' ),
( 'TRAIT_PASTURE_BONUS_GOLD_YIELD', 'Amount', '1' ),
( 'TRAIT_QUARRY_BONUS_GOLD_YIELD', 'YieldType', 'YIELD_GOLD' ),
( 'TRAIT_QUARRY_BONUS_GOLD_YIELD', 'Amount', '1' ),
( 'TRAIT_MINE_BONUS_GOLD_YIELD', 'YieldType', 'YIELD_GOLD' ),
( 'TRAIT_MINE_BONUS_GOLD_YIELD', 'Amount', '1' );

However, if I try to check for PLOT_HAS_FARM_REQUIREMENTS or PLOT_HAS_FISHING_BOATS requirements instead of one of these improvements the game fails to start and just returns me to the main civ 6 screen. I've made sure that it's not to do with having too many checks on one "insert into" command by just changing each occurrence of PASTURE to FARM (for instance). But it still crashes back to main screen. Can anyone tell me what I'm doing wrong.


Linked to this, Yorkshire has a unique improvement, ILKLA MOOR (Ilkey/Ilkla Moor being a moorland made famous in the unofficial Yorkshire county anthem "On Ilkla Moor Bar T'At"). Basically this represents cultivating an area of the moorland (on grass, with or without hills) to provide food, culture and housing (representing rough grazing land, heritage and villages dotted around it). This works, but I'm also hoping to do 2 more things with it - first, ensure that Ilkla Moor remains contiguous (must be built next to another area of Ilkla Moor) which I don't know how to do; and second, have each leader modify the yield further (Paulinus, 1st bishop of York would add a faith yield for instance) which I'm not sure is even possible. Any advice?

Any help you can give will be vastly appreciated.

*Yes, I am aware that my civilization specific variables still bear the names from the original civ (Thanks again to the creator for this fine work). I will change those when I have the civ actually functional. If there's one thing I learned in my days as a programmer (20+ years ago) it's that changing too much at once on code you don't know dooms you to failure and being unable to solve anything.
 
OK, just to add a weird one that I've only just started investigating...

I added York Minster as a Palace replacement for this civ. Now, whether I play the civ or not, or even select them as a civ in the game or leave them out, EVERY SINGLE CIV gets York Minster in addition to the Palace. Not sure why it's being selected for everyone. I wonder if you can't replace the palace.
 
PLOT_HAS_FISHINGBOATS_REQUIREMENTS for Fishing Boats.
You will have to create one for Farms. Or take my Requirement Sets from ToT which has PLOT_HAS_IMPROVEMENT_FARM defined or PLOT_HAS_ADJACENT_FARM.
 
OK, just to add a weird one that I've only just started investigating...

I added York Minster as a Palace replacement for this civ. Now, whether I play the civ or not, or even select them as a civ in the game or leave them out, EVERY SINGLE CIV gets York Minster in addition to the Palace. Not sure why it's being selected for everyone. I wonder if you can't replace the palace.
You would need to define that via a Trait.
 
Thank you Horem, this gives me something to investigate further. Really appreciate the help.
 
And... I finally found the problem with my York Minster being available to every civilization. I used the Capital="true" flag to try to mirror the fact that the palace (which I aim to replace with it for one leader of this civ) can only be placed in the Capital city. Taking this flag away does mean that the Minster isn't built automatically but is only available for this one civilization. Ultimately, that's not a terrible loss if I put a mere token cost on it meaning it is built on turn one but could, theoretically, be placed in a different city. It leaves the palace intact and merely adds the option for rapid religion.
 
Capital="true" is probably being used in the same way it was in civ5. Any building that has this makes the city where the building is constructed into the empire capital.

But civ5 also had a table to designate which buildings should be given for free in the original capital, whereas civ6 does not have this table. So Capital="true" may also be signalling to the game to add the building to a player's capital or at least to the player's original capital.
 
Which is what I wanted, but it designates it to be added to EVERY civ's capital for free. Taking this flag out limits it to the Yorkshire civ. Very strange...
 
Below, is what I'm running at the moment. It allows the Minster to be created in 1 turn, since it's only a token cost, limits it to only the one civilization that it's defined for, but doesn't autobuild it in the capital. (Please ignore White Walls, they're from the original Pech civilization and will be removed as I go forward).

----------
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
<Types>
<Row Type="BUILDING_TEMPLE_OF_THE_MONKEY_GOD" Kind="KIND_BUILDING"/>
<Row Type="BUILDING_WHITE_WALLS" Kind="KIND_BUILDING"/>
</Types>
<BuildingReplaces>
<Row CivUniqueBuildingType="BUILDING_WHITE_WALLS" ReplacesBuildingType="BUILDING_WALLS"/>
</BuildingReplaces>
<Buildings>
<Row BuildingType="BUILDING_TEMPLE_OF_THE_MONKEY_GOD" Name="LOC_BUILDING_TEMPLE_OF_THE_MONKEY_GOD_NAME" Description="LOC_BUILDING_TEMPLE_OF_THE_MONKEY_GOD_DESCRIPTION" PrereqDistrict="DISTRICT_CITY_CENTER" Cost="1" AdvisorType="ADVISOR_GENERIC" Housing="1" Entertainment="1" MaxPlayerInstances="1" TraitType="TRAIT_CIVILIZATION_BUILDING_TEMPLE_OF_THE_MONKEY_GOD"/>
<Row BuildingType="BUILDING_WHITE_WALLS" Name="LOC_BUILDING_WHITE_WALLS_NAME" Description="LOC_BUILDING_WHITE_WALLS_DESCRIPTION" PrereqTech="TECH_MASONRY" PrereqDistrict="DISTRICT_CITY_CENTER" Cost="60" AdvisorType="ADVISOR_GENERIC" Maintenance="0" OuterDefenseHitPoints="50" OuterDefenseStrength="2" TraitType="TRAIT_CIVILIZATION_BUILDING_WHITE_WALLS"/>
</Buildings>
<Building_YieldChanges>
<Row BuildingType="BUILDING_TEMPLE_OF_THE_MONKEY_GOD" YieldType="YIELD_FAITH" YieldChange="2"/>
</Building_YieldChanges>
<Building_GreatPersonPoints>
<Row BuildingType="BUILDING_TEMPLE_OF_THE_MONKEY_GOD" PointsPerTurn="1" GreatPersonClassType="GREAT_PERSON_CLASS_PROPHET"/>
</Building_GreatPersonPoints>
<Building_GreatWorks>
<Row BuildingType="BUILDING_TEMPLE_OF_THE_MONKEY_GOD" NumSlots="1" GreatWorkSlotType="GREATWORKSLOT_RELIC"/>
</Building_GreatWorks>

</GameInfo>

----------

Now, if I add 'Capital="true" to the Building Type row it autobuilds the Minster (marked here with the original civ's variable "Temple of the Monkey God") for every civ in the game, whether Yorkshire is actually an extant civ in a game or not.
 
By the way, since you're still following along, Horem, I wanted to publicly thank you. I now have a functional Ilkla Moor checking for all improvements I need. Not sure what the currency of gratitude is round here but bro-hugs, high five, kudos and anything else.
 
Did you have table entries for <Traits>, <CivilizationTraits>, <BuildingReplaces> in your
Code:
<Components>
	<UpdateDatabase id="xxxx">
		<Items>
			<File>Filenname1.xml</File>
		</Items>
	</UpdateDatabase>
</Components>
And did you have a <PlayerItems>in your
Code:
<Settings>
	<Custom id="yyyyyyyyy">
		<Items>
			<File>Filenname2.xml</File>
		</Items>
	</Custom>
</Settings>
xml-files ?
 
Sorry for the delay, as I say complete moronic newbie here and haven't even been sure which file they would be in. So took me a while to search, also worked (somewhat successfully) on other parts of the civ. I think they're split through several files. The original civ's author (original civ being Pech, on this here site - btw: if ever I get this working I hope s/he and you two don't mind me crediting you all for the help received when I upload) set up files for:


<File>Data/Pech.sql</File>
<File>Data/Pech_Buildings.xml</File>
<File>Data/Pech_Civilizations.xml</File>
<File>Data/Pech_Colours.xml</File>
<File>Data/Pech_Gossip.xml</File>
<File>Data/Pech_Improvements.xml</File>
<File>Data/Pech_Leaders.xml</File>
<File>Data/Pech_PlayerColours.xml</File>
<File>Data/Pech_Units.xml</File>


All of which seem, at least to me, to be meaningful file names. My York Minster building is still labelled with the original civ's variable (though functioning rather differently) of "Temple_of_the_Monkey_God".

in Pech_Civilizations the following are defined:

<Traits>
<Row TraitType="TRAIT_CIVILIZATION_BUILDING_TEMPLE_OF_THE_MONKEY_GOD" Name="LOC_BUILDING_TEMPLE_OF_THE_MONKEY_GOD_NAME" Description="LOC_BUILDING_TEMPLE_OF_THE_MONKEY_GOD_DESCRIPTION"/>
</Traits>


and

<CivilizationTraits>
<Row CivilizationType="CIVILIZATION_PECH" TraitType="TRAIT_CIVILIZATION_BUILDING_TEMPLE_OF_THE_MONKEY_GOD"/>
</CivilizationTraits>

In Pech_Buildings there is:
<BuildingReplaces>
<Row CivUniqueBuildingType="BUILDING_TEMPLE_OF_THE_MONKEY_GOD" ReplacesBuildingType="BUILDING_PALACE"/>
</BuildingReplaces>

The Items file is Pech_Config.xml which contains
<PlayerItems>
<Row CivilizationType="CIVILIZATION_PECH" LeaderType="LEADER_WATA" Type="BUILDING_TEMPLE_OF_THE_MONKEY_GOD" Icon="ICON_BUILDING_TEMPLE" Name="LOC_BUILDING_TEMPLE_OF_THE_MONKEY_GOD_NAME" Description="LOC_BUILDING_TEMPLE_OF_THE_MONKEY_GOD_DESCRIPTION" SortIndex="20" />
</PlayerItems>


So I think all items you asked about are indeed covered. I should note that the building exists and functions as I intend (though since the idea is to grant earliest religion I might up the prophet points a little to counter someone rushing Stonehenge). However, it must be built and does not replace the Palace. I've just run a quick test where I change the 'ReplacesBuildingType="BUILDING_PALACE"' to 'ReplacesBuildingType="BUILDING_MONUMENT"'. If I do this, York Minster (Monkey God) does indeed replace the monument. I think that means there's something weird about the Palace building, but maybe I'm thinking wrong.
 
sigh

It would appear there is hardcoding somewhere to specifically do Building_Palace and nothing else for the civ's seat of government building.

There is however this
Code:
	<ModifierArguments>
		<Row>
			<ModifierId>TRAIT_EXTRA_PALACE_SLOTS</ModifierId>
			<Name>BuildingType</Name>
			<Value>BUILDING_PALACE</Value>
		</Row>
		<Row>
			<ModifierId>TRAIT_EXTRA_PALACE_SLOTS</ModifierId>
			<Name>GreatWorkSlotType</Name>
			<Value>GREATWORKSLOT_PALACE</Value>
		</Row>
		<Row>
			<ModifierId>TRAIT_EXTRA_PALACE_SLOTS</ModifierId>
			<Name>Amount</Name>
			<Value>4</Value>
		</Row>
	</ModifierArguments>
Which ties into this
Code:
	<Modifiers>
		<Row>
			<ModifierId>TRAIT_EXTRA_PALACE_SLOTS</ModifierId>
			<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_GREAT_WORK_SLOTS</ModifierType>
		</Row>
	</Modifiers>
	<TraitModifiers>
		<Row>
			<TraitType>TRAIT_CIVILIZATION_NKISI</TraitType>
			<ModifierId>TRAIT_EXTRA_PALACE_SLOTS</ModifierId>
		</Row>
	</TraitModifiers>
	<Traits>
		<Row TraitType="TRAIT_CIVILIZATION_NKISI" Name="LOC_TRAIT_CIVILIZATION_NKISI_NAME" Description="LOC_TRAIT_CIVILIZATION_NKISI_DESCRIPTION"/>
	</Traits>
	<CivilizationTraits>
		<Row CivilizationType="CIVILIZATION_KONGO" TraitType="TRAIT_CIVILIZATION_NKISI"/>
	</CivilizationTraits>
Not sure if I caught all the usages in all the tables. But it allows changes to the standard Palace for a specific player. It would be a question as to whether a different <ModifierType> exists that would accomplish your original goal. @Horem has a better grasp on all that atm than I do, to be honest.
 
OK, what you've found there is very much what I was starting to suspect. I think, at this point, rather than get hung up on making York Minster my palace I'll keep it with 1 max usage, city center and a token cost for a one-turn build. That way, it allows someone to rush religion if they want (which would make sense if playing Paulinus) or just to get a little extra help in a second or even third city. Thanks again for all your assistance here. I'll move on to other bits. I still have to make Paulinus function at all (I need to limit the Minster to him rather than other Yorkshire leaders and try to make him add +1 faith yield to my Ilkla Moor achievement).
 
Ooh, I just realized one important update I need to make on it - a GP should be able to start a religion on a City Center that has York Minster in case someone gets religion before building a holy site.
 
*sigh* Asking for help again... I had things almost where I wanted them for a basic civ to work. So I went through to correct variable and file names from those of the original mod. Got 90% of them done and moved on to updating filenames and variables using the civ name text itself (changing Pech/PECH to Yorkshire/YORKSHIRE). Suddenly, the game shoves me back to load screen when I try to start with Paulinus (the first leader created for this civilization). I've looked at the database log file and it is throwing an error:

[3010511.288] [Gameplay] ERROR: FOREIGN KEY constraint failed
[3010511.289] [Gameplay] ERROR: FOREIGN KEY constraint failed
[3010511.289] [Gameplay]: Validating Foreign Key Constraints...
[3010511.299] [Gameplay] ERROR: Invalid Reference on CivilizationTraits.CivilizationType - "CIVILIZATION_PECH" does not exist in Civilizations
[3010511.333] [Gameplay]: Failed Validation.

This has me completely baffled. So far as I can see NOTHING references PECH at all in my mod now. Going by the opening of my Yorkshire_Civilizations.xml file, CivilizationTraits and CivilizationType are both now defined for Yorkshire...


<Types>
<Row Type="CIVILIZATION_YORKSHIRE" Kind="KIND_CIVILIZATION"/>
<Row Type="TRAIT_CIVILIZATION_MUCK_BRASS" Kind="KIND_TRAIT" />
<Row Type="TRAIT_CIVILIZATION_BUILDING_YORK_MINSTER" Kind="KIND_TRAIT" />
</Types>
<Civilizations>
<Row CivilizationType="CIVILIZATION_YORKSHIRE" Name="LOC_CIVILIZATION_YORKSHIRE_NAME" Description="LOC_CIVILIZATION_YORKSHIRE_DESCRIPTION" Adjective="LOC_CIVILIZATION_YORKSHIRE_ADJECTIVE" StartingCivilizationLevelType="CIVILIZATION_LEVEL_FULL_CIV" RandomCityNameDepth="3" Ethnicity="ETHNICITY_SOUTHAM"/>
</Civilizations>
<CivilizationLeaders>
<Row CivilizationType="CIVILIZATION_YORKSHIRE" LeaderType="LEADER_PAULINUS" CapitalName="York"/>
</CivilizationLeaders>
<Traits>
<Row TraitType="TRAIT_CIVILIZATION_MUCK_BRASS" Name="LOC_TRAIT_CIVILIZATION_MUCK_BRASS_NAME" Description="LOC_TRAIT_CIVILIZATION_MUCK_BRASS_DESCRIPTION"/>
</Traits>
<CivilizationTraits>
<Row CivilizationType="CIVILIZATION_YORKSHIRE" TraitType="TRAIT_CIVILIZATION_MUCK_BRASS"/>
</CivilizationTraits>



Can anyone help me work out just where things are going wrong? I'm at a loss as to where to look next at this point.
 
Top Bottom