[R&F] Beginner questions

Chechu

Chieftain
Joined
Oct 19, 2008
Messages
27
Hi everyone,

I'm trying to make a mod in which only ancient and classical eras are playable but to make the game a bit more interesting I'm adapting some medieval and renaissance techs/civics too. And here comes the problem. I don't want these entire techs but only part of what they unlock. So here goes my 3 questions:

1. How to change a specific unlocked ability of a tech to a different tech? E.g., I need the ability of sailing in ocean tiles unlocked by "Cartography" and move it elsewhere.
2. How to remove unlocks from the tech tree? E.g., I want to have "Military Engineering" without niter being unlocked.

3. My third is more of a general question. I don't know how make the very basic steps of creating a mod. I can find the info in the .xmls in the game files (Base folder) and change them, but it's tedious to do so.
What I'm currently doing is keeping 2 entire "Base" folders, one with the original data and one with mine and switch them back and forth...
Can anyone point me to the right direction? Nothing fancy, just the basics on how to create a mod.

Thanks!
 
Hi Raen, thanks so much for your reply.
I've managed to do the tech thing on my own now! (though I'm still copying and pasting the entire "gameplay" folder everytime I want to switch to normal civ6)

I had seen your guide before but skipped it as at the very top it says "Make a new civ or alter something in existent one" which isn't what I was looking for. I've looked at it more carefully now, there are some useful tools to get started. That's great and will probably help a lot, thanks. With a bit of luck this will save me a lot of time :)

The only issue I have now is that even though I've learnt how to freely move units, buildings, wonders and such around the tech tree I seem unable to do the same with "skills"(for-lack-of-a-better-word) such as ocean navigation in the tech tree itself. All I managed was to actually unlock that "skill" after researching a different tech... but the icon did not appear in that tech on the tech tree, unlike any of the others :S

Another thing I'm having trouble with are names and descriptions. I think I haven't yet found the appropriate file to change the name "Medieval walls" for "Epic walls" for example.

I'm thinkg I'm doing good progress, step by step. If I manage to make a good enough mod I would love to share it here. All help is appreciated!
 
The tutorial shows civ because is the most done, but you can use only techs.xml file and a modinfo file and you are done. At techs.xml you put all your modifications, etc.

Some features are present in definition of techs, others in more advanced modifiers.

The text is present in other xml files, text files.
 
Well I am finally working a mod! No more replacing files over and over.

So far I have bypassed every little issue for my .xml files after doing much fail and repeat. If something else comes up I will inquire here :)
 
I'm actually having an issue with modifiers (not the modifiers.xml; the modifiers contained within technologies.xml). For this example I'm trying to adjust the movement speed of naval units (originally a modifier unlocked by Mathematics).

I can only make this work by modifying the actual game files, but unfortunately I can't manage to do so with my mod files.

