Lord Shadow
Admiral
- Joined
- Oct 14, 2005
- Messages
- 2,177
Hey there, guys. Here in my attempt to push the envelop with a complete lack of Lua understanding, I've run into a couple of issues with traits I want to assign to my custom leader and their UU.
First, the leader:
This is the relevant chunk with the modifiers, arguments and all. The culture/science/gold/faith bits work correctly since the vanilla modifiers and effects are clear and straightforward.
The problem resides with the flat production bonus I'm trying to apply to the Capital (+2). The class of EFFECT_ADJUST_PLAYER_YIELD_CHANGE_PER_TRIBUTARY is Players. I tried to adjust that scope to the player's Capital (COLLECTION_PLAYER_CAPITAL_CITY), but it doesn't seem to work.
Industrial and Militaristic City-states have initial bonuses which boost production in the Capital, but I can't find a way to take that kind of effect and apply it to the Capital multiplied by the amount of Suzerain'd city-states.
Now, the other issue is with the UU's ability:
I tried to invert the Carolean's "bonus strength per unused move". Figured it'd make sense for a lancer cavalry unit to accumulate said bonus per used move.
The thing is the moving parts of the Carolean's ability appear to be pretty much custom-made for that specific effect. Haven't found a way to invert the effect, and negative values are apparently ignored in-game in that context.
Bonus track! Is there a way to make the first two city names be fixed, and only then kick off with the randomization? I know you can tweak the sample size with RandomCityNameDepth, but i don't want to make it 2 and have that stick for the rest of the cities. Just make sure the second city's name is fixed just like the Capital's.
The city names list associated to the leader has a SortIndex parameter, set to -1 in the template I originally took for reference. Would changing that for the cities in question to 1 or 2 allow me to do what I want?
Anyway, any and all ideas appreciated! Thanks in advance.
First, the leader:
Code:
-----------------------------------------------
-- DynamicModifiers
-----------------------------------------------
INSERT INTO DynamicModifiers
(ModifierType, CollectionType, EffectType )
VALUES ('MODTYPE_CAP_PROD_PER_TRIBUTARY', 'COLLECTION_PLAYER_CAPITAL_CITY', 'EFFECT_ADJUST_PLAYER_YIELD_CHANGE_PER_TRIBUTARY' );
-----------------------------------------------
-- Modifiers
-----------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType )
VALUES ('MODIFIER_CAP_PROD_PER_TRIBUTARY', 'MODTYPE_CAP_PROD_PER_TRIBUTARY' ),
('MODIFIER_CULTURE_PER_TRIBUTARY', 'MODIFIER_PLAYER_ADJUST_YIELD_MODIFIER_PER_TRIBUTARY' ),
('MODIFIER_SCIENCE_PER_TRIBUTARY', 'MODIFIER_PLAYER_ADJUST_YIELD_MODIFIER_PER_TRIBUTARY' ),
('MODIFIER_GOLD_PER_TRIBUTARY', 'MODIFIER_PLAYER_ADJUST_YIELD_MODIFIER_PER_TRIBUTARY' ),
('MODIFIER_FAITH_PER_TRIBUTARY', 'MODIFIER_PLAYER_ADJUST_YIELD_MODIFIER_PER_TRIBUTARY' );
-----------------------------------------------
-- TraitModifiers
-----------------------------------------------
INSERT INTO TraitModifiers
(TraitType, ModifierId )
VALUES ('TRAIT_LEADER_IMPERIAL_CONSOLIDATOR', 'MODIFIER_CAP_PROD_PER_TRIBUTARY' ),
('TRAIT_LEADER_IMPERIAL_CONSOLIDATOR', 'MODIFIER_CULTURE_PER_TRIBUTARY' ),
('TRAIT_LEADER_IMPERIAL_CONSOLIDATOR', 'MODIFIER_SCIENCE_PER_TRIBUTARY' ),
('TRAIT_LEADER_IMPERIAL_CONSOLIDATOR', 'MODIFIER_GOLD_PER_TRIBUTARY' ),
('TRAIT_LEADER_IMPERIAL_CONSOLIDATOR', 'MODIFIER_FAITH_PER_TRIBUTARY' );
-----------------------------------------------
-- ModifierArguments
-----------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES ('MODIFIER_CAP_PROD_PER_TRIBUTARY', 'YieldType', 'YIELD_PRODUCTION' ),
('MODIFIER_CAP_PROD_PER_TRIBUTARY', 'Amount', 2 ),
('MODIFIER_CULTURE_PER_TRIBUTARY', 'YieldType', 'YIELD_CULTURE' ),
('MODIFIER_CULTURE_PER_TRIBUTARY', 'Amount', 3 ),
('MODIFIER_SCIENCE_PER_TRIBUTARY', 'YieldType', 'YIELD_SCIENCE' ),
('MODIFIER_SCIENCE_PER_TRIBUTARY', 'Amount', 3 ),
('MODIFIER_GOLD_PER_TRIBUTARY', 'YieldType', 'YIELD_GOLD' ),
('MODIFIER_GOLD_PER_TRIBUTARY', 'Amount', 3 ),
('MODIFIER_FAITH_PER_TRIBUTARY', 'YieldType', 'YIELD_FAITH' ),
('MODIFIER_FAITH_PER_TRIBUTARY', 'Amount', 3 );
The problem resides with the flat production bonus I'm trying to apply to the Capital (+2). The class of EFFECT_ADJUST_PLAYER_YIELD_CHANGE_PER_TRIBUTARY is Players. I tried to adjust that scope to the player's Capital (COLLECTION_PLAYER_CAPITAL_CITY), but it doesn't seem to work.
Industrial and Militaristic City-states have initial bonuses which boost production in the Capital, but I can't find a way to take that kind of effect and apply it to the Capital multiplied by the amount of Suzerain'd city-states.
Now, the other issue is with the UU's ability:
Code:
-----------------------------------------------
-- Modifiers
-- This is where we attach the ModType made in "DynamicModifiers" to our "ModifierID" mentioned in the first section.
-----------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType, OwnerRequirementSetId, SubjectRequirementSetId, Permanent, NewOnly, RunOnce )
VALUES ('MODIFIER_WINGARDE_LANZENREITER_STRENGTH_USED_MOVES', 'MODIFIER_SINGLE_UNIT_ADJUST_COMBAT_FOR_UNUSED_MOVEMENT', NULL, NULL, 0, 0, 0 );
-- This one has a ReqSetID which means that it identifies for this modifier to run - it needs a requirement.
-----------------------------------------------
-- UnitAbilityModifiers
-- These setup the modifers for your ability by hooking your specified modifiers into the ability.
-- "UnitAbilityType" is the Unit's Ability to which you are inserting the "ModifierID", or the modifier, into.
-----------------------------------------------
INSERT INTO UnitAbilityModifiers
(UnitAbilityType, ModifierId )
VALUES ('ABILITY_WINGARDE_LANZENREITER_CHARGE', 'MODIFIER_WINGARDE_LANZENREITER_STRENGTH_USED_MOVES' ); -- Inserting the "More Strength per Used Moves" Modifier
-----------------------------------------------
-- ModifierArguments
-- This is where we further define the Modifiers.
-----------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES ('MODIFIER_WINGARDE_LANZENREITER_STRENGTH_USED_MOVES', 'Amount', -2 ); -- States that you adjust the strength by 2 per USED move (-2 per unused).
The thing is the moving parts of the Carolean's ability appear to be pretty much custom-made for that specific effect. Haven't found a way to invert the effect, and negative values are apparently ignored in-game in that context.
Bonus track! Is there a way to make the first two city names be fixed, and only then kick off with the randomization? I know you can tweak the sample size with RandomCityNameDepth, but i don't want to make it 2 and have that stick for the rest of the cities. Just make sure the second city's name is fixed just like the Capital's.
The city names list associated to the leader has a SortIndex parameter, set to -1 in the template I originally took for reference. Would changing that for the cities in question to 1 or 2 allow me to do what I want?
Anyway, any and all ideas appreciated! Thanks in advance.