[NFP] RESOLVED:Unable to get science or culture from improvement adjacency

TreVor_ish

Prince
Joined
Sep 29, 2020
Messages
536
I was wondering, if that's juts me, but I can't get to work YieldChange in Adjacency_YieldChanges from an Improvement I added to the game, when it comes for YieldType: YIELD_SCIENCE or YIELD_CULTURE.
When I add gold or food everything works as intended, but using science or culture does not work.
Tried to get an additional culture or science from adjacent district or luxury, tooltip does give an information for a yield change for builder on intention to build a certain improvement correctly, but game does not change numbers (for now tested for science and culture).
Trying something similar to Nubian Pyramid but to no avail.

For now as a temporary I'm using: MODIFIER_SINGLE_PLOT_ADJUST_PLOT_YIELDS with: PLOT_ADJACENT_TO_LUXURY_REQUIREMENTS and PLOT_ADJACENT_TO_CAMPUS_REQUIREMENTS
which works as intended, but it does only give the bonus once (when adjacent) which isn't really what I'm looking for.
No errors in logs...just wondering if anyone had something similar.
 
Without the code to look at that you tried there's no way to determine what you might be doing wrong.

Database log and Modding log in this case will likely not give any error messages for an incompletely defined Adjacency_YieldChange. Since the Nubian Pyramid improvement and the Mission improvement both do exactly what you are attempting with Science adjacencies to Campus, etc., there is probably a code or logic error on your end.
 
Yeah, I know they do. That's why it was baffling why it works for gold but not for science or culture.
Anyway, here is the code:
Code:
INSERT INTO Improvement_Adjacencies (ImprovementType, YieldChangeId)
VALUES ('IMPROVEMENT_PARADISO', 'Paradiso_Luxury_Gold'),
       ('IMPROVEMENT_PARADISO', 'Paradiso_Luxury_Culture'),
       ('IMPROVEMENT_PARADISO', 'Paradiso_Campus_Science'),
       ('IMPROVEMENT_PARADISO', 'Paradiso_Entertainment_Gold');

INSERT INTO Adjacency_YieldChanges (ID, Description, YieldType, YieldChange, TilesRequired, AdjacentDistrict)
VALUES ('Paradiso_Campus_Science', 'Placeholder', 'YIELD_SCIENCE', 1, 1, 'DISTRICT_CAMPUS'),
       ('Paradiso_Entertainment_Gold', 'Placeholder', 'YIELD_GOLD', 1, 1, 'DISTRICT_ENTERTAINMENT_COMPLEX');

INSERT INTO Adjacency_YieldChanges (ID, Description, YieldType, YieldChange, TilesRequired, AdjacentResourceClass)
VALUES ('Paradiso_Luxury_Culture', 'Placeholder', 'YIELD_CULTURE', 1, 1, 'RESOURCECLASS_LUXURY'),
       ('Paradiso_Luxury_Gold', 'Placeholder', 'YIELD_GOLD', 1, 1, 'RESOURCECLASS_LUXURY');

note:
gold from entertainment complex and luxurys works but not culture or science.

EDIT:
OK Found a solution:
just needed to add science and culture yields to Improvement_YieldChanges with 0 YieldChange
and now those adjacency works
so something like this:
Code:
INSERT INTO Improvement_YieldChanges (ImprovementType, YieldType, YieldChange)
VALUES ('IMPROVEMENT_PARADISO', 'YIELD_FOOD', 1),
       ('IMPROVEMENT_PARADISO', 'YIELD_SCIENCE', 0),
       ('IMPROVEMENT_PARADISO', 'YIELD_CULTURE', 0),
       ('IMPROVEMENT_PARADISO', 'YIELD_GOLD', 1),
       ('IMPROVEMENT_PARADISO', 'YIELD_FAITH', 1);

resolves issue.
Case closed :)
 
Last edited:
Back
Top Bottom