Wanting to replace Japan's Civ Trait with new Trait

Cagarustus

Prince
Joined
Mar 9, 2017
Messages
386
Hi,

I'm trying to buff Japan by making their Civ Trait the same as Civ 5's: all units deal full damage even when injured.

I've given the code a crack, but it's not working. I've attempted to delete the existing Trait (ADJACENT_DISTRICTS), and then create the new one (TRAIT_CIVILIZATION_BUSHIDO).



DELETE FROM Types
WHERE Type='TRAIT_CIVILIZATION_ADJACENT_DISTRICTS';

INSERT INTO DynamicModifiers (ModifierType, CollectionType, EffectType) VALUES
('MODIFIER_PLAYER_UNIT_ADJUST_NO_REDUCTION_DAMAGE', 'COLLECTION_PLAYER_UNITS', 'EFFECT_ADJUST_UNIT_NO_REDUCTION_DAMAGE');

*My goal here is to apply the 'No Reduction Damage' taken from ABILITY_SAMURAI to All Player Units.

INSERT INTO Types (Type, Kind) VALUES
('MODIFIER_PLAYER_UNIT_ADJUST_NO_REDUCTION_DAMAGE', 'KIND_MODIFIER'),
('TRAIT_CIVILIZATION_BUSHIDO', 'KIND_TRAIT');

INSERT INTO Traits (Name, Description, TraitType)
VALUES ('LOC_TRAIT_CIVILIZATION_BUSHIDO_NAME', 'LOC_TRAIT_CIVILIZATION_BUSHIDO_DESCRIPTION', 'TRAIT_CIVILIZATION_BUSHIDO');

INSERT INTO TraitModifiers (TraitType, ModifierId)
VALUES ('TRAIT_CIVILIZATION_BUSHIDO', 'JAPAN_NEW_TRAIT');

INSERT INTO Modifiers (ModifierId, ModifierType)
VALUES ('JAPAN_NEW_TRAIT', 'MODIFIER_PLAYER_UNIT_ADJUST_NO_REDUCTION_DAMAGE');

INSERT INTO CivilizationTraits (CivilizationType, TraitType)
VALUES ('CIVILIZATION_JAPAN', 'TRAIT_CIVILIZATION_BUSHIDO');

INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES
('JAPAN_NEW_TRAIT', 'NoReduction', 1);

I've also tried to insert new text into the game to reflect the new Trait. But, because I have deleted the existing Trait (as above), on the Loading Screen and in-game, the Civ Trait is blank. How do I insert the text of the New Trait? The new text is shown on the Civ Selection screen.

INSERT OR REPLACE INTO LocalizedText (Tag, Language, Text) VALUES
('LOC_TRAIT_CIVILIZATION_ADJACENT_DISTRICTS_NAME', 'en_US', 'Bushido'),
('LOC_TRAIT_CIVILIZATION_BUSHIDO_NAME', 'en_US', 'Bushido'),
('LOC_TRAIT_CIVILIZATION_ADJACENT_DISTRICTS_DESCRIPTION', 'en_US', 'Units fight as though they were at full strength even when damaged.'),
('LOC_TRAIT_CIVILIZATION_BUSHIDO_DESCRIPTION', 'en_US', 'Units fight as though they were at full strength even when damaged.');

INSERT INTO BaseGameText (Tag, Text) VALUES
('LOC_TRAIT_CIVILIZATION_BUSHIDO_NAME', 'Bushido'),
('LOC_TRAIT_CIVILIZATION_BUSHIDO_DESCRIPTION', 'Units fight as though they were at full strength even when damaged.');


I'd really appreciate any assistance on this Mod. Cheers.
 
Last edited:
Post some logs, database.log for sure.

For starter - MODIFIER_PLAYER_UNIT_ADJUST_NO_REDUCTION_DAMAGE works only for one unit (it's used to define Samurai's Ability), you probably need a new modifer that uses collection COLLECTION_PLAYER_UNITS.

Also, just curious, why do you delete the original trait? I mean, in the end yes, but for testing it's better to leave it, so you will not have errors from deleting it, should there be inces, mixed with new trait code.
 
This one I've figured out, thanks to Senshi's Nobunaga. He did a similar thing but with the Leader instead. I forgot to define the TRAIT_CIVILIZATION_BUSHIDO under the UnitAbilityModifiers; and I used the wrong modifier. I should've used: MODIFIER_PLAYER_UNITS_GRANT_ABILITY.
 
Back
Top Bottom