These are the original lines. When replacing all the 3 "MATHEMATICS" by "MINING", the modifier applies once "mining" has been researched (graphically it doesn't update the tech tree but still, at least it works).
Spoiler :

<Modifiers>
<!--Units Adjust Sea Movement-->
<Row>
<ModifierId>MATHEMATICS_ADJUST_SEA_MOVEMENT</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNITS_ADJUST_SEA_MOVEMENT</ModifierType>
</Row>
</Modifiers>
<ModifierArguments>
<!--Units Adjust Sea Movement-->
<Row>
<ModifierId>MATHEMATICS_ADJUST_SEA_MOVEMENT</ModifierId>
<Name>Amount</Name>
<Value>1</Value>
</Row>
</ModifierArguments>
<TechnologyModifiers>
<!--Units Adjust Sea Movement-->
<Row>
<TechnologyType>TECH_MATHEMATICS</TechnologyType>
<ModifierId>MATHEMATICS_ADJUST_SEA_MOVEMENT</ModifierId>
</Row>
</TechnologyModifiers>

I have tried to emulate this in my mod files with no luck so far. Any ideas on how to do this?
 
XML code for a mod:
Code:
<GameData>
   <TechnologyModifiers>
	<!--Units Adjust Sea Movement-->
	<Update>
		<Where TechnologyType="TECH_MATHEMATICS" ModifierId="MATHEMATICS_ADJUST_SEA_MOVEMENT" />
		<Set TechnologyType="TECH_MINING" />
	</Update>
   </TechnologyModifiers>
</GameData>
It would not actually be necessary to alter anything in table <Modifiers> or <ModifierArguments>, and for compatibility with other mods it is probably better not to adjust anything in these two tables since all you want to so is move the effect of the Modifier from one Tech to another. The civilopedia and tooltips might still refer to "Mathematics" in some places with regard to the movement change.
 
Thanks for the quick response guys. Before my previous post I had tried with <update> clause in all of them, in some of them, in only one, etc. None worked.

I have tried your suggestion LeeS but it doesn't seem to work :( Though the advice is usefull still, I'll stick to <TechnologyModifiers> alone.
I've made several attempts, adding <GameData> and removing it. Rearranged some lines here and there... nothing. I'm still stuck with this.
 
Before I only pasted a small part of the file. <GameInfo> has been there since the beginning of course. I'm definitely not more familiar with sql :S
Sometimes only a delete followed by a complete row works (instead of update), try that.
That's what I'm currently using for TechPrereq or CivicPrereq, and it's working. Depending on which column I was already using <update> or <row> successully. Can't get it done with these damnable modifiers though...

I might not have to touch them modifiers if instead I can locate the appropriate text files to edit tech names and descriptions... as an alternate workaround.
How would a .xml for text replacing would look like?
 
Ok I think I've done it. Needed to include this in .modinfo
Spoiler :

<FrontEndActions>
<UpdateText id="Text">
<File>AW_Text.xml</File>
</UpdateText>
</FrontEndActions>

As per modifiers... I need to study this right here and will probably manage something: Nycholus Guide
 
According to the actual database the update works correctly. The UI file for the technology-page does not relfect any change, however. But UI does not equal actual game effects.
 
Well... I copied and pasted your code -then I removed the <GameData> </GameData> because I already had <GameInfo>- and then tried it on a game. I couldn't make it work.
Perhaps there should be something in .modinfo I'm missing? All the other changes in my tech.xml work correctly.
I'm attaching tech.xml; at the very bottom is the modifier.

EDIT: to clarify, when I say I tried in game I mean the actual gameplay, not the IU. I know the IU will not reflect the changes in the tech tree. I was researching Sailing and then mining to try it out in a galley both before and after mining had been researched
 

Attachments

  • AW_Technologies.xml
    9.7 KB · Views: 192
Last edited:
You have a syntax error:
Code:
[2564147.408] [Gameplay] ERROR: UNIQUE constraint failed: TechnologyPrereqs.Technology, TechnologyPrereqs.PrereqTech
[2564147.408] [Gameplay]: While executing - 'insert into TechnologyPrereqs('Technology', 'PrereqTech') values (?, ?);'
[2564147.408] [Gameplay]: In XMLSerializer while inserting row into table insert into TechnologyPrereqs('Technology', 'PrereqTech') with  values (TECH_GUNPOWDER, TECH_STIRRUPS, ).
[2564147.408] [Gameplay]: In XMLSerializer while updating table TechnologyPrereqs from file MyCiv6XMLGameplayChanges.xml.
[2564147.408] [Gameplay] ERROR: UNIQUE constraint failed: TechnologyPrereqs.Technology, TechnologyPrereqs.PrereqTech
I copied your code into a test-mod I use. The resulting error messages shown above were reported in Database.log.

Whenever something appears not to be working correctly in a mod, the very first place to look is Database.log for any error messages.
C:\Users\[YourUserName]\Documents\My Games\Sid Meier's Civilization VI\Logs/Database.log

This row already exists in the <TechnologyPrereqs> table:
Code:
<Row Technology="TECH_GUNPOWDER" PrereqTech="TECH_STIRRUPS"/>
The code of your mod cannot attempt to re-add the same data to the table. This causes a fatal Unique Constraint error, and anything further within the same file is ignored by the game.
 
OMG thank you so much LeeS!!! It is working now!
This one was driving me crazy. I had tried so many different things... I'm not exagerating when I say I might have actually created 20 games to do the same thing over and over (this is why I put the modifier in Mining to begin with).

Thank you for the tip about the Database.log too, hopefully it will prove useful.

Now the next step -even if it isn't absolutely necessary- will be making new modifiers appear in the tech tree too :lol:

So once again, thank you so much.
 
Now the next step -even if it isn't absolutely necessary- will be making new modifiers appear in the tech tree too :lol:
It only was adding Description="LOC_TECH_XXX_DESCRIPTION" in tech.xml and its actual text in text.xml.
So now with this and the code problem solved by LeeS I can start moving around modifiers in the tech tree both in game effect and UI :)
 
Anyone knows how to change the passing by of the years? For instance; instead of passing only 40 years (480 months) from turn 1 to 2, I want that to be 10 years, 120 months.
I have been playing around with GameSpeeds.xml but it does queer things. It allows me to modify the total number of turns for the entire game but not the months for each turn.

Is there any other file that specifies the start and end year of the game?
 
@Chechu - GameSpeeds.xml is the file you want. The GameSpeed_Turns table controls the month increments and turns per increment. The start date can be set in the Eras.xml file under the StartEras table. You'll have to figure exact ending date you want by adjusting the increments in the GameSpeed_Turns table. Rather than directly changing values in the xml files, I'd suggest creating a simple mod though.
 
I was using those already but I can't make it work they way I want. I've tried many different possibilities but the game never allows me to change how many years difference between turn 1 and 2.
 
Top Bottom