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

New Modding Basics

Discussion in 'Civ6 - Modding Tutorials & Reference' started by vans163, Oct 23, 2016.

  1. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    441
    Gender:
    Male
    Location:
    Manila, Philippines
    where can i find some tutorials on how to start modding? i only know how to edit existing xml and sql. i want to make a modpack that consist either using xml or sql
     
    Buni0ns likes this.
  2. Cyphose

    Cyphose y tho

    Joined:
    Feb 1, 2016
    Messages:
    181
    Gender:
    Male
    Most of the tutorials you can find on modding Civ 6 are right in this forum. The game hasn't even been out for a week; we're all still figuring out the basics. Hopefully soon Firaxis will release their official modding tools which will make all of our lives easier, so if you're comfortable with waiting, I'd hold my horses until then.

    Failing that, the best way of figuring out how to do something at the moment is to look at how the game does it and follow that same basic structure. Want to add a unit? Look at the game's basic code in Units.xml and the like. Need to modify localization? Look at all the text entries in the game's database. If that isn't enough, give a crack at the Civ 5 Creation & Customization forum; though it's for a different game, the architecture is quite similar and the standards for coding are much the same, if nothing else. Because it's been around for a while, there are all kinds of tutorials there to consult. Don't take anything you find there as gospel though, just use it as a guide, because it's very likely things will be done differently in Civ 6.

    If you're having trouble, there's no problem with asking a question in the main forum, though I'd definitely warn against using this forum as your first line of inquiry. Investigating by yourself will almost always teach you things far better, if for no other reason than it encourages you to learn the structure of the game. This is a learning period for all of us, though, so if you can't figure something out, a lot of us will be more than happy to help you out because chances are we'll be helping ourselves out in the process.
     
    Buni0ns and gelodgreat like this.
  3. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    441
    Gender:
    Male
    Location:
    Manila, Philippines
    thanks :D
     
  4. Ledaren

    Ledaren Chieftain

    Joined:
    Oct 28, 2016
    Messages:
    6
    Gender:
    Male
    Can I ask something here?
    I'm trying to make a civilization traits that give me a unit whenever I create a city.
    My idea is, because every city will have City Center district, I use <ModifierType>MODIFIER_PLAYER_DISTRICT_CREATE_UNIT</ModifierType> which point to DISTRICT_CITY_CENTER. But it didn't work. Do anyone have another idea or find better modifier for that purpose?
     
  5. coffee junkie

    coffee junkie Tech Hippie

    Joined:
    Dec 16, 2006
    Messages:
    438
    Location:
    Europe
    If only Firaxis could release a very different tool than the previous one for Civ V ....................................................................... :D
     
  6. Landstander

    Landstander Chieftain

    Joined:
    Feb 21, 2006
    Messages:
    217
    My cached DB is acting funny. Even after deleting the caches and verifying the game data, various changes are still there that are different than what the source files say. But the changes are not in effect in the game. This leaves me with no way to check if all of my changes are working. It also doesn't seem to update when I try to enable/disable mods.
     
  7. NycholusV

    NycholusV Chieftain

    Joined:
    Jun 25, 2016
    Messages:
    85
    Gender:
    Male
    Location:
    Sydney, Australia
    If you could post the full code, that'd be helpful. But I'd suggest checking GameEffects.log and searching for the name of your modifier.
     
  8. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    I have made mini mod on my local pc, which I like and would also like to share.

    Nutty has given already some information in this thread how to make a mod. Thank you for that.
    But I would still need some more help please.
    I can see that the threads about mod packs and mod components are locked. So there is some procedure to get your stuff there. Where do I find information about these details?

    My mini mod so far modifies 3 xml files only.
    But the effect on the game play are significant:
    1.) I have switched off Great prophets and with that it is impossible to found religions and it is also impossible to win a religious victory. While I find the idea of the religious victory and its implementation appealing, I think it should be possible to switch it off. This mod does that.
    2.) I have switched off the scaling of the districts. Districts always cost the base price which is only scaled / modified by the game speed but no longer by tech progression. I like it a lot more if your later cities can also build a district in a reasonable time.

    As I like the way the game plays a lot more with this modification (only 1 incomplete test game so far) it would be nice to share this mini mod.
     
  9. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    441
    Gender:
    Male
    Location:
    Manila, Philippines
    How can i enable my new mod to my existing game? please help
     
  10. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    As far as I tried and found in the forum mods can only work on new games. So you can't
     
  11. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    441
    Gender:
    Male
    Location:
    Manila, Philippines
    Where can i see the near border penalty?
     
  12. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    In DiplomacyStatements_Warning.xml you find the WARNING_DONT_SETTLE_NEAR_ME. Is this what you are looking for?
     
  13. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    441
    Gender:
    Male
    Location:
    Manila, Philippines
    thanks but the near unit penalty modifier is what im looking for.
    EDIT: okay i already found it WARNING_TOO_MANY_TROOPS_NEAR_ME

    how can i change the modifier?
     
  14. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    In leaders.xml you can find
    <Row>
    <ModifierId>STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING</ModifierId>
    <Name>InitialValue</Name>
    <Value>-2</Value>
    </Row>
    <Row>
    <ModifierId>STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING</ModifierId>
    <Name>ReductionTurns</Name>
    <Value>10</Value>
    </Row>
    <Row>
    <ModifierId>STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING</ModifierId>
    <Name>ReductionValue</Name>
    <Value>-1</Value>
    </Row>
    <Row>
    <ModifierId>STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING</ModifierId>
    <Name>DiplomacyKey</Name>
    <Value>WARNING_TOO_MANY_TROOPS_NEAR_ME</Value>
    </Row>
    <Row>
    <ModifierId>STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING</ModifierId>
    <Name>MessageThrottle</Name>
    <Value>20</Value>
    </Row>
    <Row>
    <ModifierId>STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING</ModifierId>
    <Name>SimpleModifierDescription</Name>
    <Value>LOC_DIPLO_MODIFIER_NEAR_BORDER_WARNING</Value>
    </Row>

    My guess is
    1.) you start at -2
    2.) if you get to 20 or more the other guy is upset.
    3.) it takes 10 turns to reduce the value by 1
    4.) each unit near the border for 1 turn adds 1 point (I don't see this here, I am just guessing)
    5.) that changing these values might get you somewhere.

    6.) This is probably the consequence of upsetting the other guy (3 points lost in the relationship)
    <Row>
    <ModifierId>STANDARD_DIPLOMATIC_NO_PROMISE</ModifierId>
    <Name>ModifierPerTransgression</Name>
    <Value>-3</Value>
    </Row>
     
    Last edited: Oct 31, 2016
  15. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
  16. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    441
    Gender:
    Male
    Location:
    Manila, Philippines
    thanks :D how can i put this is mod? i only know is like this
    <Improvements>
    <Update>
    <Where ImprovementType="IMPROVEMENT_GREAT_WALL"/>
    <Set BuildInLine="true" BuildOnFrontier="false" CanBuildOutsideTerritory="true"/>
    </Update>
    </Improvements>

    is this correct? i think this is wrong it crashes the game

    <ModifierArguments>
    <Update>
    <Where ModifierId="STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING" AND Name="InitialValue"/>
    <Set Value="0"/>
    </Update>
    <Update>
    <Where ModifierId="STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING" AND Name="ReductionValue"/>
    <Set Value="0"/>
    </Update>
    <Update>
    <Where ModifierId="STANDARD_DIPLOMATIC_NEAR_BORDER_WARNING" AND Name="ReductionTurns"/>
    <Set Value="20"/>
    </Update>
    </ModifierArguments>

    EDIT: I removed the AND and it doesnt crash. going to test if its working

    Edit: I think its working gonna upload in the reseource later

    EDITL Near Border Penalty is working. but another problem is "Moving forces near their cities" penalty.
     
    Last edited: Oct 31, 2016
  17. Littlebob86

    Littlebob86 Chieftain

    Joined:
    Oct 24, 2016
    Messages:
    329
    Hey guys , what program do I need to do basic mods ? Like ones that are just update , to save me from editing the base files ?

    I'm getting the feeling I'm missing something reading through these posts !
     
  18. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328
    @Littlebob86:

    the most basic mods are made by writing xml files which update some properties. You can do that with a simple text editor or use an xml editing tool like xml spy or visual studio (and there are many others). These xml editing tools just display the xml in a nicer way. If we had the xml schema the xml tools could do some additional miracles but that is not happening yet.

    If you write your own mod your baseline is the vanilla civ6. In the xml file you write something similar to an sql update statement but formatted in a specfic xml format. Look at one of the examples to get started.

    If you do not want to share your mod or for most basic tests you can alternatively backup your civ6 files and change them. But this is the ugly hacking way.
     
  19. Lord Yanaek

    Lord Yanaek Chieftain

    Joined:
    Aug 15, 2003
    Messages:
    1,438
    With Civ5 it was possible to write SQL queries directly to update the game database. Mods using SQL loaded faster than mods using XML. Does someone know whether it's still possible or not?
     
  20. ichbinsehselber

    ichbinsehselber Chieftain

    Joined:
    Jun 22, 2005
    Messages:
    328

Share This Page

Ebates: Get Paid to Shop