1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Locke's Russia Modding Example 1.0

Just a quick XML-only example of a mod with some comments on what various pieces do.

  1. Trandyr

    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.

    Read more about this resource...
     
  2. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    441
    Gender:
    Male
    Location:
    Manila, Philippines
    can u also have an example of sql? thanks for this really helpful :)
     
  3. wotan321

    wotan321 Chieftain

    Joined:
    Oct 25, 2001
    Messages:
    1,218
    Location:
    NC, USA
    Will the updated unit counts add units for all civs or just the human player?
     
  4. Trandyr

    Trandyr Chieftain

    Joined:
    Oct 29, 2016
    Messages:
    10
    Do you mean of normal SQL syntax, or...?
     
  5. Trandyr

    Trandyr Chieftain

    Joined:
    Oct 29, 2016
    Messages:
    10
    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.
     
  6. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    This example is very helpful! Thank you!
     
  7. wotan321

    wotan321 Chieftain

    Joined:
    Oct 25, 2001
    Messages:
    1,218
    Location:
    NC, USA
    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?
     
  8. Trandyr

    Trandyr Chieftain

    Joined:
    Oct 29, 2016
    Messages:
    10
    Couldn't hurt. I didn't do any Civ 5 modding either, but I modded Civ 4 extensively.
     
  9. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    441
    Gender:
    Male
    Location:
    Manila, Philippines
    yes sql syntax for civ 6
     
  10. Trandyr

    Trandyr Chieftain

    Joined:
    Oct 29, 2016
    Messages:
    10
    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.
     
  11. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    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).
     
  12. Trandyr

    Trandyr Chieftain

    Joined:
    Oct 29, 2016
    Messages:
    10
    It should be. Can you copy/paste what you used?
     
  13. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    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
     
  14. Trandyr

    Trandyr Chieftain

    Joined:
    Oct 29, 2016
    Messages:
    10
    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.
     
  15. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    simply putting it in quotes does not work
    Cost="Cost*1.5" left the cost of the holy district at 60 (should be 90)
     
  16. Trandyr

    Trandyr Chieftain

    Joined:
    Oct 29, 2016
    Messages:
    10
    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.
     
  17. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    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.
     
  18. O4rfish

    O4rfish Chieftain

    Joined:
    Oct 23, 2016
    Messages:
    8
    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.
     
  19. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    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: Nov 3, 2016
  20. isau

    isau Warlord

    Joined:
    Jan 15, 2007
    Messages:
    2,750

    It should work. Sample lines from my mod:


    UPDATE Buildings SET Cost = Cost*0.7 ;

    or

    UPDATE Units SET Cost = Cost*0.5 WHERE UnitType='UNIT_BUILDER' ;
     

Share This Page

Ebates: Get Paid to Shop