My mod doesn't appear to be effecting the game

Xemor

Chieftain
Joined
Dec 21, 2022
Messages
2
I have tried to create a mod that adds a new difficulty, but it doesn't seem to be working (the happiness is the same as default warlord, text hasn't updated) after going through the mods menu to load it.
XML:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="4956522f-a1a7-4018-b584-f3f581c51aeb" version="1">
  <Properties>
    <Name>NewDifficulty</Name>
    <Stability>Experimental</Stability>
    <Teaser>blah blah</Teaser>
    <Description>blah blah blah blahdasdas</Description>
    <Authors>Xemor</Authors>
    <HideSetupGame>0</HideSetupGame>
    <AffectsSavedGames>1</AffectsSavedGames>
    <MinCompatibleSaveVersion>0</MinCompatibleSaveVersion>
    <SupportsSinglePlayer>1</SupportsSinglePlayer>
    <SupportsMultiplayer>1</SupportsMultiplayer>
    <SupportsHotSeat>1</SupportsHotSeat>
    <SupportsMac>1</SupportsMac>
    <ReloadAudioSystem>0</ReloadAudioSystem>
    <ReloadLandmarkSystem>0</ReloadLandmarkSystem>
    <ReloadStrategicViewSystem>0</ReloadStrategicViewSystem>
    <ReloadUnitSystem>0</ReloadUnitSystem>
  </Properties>
  <Dependencies />
  <References />
  <Blocks />
  <Files>
    <File md5="47AED868D9506DA0675C05D88A38EAB2" import="0">SQL/Immortal_Like.sql</File>
    <File md5="4E534C9046AC11144A1A0BEED3C617A1" import="0">XML/Immortal_Like.xml</File>
  </Files>
  <Actions>
    <OnModActivated>
      <UpdateDatabase>SQL/Immortal_Like.sql</UpdateDatabase>
      <UpdateDatabase>XML/Immortal_Like.xml</UpdateDatabase>
    </OnModActivated>
  </Actions>
</Mod>

XML:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 12/22/2022 12:33:23 AM -->
<GameData>
    <HandicapInfos>
        <Update>
            <Set Help="TXT_KEY_HANDICAP_IMMORTAL_LIKE_HELP" Description="TXT_KEY_HANDICAP_IMMORTAL_LIKE"/>
            <Where Type="HANDICAP_WARLORD"/>
        </Update>
    </HandicapInfos>
    <Language_en_US>
        <Row Tag="TXT_KEY_HANDICAP_IMMORTAL_LIKE">
            <Text>Immortal-Like</Text>
        </Row>
        <Row Tag="TXT_KEY_HANDICAP_IMMORTAL_LIKE_HELP">
            <Text>A custom difficulty made by Xemor, that overrides Warlock</Text>
        </Row>
    </Language_en_US>
</GameData>

SQL:
UPDATE HandicapInfos 
SET 
HappinessDefault = '9', 
NumCitiesUnhappinessMod = '100', 
PopulationUnhappinessMod = '100', 
RouteCostPercent = '100', 
UnitCostPercent = '100', 
BuildingCostPercent = '100', 
PolicyPercent = '100', 
CityProductionNumOptionsConsidered = '1', 
TechNumOptionsConsidered = '1', 
PolicyNumOptionsConsidered = '2', 
AttitudeChange = '-1', 
NoTechTradeModifier = '30', 
TechTradeKnownModifier = '0', 
BarbCampGold = '25', 
BarbSpawnMod = '0', 
BarbarianBonus = '10', 
AIBarbarianBonus = '60', 
EarliestBarbarianReleaseTurn = '0', 
BarbarianLandTargetRange = '7', 
BarbarianSeaTargetRange = '18', 
AIStartingDefenseUnits = '2', 
AIStartingWorkerUnits = '2', 
AIStartingExploreUnits = '2', 
AIDeclareWarProb = '100', 
AIWorkRateModifier = '0', 
AIUnhappinessPercent = '110', 
AIGrowthPercent = '65', 
AITrainPercent = '100', 
AIWorldTrainPercent = '100', 
AIConstructPercent = '60', 
AIWorldConstructPercent = '100', 
AICreatePercent = '65', 
AIWorldCreatePercent = '100', 
AIBuildingCostPercent = '100', 
AIUnitCostPercent = '100', 
AIUnitSupplyPercent = '40', 
AIUnitUpgradePercent = '100', 
AIPerEraModifier = '-4', 
AIAdvancedStartPercent = '150', 
AIFreeXP = '0', 
AIFreeXPPercent = '0'
WHERE Type = 'HANDICAP_WARLORD';

I cannot see the changes reflected in the database when loading it, or any errors in the database.log
 

Xemor

Chieftain
Joined
Dec 21, 2022
Messages
2
Here is my mod attached and zipped
 

Attachments

  • NewDifficulty (v 1).zip
    2.4 KB · Views: 5

ghost toast

Prince
Joined
Apr 29, 2022
Messages
346

ghost toast

Prince
Joined
Apr 29, 2022
Messages
346
Your SQL looks like it could possibly be written incorrectly
Here is an example of how it should look.

UPDATE Buildings
SET Cost = 1900
WHERE Type IN ('BUILDING_TEMPLE', 'BUILDING_SHRINE');

Or another example is this here

UPDATE Leader_Flavors
SET Flavor = round((20 + Flavor) * 1.5)
WHERE FlavorType = 'FLAVOR_EXPANSION';

I found the examples here on this forum page. It is also a great SQL tutorial.


Im not that familiar with SQL I'm just starting to get the hang of it myself, but to me I think you wrote yours wrong.
I'm just now myself starting to venture into SQL and lua. There is a lot for me to still learn.

When I get some time to look at your mod and test it's functionality I'll re write your sql so it will be correct.

Another thing could be the mod info file. I believe you need the import to be set to true should be 1's instead of 0's

In nexus buddy when you highlight a files name on the right hand side the import option should come up. The default is false but it is often needed to be set true.
 
Last edited:

ghost toast

Prince
Joined
Apr 29, 2022
Messages
346
I follow

whoward69


He is great with helping and explaining things on the forum for people.

I have read through many of his postings just to learn. He seems to be a very very capable coder.
 
Top Bottom