Quick Modding Questions Thread

Thanks, the issue is in my code then.
 
Better District Icons uses
Code:
INSERT OR REPLACE INTO IconDefinitions
I think you may not be able to do UPDATE because IconDefinitions is a 'view' rather than an actual table.
 
It's an insert with a select.

Found the double issues in my code.

First one, I share the blame with whoever decided to name a column "Index"

WRONG:
Code:
INSERT OR REPLACE INTO IconDefinitions
            (Name,                    Atlas,        Index)
    SELECT    'ICON_' || W.NewUnitType,     I.Atlas,     I.Index
    FROM IconDefinitions AS I, WarfareExpandedReplaces AS W WHERE I.Name = 'ICON_' || (SELECT ReplacesUnitType FROM WarfareExpandedReplaces);

CORRECT:
Code:
INSERT OR REPLACE INTO IconDefinitions
            (Name,                    Atlas,        "Index")
    SELECT    'ICON_' || W.NewUnitType,     I.Atlas,     I.[Index]
    FROM IconDefinitions AS I, WarfareExpandedReplaces AS W WHERE I.Name = 'ICON_' || (SELECT ReplacesUnitType FROM WarfareExpandedReplaces);


Second one, my fault only, thought I was smart by reusing the same initialization table in different databases (gameplay/icon)...

But this Foreign Key:
Code:
CREATE TABLE IF NOT EXISTS WarfareExpandedReplaces (
        NewUnitType TEXT NOT NULL,
        ReplacesUnitType TEXT NOT NULL,
        PRIMARY KEY(NewUnitType ),
        FOREIGN KEY (ReplacesUnitType) REFERENCES Units(UnitType)  ON DELETE CASCADE ON UPDATE CASCADE
    );

Can't work in the Icon DB, which doesn't have an Units table...

I still learn everyday :D
 
Is there a limit to the number of items that can appear under a civilization in the loading screen? I am having a strange issue where when I add a custom unique unit to a civ, the leader's leader ability disappears in the loading screen, but shows up fine in the player selection screen. In game, the ability still works as normal. Any Ideas what is going on?
 
Selection screen depends on your configuration, and loading screen on your traits, maybe you forgot to assign traittype to your items.
I have a GameData file where I define the unique leader trait as follows.


<Types>
<Row Type="MY_CUSTOM_LEADER" Kind="KIND_LEADER"/>
<Row Type="TRAIT_MY_CUSTOM_TRAIT" Kind="KIND_TRAIT"/>
</Types>

<LeaderTraits>
<Row LeaderType="MY_CUSTOM_LEADER" TraitType="TRAIT_MY_CUSTOM_TRAIT"/>
</LeaderTraits>

<Traits>
<Row TraitType="TRAIT_MY_CUSTOM_TRAIT" Name="LOC_TRAIT_MY_CUSTOM_TRAIT_NAME" Description="LOC_TRAIT_MY_CUSTOM_TRAIT_DESCRIPTION"/>
</Traits>

The text for TRAIT_MY_CUSTOM_TRAIT are located in a ConfigText File and everything shows up fine in the character selection....I also made sure in the project to add ConfigText to both the Front-End Actions and In-Game Actions, but in the loading screen the custom trait just isn't there. It's very odd.
 
I have a GameData file where I define the unique leader trait as follows.


<Types>
<Row Type="MY_CUSTOM_LEADER" Kind="KIND_LEADER"/>
<Row Type="TRAIT_MY_CUSTOM_TRAIT" Kind="KIND_TRAIT"/>
</Types>

<LeaderTraits>
<Row LeaderType="MY_CUSTOM_LEADER" TraitType="TRAIT_MY_CUSTOM_TRAIT"/>
</LeaderTraits>

<Traits>
<Row TraitType="TRAIT_MY_CUSTOM_TRAIT" Name="LOC_TRAIT_MY_CUSTOM_TRAIT_NAME" Description="LOC_TRAIT_MY_CUSTOM_TRAIT_DESCRIPTION"/>
</Traits>

The text for TRAIT_MY_CUSTOM_TRAIT are located in a ConfigText File and everything shows up fine in the character selection....I also made sure in the project to add ConfigText to both the Front-End Actions and In-Game Actions, but in the loading screen the custom trait just isn't there. It's very odd.

Database log probably has an error. As Raen says Config is entirely separate from Gameplay, and so it working on the selection screen means nothing in terms of it working past that point. If you've got multiple Traits called TRAIT_MY_CUSTOM_TRAIT then you're definitely going to have a UNIQUE constraint failure in the Traits table. Also worth noting that iirc UC Traits generally don't have their Description column filled out, the only exceptions being the Film Studio and the Poland/Persia DLCs for w/e reasons, and well I was gonna say that has an impact on how the LoadScreen decides to display them but evidently that can't be it :/
 
Hello, I want to try to create my own mod, I haven’t done mods before. Is it possible to add the function of bombers to attack the selected building in the city? So you can choose what you want to destroy in the city. Unit must destroy a certain building in the city.
 
what if you had another civics without any prereq ?
 
The reason code of laws is the first is that it has four available policies, and therefore gives enough policies to select from to fill available policy-slots after you 'discover' Code of Laws. Otherwise, the player(s) that have an extra policy slot as part of a UA cannot satisfy the slot-selection menu and you can get stuck on the interface page. An AI playing as Tommyris (?) also is able to fill their cards -- without enough available policies to select-from, the game might crash as soon as such an AI player 'learns' their first civic.
 
I added a civic with no prereq, made that civic the prereq of code_of_laws, and updated the 4 policies that have code of laws to have the new civic as a prereq. Unfortunately it still defaults to code of laws and allows you to finish it by ending turn with shift-enter.

Spoiler pic :

Screen Shot 2018-12-15 at 1.57.20 PM.png


 
Back
Top Bottom