Newbie Idiot Request: Help Creating First Ever Civ

You can also directly attach a zip folder to a post, or provide a link to a dropbox address directly in a post, as well.

Just for future reference.

-------------------------------

Code:
	<CivilizationTraits>
		<Row CivilizationType="CIVILIZATION_PECH" TraitType="TRAIT_CIVILIZATION_UNIT_TYKE"/>
	</CivilizationTraits>
When you cannot find something the game is complaining about in Database.log or lua.log, use AgentRansack or some other file/text searching tool to run through all the files in your mod. Saves a lot of head-bashing and hair-pulling and shirt-tearing.
 
Last edited:
I actually just found the problem myself too... For some reason, search (I've been using the search available under Windows 10 to find files with specific text in during replaces) didn't show this when searching for PECH but showed PECH in every other file where it existed. Baffling, but there you go. It sounds like AgentRansack might be a better option for me. Thanks for the advice. Now I need to work out why Paulinus doesn't boost faith yield on Ilkla Moor and upgrade my design of the Tyke unit. Lots of work still to do but the very basic mod is now functional. I can't thank you enough.
 
Another question, and I have to think I'm doing something really wrong here... Can an improvement be modified by/created by a leader instead of a civ? My Ilkla Moor improvement works fine if I attach it to my Trait_Civilization_Muck_Brass (The controlling trait of my civ). If, however, I attach it to Trait_Leader_Gods_Own_Country (my controlling trait for Paulinus) then my builders suddenly can't build it, but the improvement still shows up on the load screen and as a Leader-based improvement in civilopedia. I've also tried having my leader mod improvements (Ilkla Moor and Farm) by mimicking the code the civilization successfully uses to modify various improvements but for the leader instead. That also fails to work. No errors show up in the database log.

Rather than asking anyone if they can look through the code, has anyone successfully created code that creates or modifies an improvement for one leader only? Or is this something that, for some reason, Civ 6 can't achieve?
 
The way the roman fort is being handled it is being added as an ability of the Roman Legion Unit. All the other unique imporovements appear to be tied to a civilization trait, which are then tied directly to a civilization in <CivilizationTraits>. There seems to be no other hook-up anywhere.
 
Hmmm... going by that, to have each Leader modify Ilkla Moor I'll have to add a different version of the Builder for each leader and tie a different version of Ilkla Moor to each builder. Wow, that IS an oversight on Firaxis' point. Think I'll put my thinking head on and come up with a viable alternative. Thanks for the advice.
 
Opps didn't see there was a second page of posts. Still for future reference.

Your problem was in your units file. It has
Code:
 <CivilizationTraits>
  <Row CivilizationType="CIVILIZATION_PECH" TraitType="TRAIT_CIVILIZATION_UNIT_TYKE"/>
 </CivilizationTraits>

I'd strongly suggest that you use Notepad++
https://notepad-plus-plus.org/
as your editor. It has support for XML and has a great Find In Files facility.
What I'm doing at the moment is creating a new Civ using my Italian Civilization
https://forums.civfanatics.com/threads/italian-civilization.606657/
as a starting point.

My first new Civ took me absolutely ages to work out so starting with an existing one and then gradually altering things is the best way to go.
I also use GitHub so that as I gradually change things I store each change. There is a really easy guide to using this on Windows at
https://code.tutsplus.com/tutorials/git-on-windows-for-newbs--net-25847

It also has the advantage that if you make a change and find it breaks your mod you can go into Git GUI and see what changes you've made and also revert them if necessary.
It saves a LOT of time and hassle doing it this way.

Good luck with your Mod. The only thing I would say is that York Minster, although first built in 627 AD, is really a religious building. I would have thought it should be built on a Holy District.
I like that you've found out how to limit it to one building though. Something I was just starting to look at :)
 
Last edited:
Thanks for the advice, DavDarkelf. Yes, both LeeS and I had tracked down the PECH reference already, though it took me hours of frustrating screen-staring. As you might have read above, I'd been using the Windows 10 search and that had highlighted other occurences of the string but not this one. Weird, but the suggested AgentRansack from LeeS (and probably your own suggestion of Notepad++) seems to resolve the ineffective search problem.

I am basing my first civ off slicelonger's PECH civilization, then researching other mods (and using help that LeeS and Horem have provided) to work through ideas and problems. That's how I've discovered you can't change the palace easily, you can't have a leader create an improvement (they're tied to civs not leaders unlike most other things which can be tied to anything), and that many checks are missing from the original Civ6 code (like Horem having to write a check for the presence of farms). I find myself posting more requests for advice than I expected, but the community has some extremely kind members for whom I'm grateful.

Actually, I suspect that's one of the things that stands me in good stead compared to those who wrote mods in earlier games. I have many advantages. First I'm retired (early), so I can put time in whenever I want. Second I'm an ex-programmer (though it's over 20 years ago and was in things like TAL, COBOL, BASIC, C etc, never XML). Third, and most importantly, is the vibrant and helpful community as mentioned before. I know without you all I'd end up getting nowhere fast.

I'll certainly look into GitHub, thanks for that one. I guess in the end any tools that help are very much to be valued, especially since Firaxis have put out NONE. Disappointing, gentlemen, very disappointing indeed.
 
Oh, two additional notes. First, yes, York Minster is a religious building and so in theory belongs in the Holy Site. My intention with the building though is to start generating faith and great prophet points immediately, thus allowing Paulinus the option of founding the first (or sometimes second) religion and pantheon easily. That being the case, I wanted it to replace the palace at first but that seems impossible. So, as a workaround, I left it as a city center building. This again means the player can start working on their religion long before being able to set up their holy site. There may be better ways of doing it, but this is the best workaround I've come up with so far that counters (at least in many cases) an early stonehenge push by other civilizations.

Second, I've played and enjoyed the Italian civ several times (not all the way through, I'm the strategy version of an altaholic and though I do play through full games usually I end up restarting and trying things slightly differently before the end). I'm wondering if I have a bad version of it through because when I look in the database log with Italy enabled I get the following error flagged:


[3158095.211] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
[3158095.211] [Gameplay]: While executing - 'insert into Modifiers('ModifierId', 'ModifierType') values (?, ?);'
[3158095.211] [Gameplay]: In XMLSerializer while inserting row into table insert into Modifiers('ModifierId', 'ModifierType') with values (TRAIT_WILDCARD_GOVERNMENT_SLOT, MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER, ).
[3158095.211] [Gameplay]: In XMLSerializer while updating table Modifiers from file Italy_Leaders.xml.
[3158095.211] [Gameplay] ERROR: UNIQUE constraint failed: Modifiers.ModifierId
 
Hmm yes looking at the log does show that. I'm not sure why but the extra Wildcard Slot does become available straightaway when you get the Cheifdom government. I must admit I do most testing by actually running the game :) My SQL knowledge is pretty limited as well. I used to be a C++ developer and Software Engineer but that was many years ago.

Update:

Ok I changed the code to read
Code:
<Row>
            <ModifierId>TRAIT_ITALY_EXTRA_WILDCARD_GOVERNMENT_SLOT</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER</ModifierType>
        </Row>

I was reusing the ModifierId that was already defined in Civilizations.xml that was just TRAIT_WILDCARD_GOVERNMENT_SLOT and obviously it was trying to add the same id to the database.
 
Last edited:
Back
Top Bottom