Custom Civ's District and Unit having errors

MisterChau

Chieftain
Joined
Feb 20, 2017
Messages
6
I'm having trouble making my custom civ's district and units work.

The Unique District is the "Ecole du Coeur" which replaces the Campus. It seems to have a problem with the adjacency yield. Like the Acropolis in the game, I want it to have +2 its yield (Science) from being adjacent to the City Center (+1 from it being the City Center and +1 from the fact that the CC is a district) which doesn't seem to have a problem since I used the same ModifierId as the Acropolis but changed the yield to Science instead (hoping it works). However, I'm having problems getting the Ecole du Coeur to get +1 Science from adjacent districts (instead of +1 Science from every 2 adjacent districts) also like the Acropolis. "LOC_DISTRICT_DISTRICT_SCIENCE" is what the Campus uses in the Districts.xml and I changed the "TilesRequired" from 2 to 1, and maybe the game doesn't like that, but I'm not sure what I should change the ModifierId and everything else to then. Another part (haven't gotten to) of the Ecole I want to add is that it gains +1 GPP for the adjacent district (so if I placed the Ecole adjacent to an Industrial Zone, the Ecole will produce +1 Great Engineer point alongside its own Great Scientist points) but I have no idea how to do that so if you know how I'd really appreciate the help, but the main thing I need help with at the moment is getting the adjacency to work.

The Unique Unit is the "Pneuman" which replaces the Swordsman. I want it to have +50% Support Bonuses (like the Hypaspists) which the game doesn't see a problem with it seems. However, the game seems to see an error in the second part. I want it to have +10 Combat Strength in territory that does not belong to the player so I copied the Digger's ability essentially from the UnitAbilities.xml taking all the requirements and all such as the "NON_DOMESTIC" parts. The game senses an error in this, and I'll be honest I don't know how to get it to work at all since the most I've done with modded units is change their combat strength and never done anything like checking the unit's position and ownership.

I also don't know what the invalid references to traits are about ("ERROR: Invalid Reference on Districts.TraitType - "TRAIT_CIVILIZATION_DISTRICT_ECOLE_DU_COEUR" does not exist in Traits" and "ERROR: Invalid Reference on Units.TraitType - "TRAIT_CIVILIZATION_UNIT_PNEUMAN" does not exist in Traits"). I assumed these errors pop up because there are errors within the District and Unit themselves and so the game couldn't properly read them. I looked over all the files and believe that I defined both "TRAIT_CIVILIZATION" parts but if I haven't or put it in the wrong spot then I will correct it.

Here is the database.log I am getting.
Spoiler Database.log :

[2208005.559] [Localization]: StartupErrorMessages.xml
[2208005.559] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[2208009.004] [Localization]: Validating Foreign Key Constraints...
[2208009.005] [Localization]: Passed Validation.
[2208009.014] [Configuration]: Validating Foreign Key Constraints...
[2208009.014] [Configuration]: Passed Validation.
[2208020.042] [FullTextSearch]: Initializing FullTextSearch
[2208020.551] [Gameplay]: Validating Foreign Key Constraints...
[2208020.564] [Gameplay]: Passed Validation.
[2208021.830] [Configuration]: Validating Foreign Key Constraints...
[2208021.831] [Configuration]: Passed Validation.
[2208060.591] [FullTextSearch]: FTS - Creating Context
[2208064.343] [FullTextSearch]: FTS - Creating Context
[2208066.916] [Configuration]: Validating Foreign Key Constraints...
[2208066.916] [Configuration]: Passed Validation.
[2208068.060] [Configuration]: Validating Foreign Key Constraints...
[2208068.061] [Configuration]: Passed Validation.
[2208074.506] [Configuration]: Validating Foreign Key Constraints...
[2208074.506] [Configuration]: Passed Validation.
[2208077.487] [Gameplay] ERROR: UNIQUE constraint failed: Adjacency_YieldChanges.ID
[2208077.487] [Gameplay]: While executing - 'insert into Adjacency_YieldChanges('Description', 'YieldType', 'YieldChange', 'TilesRequired', 'ID', 'OtherDistrictAdjacent') values (?, ?, ?, ?, ?, ?);'
[2208077.487] [Gameplay]: In XMLSerializer while inserting row into table insert into Adjacency_YieldChanges('Description', 'YieldType', 'YieldChange', 'TilesRequired', 'ID', 'OtherDistrictAdjacent') with values (LOC_DISTRICT_DISTRICT_SCIENCE, YIELD_SCIENCE, 1, 1, District_Science, 1, ).
[2208077.487] [Gameplay]: In XMLSerializer while updating table Adjacency_YieldChanges from file Orphic_Gameplay_Districts.xml.
[2208077.487] [Gameplay] ERROR: UNIQUE constraint failed: Adjacency_YieldChanges.ID
[2208077.489] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
[2208077.489] [Gameplay]: While executing - 'insert into Types('Kind', 'Type') values (?, ?);'
[2208077.489] [Gameplay]: In XMLSerializer while inserting row into table insert into Types('Kind', 'Type') with values (KIND_TRAIT, TRAIT_CIVILIZATION_UNIT_PNEUMAN, ).
[2208077.489] [Gameplay]: In XMLSerializer while updating table Types from file Orphic_Gameplay_Traits.xml.
[2208077.489] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
[2208077.491] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[2208077.491] [Gameplay]: While executing - 'insert into Modifiers('ModifierId', 'ModifierType', 'SubjectRequirementSetId') values (?, ?, ?);'
[2208077.491] [Gameplay]: In XMLSerializer while inserting row into table insert into Modifiers('ModifierId', 'ModifierType', 'SubjectRequirementSetId') with values (DIGGER_NON_DOMESTIC_BONUS, MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH, DIGGER_NON_DOMESTIC_PLOT_REQUIREMENTS, ).
[2208077.491] [Gameplay]: In XMLSerializer while updating table Modifiers from file Orphic_Gameplay_Units.xml.
[2208077.491] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[2208077.533] [Gameplay] ERROR: FOREIGN KEY constraint failed
[2208077.533] [Gameplay] ERROR: FOREIGN KEY constraint failed
[2208077.533] [Gameplay]: Validating Foreign Key Constraints...
[2208077.537] [Gameplay] ERROR: Invalid Reference on Districts.TraitType - "TRAIT_CIVILIZATION_DISTRICT_ECOLE_DU_COEUR" does not exist in Traits
[2208077.551] [Gameplay] ERROR: Invalid Reference on Units.TraitType - "TRAIT_CIVILIZATION_UNIT_PNEUMAN" does not exist in Traits
[2208077.553] [Gameplay]: Failed Validation.
[2208079.965] [Configuration]: Validating Foreign Key Constraints...
[2208079.965] [Configuration]: Passed Validation.
[2208080.463] [FullTextSearch]: FTS - Creating Context
[2208087.607] [FullTextSearch]: FullTextSearch - Shutting down


Below I've attached the entire civilization files (proj and all) as a .zip file. You'll notice that I don't have certain .artdefs because I haven't gotten to the model parts or anything, so if that affects whether or not these will work then do tell. I don't mind it being invisible at the moment, but I do want to make sure the coding and traits part actually work. I apologize for such long texts. I don't post on the Civfanatics forum often and this is my first call for help since I haven't found a very extensive / step by step guide on making a modded civilization like Kael's guide for Civ 5.
 

Attachments

Here you have it fixed.
1. You have tried to define an already existing object (multiple times) - main problems were here.
2. One Trait was not entered into Traits.
3. Still missing modifiers for Trait for different GPs.
4. Oh, and there was a typo also somewhere.
 

Attachments

Thanks for looking over the files and writing down all those notes, I really appreciate the time taken to look over all the files! I am now able to launch the game properly with no database.log errors. However, some aspects don't work as intended and I don't know if it would be possible to do these.

1. The Ecole du Coeur has the ModifierId of the Acropolis' Culture from City Center. Previously I had tried changing the yields themselves, but as you pointed out I could not do that since the ModifierId was already defined. If I want to have it gain Science instead of Culture, do I have to make a new ModifierId entirely (with the corresponding Adjacency_YieldChanges) or is that not possible?
2. The civilization ability (Social Link) doesn't seem to work when I checked in game. The yield "modifier" portion in game should be 15% but I do not see that when I hover over the yield so I don't think it's working properly. It's the part in the traits where the ModifierId="KILWA_PLAYERCITIES". Since the ModifierId was originally linked to a Wonder (Kilwa Kisiwani) I don't know if there's a way for the game to actually give the bonuses to my civ as part of its trait. Would I have to make a dummy building for my civ and then put all the modifiers on that instead to simulate the effects of Kilwa as part of the ability?
3. The leader ability (Fool Arcana) doesn't work in game. Similar issue to the civilization ability, I took the "MODIFIER_PLAYER_GRANT_BOOST_WITH_GREAT_PERSON" from a wonder (Great Library) but instead of getting a Eureka every time another player gets a Great Scientist I am trying to make it so I get a Eureka whenever I get a Great Engineer, Merchant, or Scientist. Same question as the civ ability, would I have to make a dummy building to simulate these effects? Also, as far as I could tell, there was no Civic equivalent to "<Name>TechBoost</Name> for getting an Inspiration whenever a Great Writer, Artist, or Musician is recruited. I'm thinking I could try using the "MODIFIER_PLAYER_GRANT_RANDOM_CIVIC_BOOST_GOODY_HUT" that Alexander the Great uses but I'm not sure how to make that trigger when a Great Person is recruited instead of when I conquer a city with a Holy Site or Theater Square.
4. The unit (Pneuman) gets the bonus, but it's +5 Combat Strength instead of +10. Since it's taken straight from the Digger who already has a defined bonus, I don't think I could change the yield directly. Anyway to fix this part?

I attached the second version of the custom civ with all the changes you took note of and where I (tried) to get more parts of the civ functioning. No crashes or anything, but still not 100% there yet. Most of the changes were to the Traits, Districts, and Units in the Data folder. This one has multiple issues so I felt it necessary to post the whole thing. However, if it's easier for anyone wanting to help I can start posting the actual code in spoiler tags instead of uploading the entire project each time.
 

Attachments

You need to know more about modifiers and how they work. Copying or reusing existing ones isn't enough if you want your own effects. There are guides about modifiers here on CF, also I suggest you try to use my Better Civilopedia to see how the modifiers are constructed to better understand how they work.
And if you want to reuse something with different parameters, you need to make a copy with a different unique name usually.
 
Back
Top Bottom