Modding Yields

Elucidus

King
Joined
Mar 3, 2002
Messages
983
Location
USA
So I am trying to modify the Yieldchanges on a massive scale. I am trying to put add more granularity to the game so I can add more variance and more balance.

The first steps are done, but those were apparently straight forward.
Code:
UPDATE Improvement_YieldChanges
Set YieldChange = 5
WHERE ImprovementType = 'IMPROVEMENT_FARM' AND  YieldType = 'YIELD_FOOD';
as an example

But changing the Improvement_BonusYieldChanges and the Adjacency_Yieldchanges hasn't worked and I am not sure why.

Here are the codes I tried.
Code:
UPDATE Improvement_BonusYieldChanges
Set YieldChange = 5
WHERE ImprovementType = 'IMPROVEMENT_CAMP' AND  YieldType = 'YIELD_PRODUCTION';
Code:
UPDATE Adjacency_YieldChanges
Set YieldChange = 5
WHERE Row ID = 'Farms_MedievalAdjacency' AND  YieldType = 'YIELD_FOOD' AND  AdjacentImprovement = 'IMPROVEMENT_FARM';
Am I trying to change the wrong tables in this case? Also how different or difficult will it be when I get to ModifierArguments?

Any help would be appreciated.
 
Code:
UPDATE Adjacency_YieldChanges
Set YieldChange = 5
WHERE ID = 'Farms_MedievalAdjacency' AND  YieldType = 'YIELD_FOOD' AND  AdjacentImprovement = 'IMPROVEMENT_FARM';

Code:
UPDATE Improvement_BonusYieldChanges
Set BonusYieldChange = 5
WHERE ImprovementType = 'IMPROVEMENT_CAMP' AND  YieldType = 'YIELD_PRODUCTION';
 
Hmm, that didn't work for either of them...I did add a tech/civic prereq to ensure i am getting the only one, but I don't think that would stop them both and if it is right shouldn't prevent either. Here is an example of what I have.

Code:
UPDATE Improvement_BonusYieldChanges
Set BonusYieldChange = 5
WHERE ImprovementType = 'IMPROVEMENT_CAMP' AND  YieldType = 'YIELD_PRODUCTION' AND  PrereqCivic = 'CIVIC_MERCANTILISM';

Code:
UPDATE Adjacency_YieldChanges
Set YieldChange = 5
WHERE ID = 'Farms_MedievalAdjacency' AND  YieldType = 'YIELD_FOOD' AND  AdjacentImprovement = 'IMPROVEMENT_FARM';

In the meantime I made mountains passable with 3 movement and that seems to have worked. So I am not completely crazy.
 
Doesn't look like anything is wrong, that I can tell.

Code:
[2824640.917] [Localization]: Validating Foreign Key Constraints...
[2824640.917] [Localization]: Passed Validation.
[2824640.926] [Configuration]: Validating Foreign Key Constraints...
[2824640.926] [Configuration]: Passed Validation.
[2824650.189] [FullTextSearch]: Initializing FullTextSearch
[2824650.547] [Gameplay]: Validating Foreign Key Constraints...
[2824650.555] [Gameplay]: Passed Validation.
[2824650.889] [Configuration]: Validating Foreign Key Constraints...
[2824650.889] [Configuration]: Passed Validation.
[2824675.454] [Gameplay]: Validating Foreign Key Constraints...
[2824675.463] [Gameplay]: Passed Validation.
[2824678.888] [FullTextSearch]: FTS - Creating Context
[2824679.032] [FullTextSearch]: FTS - Creating Context
[2824679.405] [FullTextSearch]: FTS - Creating Context
[2824730.143] [FullTextSearch]: FullTextSearch - Shutting down
 
This worked for me:

Code:
INSERT INTO Improvement_BonusYieldChanges (ImprovementType, YieldType, BonusYieldChange, PrereqTech, PrereqCivic) VALUES ('IMPROVEMENT_MINE', 'YIELD_PRODUCTION', 2, 'TECH_MINING', NULL);
 
If you're going to be writing SQL IMO you need to download a tool like SQLite Studio and set it up against the debug database, otherwise you will drive yourself crazy.

The reason those update statements likely don't work is you can only update where an existing record exists. If you need to create a new record (e.g. add a yield that doesn't already exist, like say, culture to farms) you have to insert.

Also beware with insert that if you insert and a record already exists it can cause a crash back to menu in game. (e.g. another mod also does the same insert). For those instances you can use INSERT OR REPLACE or INSERT OR IGNORE.
 
Back
Top Bottom