1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Suggestions, ideas and bugfixes related to modding

Discussion in 'Civ6 - Creation & Customization' started by Gedemon, Apr 4, 2019.

  1. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,255
    Location:
    London, UK
    • Add/Remove Modifiers via Lua for all entities
     
  2. Laurana Kanan

    Laurana Kanan Don’t underestimate who I am.

    Joined:
    Apr 10, 2014
    Messages:
    1,712
    Gender:
    Female
    Location:
    Near the Greatest Snow on Earth
    I would like the ability to add new types of moments with their triggering requirements. Right now that seems to all be done at the Game Core level.
     
  3. racha

    racha Chieftain

    Joined:
    Jul 27, 2013
    Messages:
    199
    Location:
    Surrounded by barbarians
    This sort of thing is getting <expletive> old, so it would be awesome if a modding-related patch fixed it:

    Database.log:
    [3365664.683] [Database] ERROR: UNIQUE constraint failed: IconDefinitions.Name, IconDefinitions.Atlas

    Modding.log:
    [3365664.610] Reloading Tuner states.
    [3365664.621] Reloading icons.
    [3365664.688] Reloading colors.
    [3365664.972] Successfully reconfigured game.
    *EOF*

    Nothing in my logs directory is telling me what's wrong of giving me the slightest hope of fixing it (searching all files in the directory for 3365664 yields nothing apart from the single instance in database.log). To be clear, the specific error posted here re: icon atlases isn't the issue - it happens with far too many other errors, too ("too many" is defined as >0 IMHO).

    Unrelated, if a modding patch could remove redundant entries (I just got 3 identical errors totalling 21 lines telling me that Firaxis derped with a city state). Modding can generate a lot of errors (especially for those of us with who aren't JFD/Civitas/Leiugi/Sukritact-tier modders) so cutting down on how much has to be sifted through couldn't hurt.
     
  4. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,255
    Location:
    London, UK
    It could tell you the table and constraint name and the offending line of SQL - file and line number.
     
    racha likes this.
  5. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,083
    Location:
    Illinois, USA
    It would be desirable to delete all occurances within Firaxis-created lua files of "RowID - 1".

    The problem is that RowID does not update to reflect changes to database table "numbering" that come from mods. If I delete the Lumber Mill from the game, for example, this is the result
    Code:
    > print(GameInfo.Improvements["IMPROVEMENT_GOODY_HUT"].RowId - 1)
    9
    Whereas the correct data from using Index of the relevant Row in the database gives the following
    Code:
    > print(GameInfo.Improvements["IMPROVEMENT_GOODY_HUT"].Index)
    8
    In this specific instance, since Lumber Mill comes in the Improvements table before Goody Huts, the map generation files attempt to place not Goody Huts, but Oil Wells within the CanPlaceGoodyAt() routine. The routine fails the checks shown here
    Code:
    function CanPlaceGoodyAt(improvement, plot)
    
    	local improvementID = improvement.RowId - 1;
    	local NO_TEAM = -1;
    	local NO_RESOURCE = -1;
    	local NO_IMPROVEMENT = -1;
    
    	............
    
    	if (not ImprovementBuilder.CanHaveImprovement(plot, improvementID, NO_TEAM)) then
    		return false;
    	end
           .........
    
    	if (plot:GetResourceType() ~= NO_RESOURCE) then
    		return false;
    	end
    "improvement.RowId" returns an erroneous row number, so the improvementID number garnered in the method
    Code:
    local improvementID = improvement.RowId - 1;
    is also erroneous because RowId apparently does not reflect changes made within the database by mods.

    Code:
    ImprovementBuilder.CanHaveImprovement(plot, improvementID, NO_TEAM)
    will return erroneous data for the plot in question since the return for ImprovementBuilder.CanHaveImprovement() is based not on the Goody Hut but rather the Oil Well's Index ID #. The results will be bizarre to say the least, and for the specific modding example given to cause goody huts never to be placed because if the first snippeted check passes the test, the second for "No Resource" will not pass the testing, since Goody Huts cannot be placed on resources according to the CanPlaceGoodyAt routine, but Oil Wells must be placed on Oil Resources.
     
    Infixo likes this.
  6. racha

    racha Chieftain

    Joined:
    Jul 27, 2013
    Messages:
    199
    Location:
    Surrounded by barbarians
    This might be too vague of a suggestion, but here goes.

    Unlock everything to be moddable unless it's so critical that it absolutely can't be. A couple of examples - there appears to be a hard limit of 8 for governors, even though we can add more via mods (related: we don't appear to be able to give new governors their own portraits).

    Another example is that we can't (AFAIK) add custom yields to tiles (I'd be a fan of making tourism one, but I'm weird like that).

    The NPC decision-making tree would almost certainly get a tonne of love from the modding community and the game would be better for it.

    I realise there could come a point where you'd end up with people making entirely new games if you opened up enough ~stuff~, but is that really a big deal when people still have to buy the game in order to use the mods?
     
  7. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,255
    Location:
    London, UK
    The number of Artifacts and Relics is hardcoded in GreatWorksOverview.lua and GreatWorkShowcase.lua which is bad because I can't add new Artifacts and Relics without overriding Lua files. The way this works is really ridiculous. :(

    Code:
    local NUM_RELIC_TEXTURES:number = 24;
    local NUM_ARIFACT_TEXTURES:number = 25;
    
    ...
        if greatWorkInfo.GreatWorkObjectType == GREAT_WORK_ARTIFACT_TYPE then
            local greatWorkType:string = greatWorkInfo.GreatWorkType;
            greatWorkType = greatWorkType:gsub("GREATWORK_ARTIFACT_", "");
            local greatWorkID:number = tonumber(greatWorkType);
            greatWorkID = ((greatWorkID - 1) % NUM_ARIFACT_TEXTURES) + 1;
            greatWorkIcon = "ICON_GREATWORK_ARTIFACT_" .. greatWorkID;
        elseif greatWorkInfo.GreatWorkObjectType == GREAT_WORK_RELIC_TYPE then
            local greatWorkType:string = greatWorkInfo.GreatWorkType;
            greatWorkType = greatWorkType:gsub("GREATWORK_RELIC_", "");
            local greatWorkID:number = tonumber(greatWorkType);
            greatWorkID =  ((greatWorkID - 1) % NUM_RELIC_TEXTURES) + 1;
            greatWorkIcon = "ICON_GREATWORK_RELIC_" .. greatWorkID;
        else
            greatWorkIcon = "ICON_" .. greatWorkInfo.GreatWorkType;
        end
    
     
  8. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,255
    Location:
    London, UK
    Remove all hard-coding from Lua for things that can be determined from the dynamic data in the database and cached.
     
    Last edited: May 31, 2019
  9. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,255
    Location:
    London, UK
    Feature ideas for Modbuddy:
    * ArtDefs that are not referenced in the Mod.Art.xml are highlighted red (or different colour).
    * XLPs that are not referenced in the Mod.Art.xml are highlighted red (or different colour).
    * Assets that are not referenced in any XLP are highlighted red (or different colour).
    * Icons/UI Textures that are not referenced in any XLP are highlighted red (or different colour).
    * Mod.Art.xml highlighted red (or different colour) if it's not added into UpdateArt (Mod Art Dependency File).
     
  10. Wolfdog

    Wolfdog Unit Butcher

    Joined:
    Jun 29, 2012
    Messages:
    636
    Location:
    Australia
    Not sure if this is an issues related to my Nvidia drivers or Asset Editor but AE does not recognize OpenGL drivers anymore and keeps warning that cooking will be slow. If this is AE looking for old drivers could it please be updated to detect the latest OpenGL drivers?
     
  11. Deliverator

    Deliverator Graphical Hackificator

    Joined:
    Feb 12, 2008
    Messages:
    4,255
    Location:
    London, UK
    It seems that a .dep file is not created unless the *.Art.xml references at least one .artdef file in the mod? In other words, you can't have an XLP only Art.xml -> dep file. This isn't really made clear anywhere.
     

Share This Page