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

Tutorial: Modding with SQLLite Studio (PC)

Discussion in 'Civ6 - Modding Tutorials & Reference' started by isau, Jan 2, 2017.

  1. Rajendran

    Rajendran Chieftain

    Joined:
    Jan 4, 2017
    Messages:
    58
    Gender:
    Male
    SaintsSinners, Thank you very much for these tutorial. I tried to create my own customised mod to play but do not know how. Borrowed books on sql and xml, and read the basics. Tried creating the mods both in xml and sql format but was unsuccessful. Then I came across this discussion and found a great relief. Thank you very much.

    I have not started your tutorial yet but surely, this informations is what I needed.

    I have purchased SQLite from AppStore recently. Do we need SQLite Studio specifically to create the mod.
     
  2. Rajendran

    Rajendran Chieftain

    Joined:
    Jan 4, 2017
    Messages:
    58
    Gender:
    Male
    isau, I tried creating my own customised mod but noticed from the modding.log that it is not successful. There was a comment "Game configuration needs to change to match target config". I am not a programmer but able to understand basic. Appreciate if could provide some guidance. The mod I created was a simplified one to understand the modding process. I have attached my mod and log details.
     

    Attached Files:

  3. Infixo

    Infixo Warlord

    Joined:
    Jan 9, 2016
    Messages:
    2,207
    Gender:
    Male
    Location:
    Warsaw
    1. Is it entire Database.log? Because you've got errors in .sql files and there's nothing about them in database.log. There are no rows that correspond to timestamp: [3721739.703] Warning: UpdateDatabase - Error Loading SQL.
    2. Multiple rows in INSERT INTO are separated with comma not semicolon.
    3. Text updates should be done in a separate component UpdateText, not UpdateDatabase.
     
  4. Rajendran

    Rajendran Chieftain

    Joined:
    Jan 4, 2017
    Messages:
    58
    Gender:
    Male
    Infixo, thanks. But I quite don't understand what you mean for s/n 3 "Text updates.......not UpdateDatabase".
     
  5. Rajendran_P

    Rajendran_P Chieftain

    Joined:
    Mar 10, 2017
    Messages:
    26
    Gender:
    Male
    Sorry, yes this is the entire database log.
     
  6. Infixo

    Infixo Warlord

    Joined:
    Jan 9, 2016
    Messages:
    2,207
    Gender:
    Male
    Location:
    Warsaw
    In .modinfo you've got a component UpdateDatabase with 3 sql files. One of them is updating Texts - it can't be placed in this component. It's a separate UpdateText for changing game Texts.
     
  7. Rajendran

    Rajendran Chieftain

    Joined:
    Jan 4, 2017
    Messages:
    58
    Gender:
    Male
    Infixo, Thank you for your reply. I'll understand now. I change the modinfo file and try again.
     
  8. Rajendran

    Rajendran Chieftain

    Joined:
    Jan 4, 2017
    Messages:
    58
    Gender:
    Male
    Infixo, can you help me with some guidance on building mod. Although I have played from Civ 1 till Civ 5, I have never used mods or created my own mods before. I have followed through this tutorial and was successful in creating the tutorial mod. Thereafter, I am now trying to create my own unique mod. I am only trying a simple basic mod to understand the mod building process. I know some basic sql and xml program only. I am using the mod on website as reference to learn and build my own. I created same mods several times with changes but was unsuccessful in the final gameplay. I am not able to fully understand the nature of error in the log files. I believe there are some missing linkage file that may be required to be build or error in my file which cause the mod to fail. I only request your professional advise/guidance to help me to highlight my error and how to solve it. Appreciate if you could help me with your guidance. Thanks
     
  9. Infixo

    Infixo Warlord

    Joined:
    Jan 9, 2016
    Messages:
    2,207
    Gender:
    Male
    Location:
    Warsaw
    @Rajendran As for starter, here are few suggestions that will help solve whatever problems you have now or in the future.
    1. Create a separate thread in proper forum. I believe the purpose of this thread is somewhat different.
    2. Describe your problem. Describe expected results vs. results you get. The more info you provide, the better.
    3. Attach your mod and key log files (at least database.log and modding.log, Lua.log if you are programming and gameeffects.log if you are creating modifiers). Make sure you post actual mod, not modbuddy project.
     
  10. Rajendran

    Rajendran Chieftain

    Joined:
    Jan 4, 2017
    Messages:
    58
    Gender:
    Male
    Noted Infixo. Thank for your reply. I complete my latest mod, create a thread and continue from there. Thanks
     
  11. Rajendran_P

    Rajendran_P Chieftain

    Joined:
    Mar 10, 2017
    Messages:
    26
    Gender:
    Male
    Isau, I have re-read your Chapter 2: Dynamic modifiers, effects, collections and arguments. I have a query. Can create the code/command for
    1. Founding Fathers (America’s special ability) increases the rate of border expansion by 20% in all cities.
    2. Mimar Sinan’s (Great Engineer) ability instantly grants +4 Population.
    In one sql/xml file or do we need to create specific sql/xml files.
     
  12. Jonnoiscooler

    Jonnoiscooler Chieftain

    Joined:
    Oct 9, 2017
    Messages:
    2
    Gender:
    Male
    Hey! I know it's months late, but this tutorial was great! I want to attempt to add back in the ability for regional buildings effects to stack on top of one-another. Any idea what I'd do? I've been fishing around in a whole load of tables looking for hints but so far haven't found anything that I would consider useful in achieving this.
     
  13. qqqbbb

    qqqbbb Chieftain

    Joined:
    Sep 25, 2010
    Messages:
    411
    What version of SQLite does the game use?
     
  14. isau

    isau Warlord

    Joined:
    Jan 15, 2007
    Messages:
    2,733

    I'm not sure. I use SQLite 3 and that seems to work fine.
     
  15. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    3,969
    Location:
    London, UK
    FYI you can get around this by running the following at the start of your SQLite session:

    Code:
    DROP TRIGGER OnTypeInsert;
    CREATE TRIGGER OnTypeInsert AFTER INSERT ON Types BEGIN UPDATE Types SET Hash = random() Where Type = New.Type; END;
    
    This simply generates a random number instead of a hash but there is a very low likelihood that the same number will be generated twice. If you run this you can fully test scripts include inserts into the Types table i.e. fully test your Mod SQL outside of the game.

    To enable Foreign keys I run this too, but you've probably covered that:
    Code:
    PRAGMA foreign_keys = ON;
     
  16. isau

    isau Warlord

    Joined:
    Jan 15, 2007
    Messages:
    2,733


    Great tips. Thanks @Deliverator!
     
  17. Hoo the fool

    Hoo the fool Chieftain

    Joined:
    Feb 14, 2018
    Messages:
    5
    Hello. Could you give me advice for changing game text?

    I've found the LocalizedText database and noticed that most of in-game texts are included in the DB. The problem is, however, I could not find the new texts which has been added at the Rise and Fall expansion. Specifically, I want to change/update the text related Kotoku-in. Thanks in advance!
     
  18. isau

    isau Warlord

    Joined:
    Jan 15, 2007
    Messages:
    2,733

    If you want to find any text in the game you can just hook SQLite Studio up to the DebugLocalization database instead of DebugGameplay following the same instructions in this tutorial. Once connected to that database use the pulldown window in the SQL Editor to choose the database to run queries against.

    upload_2018-3-17_23-14-58.png
     
  19. poundjd

    poundjd Chieftain Supporter

    Joined:
    Dec 4, 2013
    Messages:
    108
    Gender:
    Male
    Location:
    USA PA 17222
    The TEXT for Expansion1 is added only if that DLC is running and the RULE_SET is set to Expansion1 which is strange to me!!!
    -jeff
     

Share This Page