Resource icon

Locke's Russia Modding Example 1.0

Trandyr

Chieftain
Joined
Oct 29, 2016
Messages
10
Trandyr submitted a new resource:

Locke's Russia Modding Example - Just a quick XML-only example of a mod with some comments on what various pieces do.

This is just a brief example of a mod. The point was to show beginner concepts such as Updating unit counts, adding start attributes, etc. Though it works, it isn't intended to be used in a game (since it disrupts balance). Rather, it will hopefully help people understand the structure of mods in Civilization VI.

The goal is to update this overtime with increased functionality (I'm learning myself), while keeping it updated with relevant comments to help people learn to mod this lovely game.

Read more about this resource...
 
Will the updated unit counts add units for all civs or just the human player?
 
Will the updated unit counts add units for all civs or just the human player?

At the moment, all units. The only other option I've found so far is to add units to just the AI. The only way I've found that it might be possible (I haven't tried yet) is to give a particular civilization a trait that gives it special units at the beginning, then pick that civilization.

Alternately, it might be possible to add a more extensive mod that recognizes additional attributes on an XML node such as PcOnly, but that would involve additional lua scripting. Haven't explored this yet.
 
This example is very helpful, thank-you for posting it.

It WILL be possible to do this, though? I get the feeling that when they release the code and other useful information, much more will be possible.

I did not buy/play/mod Civ 5, but did a lot with Civ 4. Would I benefit from learning about modding from 5 if I want to get going with modding Civ 6?
 
This example is very helpful, thank-you for posting it.

It WILL be possible to do this, though? I get the feeling that when they release the code and other useful information, much more will be possible.

I did not buy/play/mod Civ 5, but did a lot with Civ 4. Would I benefit from learning about modding from 5 if I want to get going with modding Civ 6?

Couldn't hurt. I didn't do any Civ 5 modding either, but I modded Civ 4 extensively.
 
yes sql syntax for civ 6

I believe it uses an SQLite-based syntax. Here's the official reference: http://www.sqlite.org/lang.html

That being said, it's a bit idiosyncratic because it is done inside XML elements. So if you look inside LockeRussiaMods_Eras.xml, you'll see that I'm telling it to Update (a common SQL command) the value Where the Era="ERA_ANCIENT" and the Unit="UNIT_WARRIOR" and SET the Quantity="3". This will find where it has already determined the number of UNIT_WARRIOR to spawn for ERA_ANCIENT and change the number it needs to spawn from "1" to "3" (giving you 3 warriors). Commands like REPLACE work similarly. Where I've just done "ROW" (instead of "UPDATE"), it is the equivalent of doing an INSERT in SQL.
 
do you know if a circular reference is possible? I tried to update cost=cost*1.5 which apparently did not work (even though in sql it would work).
 
I tried this:
<Districts>
<Update>
<Where CostProgressionModel="COST_PROGRESSION_GAME_PROGRESS" />
<Set CostProgressionModel="NO_COST_PROGRESSION" CostProgressionParam1="0" Cost=Cost*1.5 />
</Update>
</Districts>
I think the problem is that this is not proper xml. My xml tool gives me an error and the quotes are probably expected. But I want the Cost to be read as the db column and not as a constant.

For my mod component (http://forums.civfanatics.com/resources/constant-district-cost-mod.25435/) I have already found a solution. So this is a question purely out of interest. Also it might be useful in some other case
 
I tried this:
<Districts>
<Update>
<Where CostProgressionModel="COST_PROGRESSION_GAME_PROGRESS" />
<Set CostProgressionModel="NO_COST_PROGRESSION" CostProgressionParam1="0" Cost=Cost*1.5 />
</Update>
</Districts>
I think the problem is that this is not proper xml. My xml tool gives me an error and the quotes are probably expected. But I want the Cost to be read as the db column and not as a constant.

For my mod component (http://forums.civfanatics.com/resources/constant-district-cost-mod.25435/) I have already found a solution. So this is a question purely out of interest. Also it might be useful in some other case

Yeah, I'd say give it a try with the Quotes and see if it works out. If not, I can try to replicate it on my end and see if I can make it work.
 
simply putting it in quotes does not work
Cost="Cost*1.5" left the cost of the holy district at 60 (should be 90)
 
simply putting it in quotes does not work
Cost="Cost*1.5" left the cost of the holy district at 60 (should be 90)

Fair enough. It must not handle recursion. That could probably be added via LUA scripting, but you'd have to be careful implementing it to prevent infinite loops.
 
I just put in the values for each row. It is a bit more work but I also had the opportunity to vary some values.
 
In the modinfo file, why is there a <Teaser/> between the </Name> closetag and the <Description> opentag? I don't understand what it does or how it works.

Edit: I guess it's a self-closing tag ... but what is it for?
Sorry, I am new to XML.
 
in xml you can make tags in 2 ways.
a.) <mytag>myvalue="1"</mytag>
b.) <mytag myvalue="1" />
These ways are essentially equivalent. If you want to have tags inside of tags you need to go by the first way.

The <Teaser/> tag is in this case an empty teaser tag (made with the syntax of case b, but it does not have any value inside)

In my own mod I put <Teaser>District cost does not scale</Teaser>
Here the Teaser contains a meaningful value (in this case the text which describes the mod in a very short way)

Normally an xml schema file (*.xslt) is used to define rules how your xml file must be structured. The xslt stylesheets for civ6 have not formally been released as far as I know.
 
Last edited:
Top Bottom