Maximciv

Chieftain
Joined
May 12, 2019
Messages
5
Hi

i'm new to modding. all i did so far was alter some existing mods, and alter .xml files directly. my biggest problem is finding what to alter. because there are so many .xml files.

I'm trying to create a mod that removes the era points from goody huts(i like exploration and playing with lots of goody huts, but in this way i earn to much era points in the first few ages, which makes it hard to avoid a dark age in the last era). the mod is not working and i'm clueless to why, spent many hours trying. Database.log is not helping, it says everything is ok.

i tried with below lines, but all fail.
UPDATE Moments SET EraScore = 0 WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';
DELETE FROM Moments WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';
UPDATE Moments SET EraScore = 0 MomentType= 'MOMENT_GOODY_HUT_TRIGGERED';
DELETE FROM Moments WHERE MomentType= 'MOMENT_GOODY_HUT_TRIGGERED';

setting erascore in below line to 0 works though...
<Row MomentType="MOMENT_GOODY_HUT_TRIGGERED" Name="LOC_MOMENT_GOODY_HUT_TRIGGERED" Description="LOC_MOMENT_GOODY_HUT_TRIGGERED_DESCRIPTION" InstanceDescription="LOC_MOMENT_GOODY_HUT_TRIGGERED_INSTANCE_DESCRIPTION" InterestLevel="1" IconTexture="MomentSmall_Exploration" EraScore="0" MinimumGameEra="ERA_ANCIENT" MaximumGameEra="ERA_ANCIENT"/>

thanks for your time reading this!
 
If you were trying the quoted SQL from a mod (which you would have to be since SQL isn't used in base game files except to define game-tables), then the question is what did/does your modinfo file look like ? It's usually better to zip up and attach the mod from the game's Mods folder rather than providing modinfo file snippets and the like, however.
 
The first of the SQL commands you quoted
Code:
UPDATE Moments SET EraScore = 0 WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';
works just fine for me for altering the "EraScore" value to '0' for the row specified.

---------------

This line would not be desired in any case
Code:
UPDATE Moments SET EraScore = 0 MomentType= 'MOMENT_GOODY_HUT_TRIGGERED';
because if successful would set every row in the table to an EraScore value of '0' and the MomentType of all rows to 'MOMENT_GOODY_HUT_TRIGGERED'.

The game will not however implement such a line of code since there can only ever be one row in the table where the MomentType is designated as 'MOMENT_GOODY_HUT_TRIGGERED'.
 
If you were trying the quoted SQL from a mod (which you would have to be since SQL isn't used in base game files except to define game-tables), then the question is what did/does your modinfo file look like ? It's usually better to zip up and attach the mod from the game's Mods folder rather than providing modinfo file snippets and the like, however.

Hi
you are correct, should've done this from the start, it can be found attached, also my database.log file
i don't think there is a mistake in my .modinfo file because the rest of the code is working :(

The first of the SQL commands you quoted
Code:
UPDATE Moments SET EraScore = 0 WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';
works just fine for me for altering the "EraScore" value to '0' for the row specified.

---------------

This line would not be desired in any case
Code:
UPDATE Moments SET EraScore = 0 MomentType= 'MOMENT_GOODY_HUT_TRIGGERED';
because if successful would set every row in the table to an EraScore value of '0' and the MomentType of all rows to 'MOMENT_GOODY_HUT_TRIGGERED'.

The game will not however implement such a line of code since there can only ever be one row in the table where the MomentType is designated as 'MOMENT_GOODY_HUT_TRIGGERED'.

very odd, for me it doesn't work, when i run into a goody hut, i still get an era point, no matther which line of the 4 i use.
above mistake in the code was a typo when typing it here, i did not try that one (and i think i need to add a , for it change all lines, not sure though).
in the attached mod i use the code "UPDATE Moments SET EraScore = 0 WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';

maybe i'm missing something small :/

thanks for both your comments already :)
 

Attachments

  • goodyhuts ByMaXim.zip
    61.9 KB · Views: 155
The problem was in your SQL file. But there was no problem in your actual code. Either your comments were confusing the game or else you somehow got a hidden character added to the file which was not allowing the game to correctly read your SQL code. Simply deleting all the comment lines and everything above the first executable line of code solved the issue, as so
Code:
UPDATE Improvements SET TilesPerGoody = 32, GoodyRange = 2 WHERE ImprovementType = 'IMPROVEMENT_GOODY_HUT';

UPDATE Moments SET EraScore = 0 WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';

UPDATE Improvements SET DispersalGold = 20 WHERE ImprovementType = 'IMPROVEMENT_GOODY_HUT';
 
The problem was in your SQL file. But there was no problem in your actual code. Either your comments were confusing the game or else you somehow got a hidden character added to the file which was not allowing the game to correctly read your SQL code. Simply deleting all the comment lines and everything above the first executable line of code solved the issue, as so
Code:
UPDATE Improvements SET TilesPerGoody = 32, GoodyRange = 2 WHERE ImprovementType = 'IMPROVEMENT_GOODY_HUT';

UPDATE Moments SET EraScore = 0 WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';

UPDATE Improvements SET DispersalGold = 20 WHERE ImprovementType = 'IMPROVEMENT_GOODY_HUT';

I must be doing something very wrong then... I now made a new mod, only with below line:
UPDATE Moments SET EraScore = 0 WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';

and it's still not working :( i'm giving up.

thanks for your help though.
 
Have you tried:
Code:
DELETE FROM Moments WHERE MomentType = 'MOMENT_GOODY_HUT_TRIGGERED';

Yes, i tried all below:
UPDATE Moments SET EraScore = 0 WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';
DELETE FROM Moments WHERE Name= 'LOC_MOMENT_GOODY_HUT_TRIGGERED';
UPDATE Moments SET EraScore = 0 WHERE MomentType= 'MOMENT_GOODY_HUT_TRIGGERED';
DELETE FROM Moments WHERE MomentType= 'MOMENT_GOODY_HUT_TRIGGERED';
 
Top Bottom