[Help] Trying to increase healing for units adjacent to a specified building.

Donnervogel

Chieftain
Joined
Jan 5, 2023
Messages
4
I'm working on a civilization mod, with the plan being to have units heal for more when in or adjacent to a district with the civ's unique building (a Shrine replacement).

I found the code for the God of Healing pantheon to see how it checks for adjacency, using the Requirement Set defined below:

<RequirementSetId>PLOT_ADJACENT_INCLUDE_HOLY_SITE</RequirementSetId>
<RequirementId>REQUIRES_PLOT_ADJACENT_HOLY_SITE</RequirementId>

I just wasn't sure how to adapt this so as to create a Requirement Set that checks for the adjacent building, rather than the district. Would anyone know how to go about that? Also, would I need to create a new check for the unique building, or could I have it check for the original building that's being replaced? And would the adjacency check include the district itself, or just the tiles next to it?

EDIT: I found the “REQUIREMENT_PLOT_ADJACENT_BUILDING_TYPE_MATCHES” RequirementType that seems like it would help here, but I can't get my code working still
 
Last edited:
I found modifiers and requirements that seem like they'd let me increase unit healing and restrict it to units adjacent to a Shrine, but the code isn't working in-game. See my code below:

INSERT INTO RequirementSets
(RequirementSetId, RequirementSetType )
VALUES ('REQ_DVG_ADJACENT_SHRINE', 'REQUIREMENTSET_TEST_ALL' );

INSERT INTO RequirementSetRequirements
(RequirementSetId, RequirementId )
VALUES ('REQ_DVG_ADJACENT_SHRINE', 'REQUIRES_DVG_ADJACENT_TO_SHRINE');

INSERT INTO Requirements
(RequirementId, RequirementType )
VALUES ('REQUIRES_DVG_ADJACENT_TO_SHRINE', 'REQUIREMENT_PLOT_ADJACENT_BUILDING_TYPE_MATCHES' );

INSERT INTO RequirementArguments
(RequirementId, Name, Value )
VALUES ('REQUIRES_DVG_ADJACENT_TO_SHRINE', 'BuildingType', 'BUILDING_SHRINE' );

INSERT INTO TraitModifiers
(TraitType, ModifierId )
VALUES ('TRAIT_CIVILIZATION_DVG_BUILDING_CIVNAME_UINAME', 'MODIFIER_DVG_UINAME_HEALING' );

INSERT INTO Modifiers
(ModifierId, ModifierType, SubjectRequirementSetId )
VALUES ('MODIFIER_DVG_UINAME_HEALING', 'MODIFIER_PLAYER_UNITS_ADJUST_HEAL_PER_TURN', 'REQ_DVG_ADJACENT_SHRINE', );

INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES ('MODIFIER_DVG_UINAME_HEALING', 'Amount', 50 );
(For context, the '50' is a placeholder value just for testing to make sure it's working as intended—the actual value will be lower)

I've also tried, just for the sake of testing the logic, adding the Modifier without a requirement, and another attempt using an ATTACH modifier, but there still does not seem to be any effect for any units in-game (code below).
INSERT INTO Modifiers
(ModifierId, ModifierType, )
VALUES ('MODIFIER_DVG_UINAME_HEALING', 'MODIFIER_PLAYER_UNITS_ADJUST_HEAL_PER_TURN' );

INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES ('MODIFIER_DVG_UINAME_HEALING', 'Amount', 50 );
INSERT INTO Modifiers
(ModifierId, ModifierType, )
VALUES ('MODIFIER_DVG_UINAME_HEALING', 'MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER', ),
('MODIFIER_DVG_UINAME_HEALING_AMOUNT', 'MODIFIER_PLAYER_UNIT_ADJUST_HEAL_PER_TURN', );

INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES ('MODIFIER_DVG_UINAME_HEALING', 'ModifierId', 'MODIFIER_DVG_UINAME_HEALING_AMOUNT' ),
('MODIFIER_DVG_UINAME_HEALING_AMOUNT', 'Amount', 50 );

In any case, this has been stumping me for a few days and I can't seem to figure out what I'm missing. Any and all help, advice, or follow-up questions are appreciated!
 
Top Bottom