[GS] Leader UA causes crash to desktop (loading/leader screen)

maconnolly

Warlord
Joined
Jun 3, 2019
Messages
209
Evening all. I hope this community can help.

I am attempting to create myself a mod - as much to learn the structure as to harness the improvements to gameplay. To this end, I've set myself a task of creating a new civilization, with a leader. The makeup follows a fairly simplistic/vanilla pattern - the civilization has a Unique Ability, Unique Unit and Unique Improvement. On top of this, the leader has a Unique Ability.

Civilization UA: Let the Gods feed us!
Civilization UU: Werejaguar
Civilization UI: Colossal Head
Leader UA: Fear not exploration, for God will guide us

At this stage, there are no graphical elements to this mod - which is why there is an absence of these in the screenshots below.

Disclaimer: This is in no way intended to plagiarise the work of Durkle - who I note has uploaded the Olmec Empire to the Steam Workshop. I began creating this prior to realising their mod existed and my intention is simply to learn; not to publish. If the author does read this - I have shamelessly copied your Unique Improvement idea/code simply to get that 'in' and working.

On to my situation. As far as I can tell, the unique civilization items (Ability, Unit and Improvement) all work fine. I haven't tested them all in-game, but I can get into the game with those things 'active' and seemingly functional. Through many iterations, I could not get the Leader_UA.sql file to load correctly. In this scenario, the game starts fine, albeit without this Leader UA activated.

You'll note from the below that only the Civilization UA has loaded; this screenshot was taken from one of the various iterations where the Leader UA generated an error:

Spoiler :
LeaderUA_notLoaded.png


Having iterated dozens of times, I believe I've finally got my SQL syntax accurate. Various missing commas later, none of the files generate any errors in either Database.log or Modding.log.

The leader UA, however, causes my game to crash to desktop within a second or two of arriving at the leader/loading screen. As illustrated in the screenshot below, I think all of the elements of the mod are loading fine from a syntax point of view, as they all appear on the screen:

Spoiler :
LeaderUA_loaded_CTD.png


If my logic is right up until this point, then I think there's simply some tragic failure of mine to stitch together the various INSERT functions. After staring at this for hours, spread across multiple days, my brain is broken enough that I'm reaching out here for help. What you'll see below in my full Leader_UA.sql code is a mish-mash of different INSERT functions that equal a near-immediate crash. I've probably ended up going down numerous rabbit-holes when a simple reference to the ALPINE_TRAINING_IGNORE_HILLS is what I am after.

My goal is simply to grant Settlers and Builders the ability to ignore the movement penalties imposed by hills. Even whilst writing this, I realise a few mistakes/assumptions I have made to this point:

1. CLASS_LANDCIVILIAN includes a number of unit types beyond Settlers/Builders. This is an assumption I made and I only checked which units are part of this class as I wrote this.

2. I haven't actually tried to point to the ALPINE_TRAINING_IGNORE_HILLS ModifierID that exists in the game. I followed a guide/post (clearly not very well) that I found yesterday and ended up with my convoluted mess below. My fault, not the guide's.

Spoiler :
Code:
-----------------------------------------------
-- Types
-----------------------------------------------

INSERT INTO    Types
        (Type,                                    Kind            )
VALUES    ('TRAIT_LEADER_FEAR_NOT_EXPLORATION',    'KIND_TRAIT'    ),
        ('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST',    'KIND_ABILITY'    );

-----------------------------------------------
-- TypeTags
-----------------------------------------------

INSERT INTO TypeTags

        (Type,                                    Tag                        )
VALUES    ('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST',    'CLASS_LANDCIVILIAN'    );

-----------------------------------------------
-- UnitAbilities
-----------------------------------------------

INSERT INTO UnitAbilities
        (UnitAbilityType,                        Name,                                            Description,                                            Inactive    )
VALUES    ('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_NAME',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_DESCRIPTION',        0            );

-----------------------------------------------
-- Note on above: Have attempted executing without the use of the 'Inactive' column and produces same result.
-----------------------------------------------

-----------------------------------------------
-- UnitAbilityModifiers
-----------------------------------------------

INSERT INTO UnitAbilityModifiers
        (UnitAbilityType,                            ModifierID                                )
VALUES    ('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST',        'MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST'    );

-----------------------------------------------
-- Modifiers
-----------------------------------------------

INSERT INTO    Modifiers
        (ModifierId,                                ModifierType,                            RunOnce,    Permanent    )
VALUES    ('MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST',    'MODIFIER_PLAYER_UNITS_GRANT_ABILITY',    1,            1            );

-----------------------------------------------
-- ModifierArguments
-----------------------------------------------

INSERT INTO    ModifierArguments
        (ModifierId,                                Name,            Value                                    )
VALUES    ('MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST',    'AbilityType',    'ABILITY_PO_NGBE_IGNORE_TERRAIN_COST'    );

-----------------------------------------------
-- TraitModifiers
-----------------------------------------------

INSERT INTO    TraitModifiers
        (TraitType,                                ModifierId)
VALUES    ('TRAIT_LEADER_FEAR_NOT_EXPLORATION',    'MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST');

-----------------------------------------------
-- Traits
-----------------------------------------------

INSERT INTO    Traits
        (TraitType,                                Name,                                            Description                                            )
VALUES    ('TRAIT_LEADER_FEAR_NOT_EXPLORATION',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_NAME',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_DESCRIPTION'    );
  
-----------------------------------------------
-- LeaderTraits
-----------------------------------------------

INSERT INTO    LeaderTraits
        (LeaderType,            TraitType                            )
VALUES    ('LEADER_MC_PO_NGBE',    'TRAIT_LEADER_FEAR_NOT_EXPLORATION'    );

At this stage, I will gladly take someone offering up the right way to do this, with example code or actual code. I would equally be grateful for any advice/pointers/tips, however non-specific, as clearly I don't know what I am doing.
 
Last edited:
This is total shot in the dark, but should it be `CLASS_LAND_CIVILIAN` (with the _)? I haven't created mods myself, but I know from looking at some other source code that uses the convention `CLASS_LAND_COMBAT_` etc.
 
This is total shot in the dark, but should it be `CLASS_LAND_CIVILIAN` (with the _)? I haven't created mods myself, but I know from looking at some other source code that uses the convention `CLASS_LAND_COMBAT_` etc.

So on the specific class referenced, I'm sure it is indeed CLASS_LANDCIVILIAN. I looked that up and have just checked again. I included the mention of it as a footnote in case anyone reading this saw the intent to apply to Settlers/Builders and noted the class includes other units.

Fundamentally, the code is correct in the sense that all references are valid (in isolation, at least) and the syntax is error-free as it executes and loads. I think I have a complete logic screw-up and I've looked at it so long that I've lost myself in it.

I'll be looking again with fresh eyes tomorrow but in the meantime if anyone can decode the mess and help out, I would be so grateful.
 
OK, so 24 hours later and I have completely re-done the code for Leader_UA.sql - with a refreshed pair of eyes and using the Creating and attaching modifiers guide available on this site.

Suffice to say, I have code that looks completely different - it's cleaner and everything executes and the game loads. However, I am clearly missing something - as neither the Leader UA nor the Civilization UA are providing the functionality changes I had hoped.

To update (from first post), the Leader UA should allow Builders to suffer no movement penalty on hills; inheriting the ABILITY_ALTITUDE_TRAINING ability and applying it if UNIT_IS_BUILDER. The Civilization UA should give a boost to Shrines and Temples - which should provide +2 Food alongside their faith yield.

Eventually, I want to extend the Leader UA to also apply to Settlers - but a quick look in the game code suggests this will require defining a new UNIT_IS_SETTLER SubjectRequirementSetId, which I'm only going to tackle once I have this first part working. I suspect that for the Builder ability, I am probably referencing the 'wrong thing' in the chain; or that perhaps the thing I am referencing inherently can't apply to the unit type I am trying to apply it to.

I am attaching my code below, in the hope that someone can assist. Thank you in advance should someone pick this up! Naturally, I'll be having another go tomorrow...

Leader UA:

Spoiler :
Code:
-----------------------------------------------
-- Types
-----------------------------------------------

INSERT INTO    Types
        (Type,                                    Kind            )
VALUES    ('TRAIT_LEADER_FEAR_NOT_EXPLORATION',    'KIND_TRAIT'    );

-----------------------------------------------
-- Traits
-----------------------------------------------

INSERT INTO    Traits
        (TraitType,                                Name,                                            Description                                            )
VALUES    ('TRAIT_LEADER_FEAR_NOT_EXPLORATION',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_NAME',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_DESCRIPTION'    );
       
-----------------------------------------------
-- LeaderTraits
-----------------------------------------------

INSERT INTO    LeaderTraits
        (LeaderType,            TraitType                            )
VALUES    ('LEADER_MC_PO_NGBE',    'TRAIT_LEADER_FEAR_NOT_EXPLORATION'    );

-----------------------------------------------
-- Modifiers
-----------------------------------------------

INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, SubjectRequirementSetId)
VALUES ('TRAIT_GRANT_SETTLERS_BUILDERS_ALTITUDE_TRAINING', 'MODIFIER_PLAYER_UNITS_GRANT_ABILITY', '1', '1', 'UNIT_IS_BUILDER');

-----------------------------------------------
-- TraitModifiers
-----------------------------------------------

INSERT INTO TraitModifiers (TraitType, ModifierId)
VALUES ('TRAIT_LEADER_FEAR_NOT_EXPLORATION', 'TRAIT_GRANT_SETTLERS_BUILDERS_ALTITUDE_TRAINING');

-----------------------------------------------
-- ModifierArguments
-----------------------------------------------

INSERT INTO ModifierArguments (ModifierId, Name, Value)
VALUES ('TRAIT_GRANT_SETTLERS_BUILDERS_ALTITUDE_TRAINING', 'UnitAbilityType', 'ABILITY_ALTITUDE_TRAINING');

Civilization UA:

Spoiler :
Code:
-----------------------------------------------
-- Types
-----------------------------------------------

INSERT INTO    Types
        (Type,                                            Kind            )
VALUES    ('TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US',            'KIND_TRAIT'    ),
        ('MODTYPE_LET_THE_GODS_FEED_US_FOOD_YIELD_INCREASE_IN_RELIGIOUS_DISTRICT',    'KIND_MODIFIER'    );

-----------------------------------------------
-- Traits
-----------------------------------------------

INSERT INTO    Traits   
        (TraitType,                                Name,                                            Description                                            )
VALUES    ('TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US',    'LOC_TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US_NAME',    'LOC_TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US_DESCRIPTION'    );
       
-----------------------------------------------
-- CivilizationTraits
-----------------------------------------------

INSERT INTO    CivilizationTraits
        (CivilizationType,                TraitType                            )
VALUES    ('CIVILIZATION_MC_OLMEC',    'TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US'    );

-----------------------------------------------
-- TraitModifiers
-----------------------------------------------

INSERT INTO    TraitModifiers   
        (TraitType,                                ModifierId                                        )
VALUES    ('TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US',    'MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD'        ),
        ('TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US',    'MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD'        );

-----------------------------------------------
-- EmergencyBuffs
-----------------------------------------------

-----------------------------------------------
-- EmergencyRewards
-----------------------------------------------

-----------------------------------------------
-- Modifiers
-----------------------------------------------

INSERT INTO    Modifiers
        (ModifierId,                                        ModifierType,            RunOnce,    Permanent    )
VALUES    ('MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD',        'MODTYPE_LET_THE_GODS_FEED_US_FOOD_YIELD_INCREASE_IN_RELIGIOUS_DISTRICT',    1,            1            ),
        ('MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD',        'MODTYPE_LET_THE_GODS_FEED_US_FOOD_YIELD_INCREASE_IN_RELIGIOUS_DISTRICT',    1,            1            );

-----------------------------------------------
-- DynamicModifiers
-----------------------------------------------

INSERT INTO    DynamicModifiers
        (ModifierType,                                    CollectionType,                    EffectType                                        )
VALUES    ('MODTYPE_LET_THE_GODS_FEED_US_FOOD_YIELD_INCREASE_IN_RELIGIOUS_DISTRICT',    'COLLECTION_PLAYER_CITIES',        'EFFECT_ADJUST_BUILDING_YIELD_CHANGE'            );


-----------------------------------------------
-- ModifierArguments
-----------------------------------------------

INSERT INTO    ModifierArguments
        (ModifierId,                                            Name,                            Value                                    )
VALUES    ('MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD',            'BuildingType',                    'BUILDING_SHRINE'                        ),
        ('MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD',            'YieldType',                    'YIELD_FOOD'                            ),
        ('MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD',            'Amount',                        2                                        ),
        ('MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD',            'BuildingType',                    'BUILDING_TEMPLE'                        ),
        ('MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD',            'YieldType',                    'YIELD_FOOD'                            ),
        ('MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD',            'Amount',                        2                                        );
 
The reason your Leader Ability is not working is that ABILITY_ALTITUDE_TRAINING only applies to CLASS_RELIGIOUS_ALL.

CLASS_RELIGIOUS_ALL is assigned only to these (from table "TypeTags"):
Code:
Type	Tag
ABILITY_ALTITUDE_TRAINING	CLASS_RELIGIOUS_ALL
UNIT_MISSIONARY	CLASS_RELIGIOUS_ALL
UNIT_APOSTLE	CLASS_RELIGIOUS_ALL
UNIT_INQUISITOR	CLASS_RELIGIOUS_ALL
UNIT_GURU	CLASS_RELIGIOUS_ALL
Builders and Settlers aren't included. The Modifier that ABILITY_ALTITUDE_TRAINING uses can be attached to other sorts of units, but the ability itself cannot be used by other types of units without re-defining the "Tags" the Ability is valid for in table "TypeTags". The SubjectRequirementSetId here will not over-ride this behavior.
Code:
INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, SubjectRequirementSetId)
VALUES ('TRAIT_GRANT_SETTLERS_BUILDERS_ALTITUDE_TRAINING', 'MODIFIER_PLAYER_UNITS_GRANT_ABILITY', '1', '1', 'UNIT_IS_BUILDER');
Mt. Everest seems like it gets around this issue but it actually does not. What it does is bypasses the TypeTags table to attach the Ability directly to all units via ModifierType MODIFIER_ALL_UNITS_GRANT_ABILITY but the effect of this is only enacted on those units that move adjacent to Mt Everest.

The reason you were getting CTD before was that your earlier code was circular logic in this portion :
Code:
INSERT INTO UnitAbilityModifiers
        (UnitAbilityType,                            ModifierID                                )
VALUES    ('ABILITY_PO_NGBE_IGNORE_TERRAIN_COST',        'MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST'    );

-----------------------------------------------
-- Modifiers
-----------------------------------------------

INSERT INTO    Modifiers
        (ModifierId,                                ModifierType,                            RunOnce,    Permanent    )
VALUES    ('MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST',    'MODIFIER_PLAYER_UNITS_GRANT_ABILITY',    1,            1            );

-----------------------------------------------
-- ModifierArguments
-----------------------------------------------

INSERT INTO    ModifierArguments
        (ModifierId,                                Name,            Value                                    )
VALUES    ('MODIFIER_PO_NGBE_IGNORE_TERRAIN_COST',    'AbilityType',    'ABILITY_PO_NGBE_IGNORE_TERRAIN_COST'    );
The Unitability had a modifier attached to it for which that modifier then proceeded to grant that same original Unitability.

And when a Unitability is granted through a TraitModifier, the Unitability needs to be set as Inactive = true or else all units that can qualify for the ability regardless of who owns said unit(s) will be given the Ability. Since Builders and Settlers are not religious units, "Inactive" would appear to not matter when in fact it does -- it only seems to not have any effect because Settlers and Builders aren't in the CLASS_RELIGIOUS_ALL and in your earlier crashy-code the issue was circular logic which the game could not resolve.


So far as you civilization ability I don't see anything obviously wrong there although I would not have specified "RunOnce". I've done similar type code to adjust the yield of a "regular" building for a specific leader or civilization and did not use "RunOnce" in any of these cases and it worked fine for me.

Also
Code:
ModifierType	CollectionType	EffectType
MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_YIELD_CHANGE	COLLECTION_PLAYER_CITIES	EFFECT_ADJUST_BUILDING_YIELD_CHANGE
You don't need to create a new DynamicModifier when the game already has one that is identical to your needed CollectionType and EffectType -- you just use the existing ModifierType in table "Modifiers".
Code:
-----------------------------------------------
-- Types
-----------------------------------------------

INSERT INTO    Types
        (Type,                                            Kind            )
VALUES    ('TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US',            'KIND_TRAIT'    );

-----------------------------------------------
-- Traits
-----------------------------------------------

INSERT INTO    Traits   
        (TraitType,                                Name,                                            Description                                            )
VALUES    ('TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US',    'LOC_TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US_NAME',    'LOC_TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US_DESCRIPTION'    );
       
-----------------------------------------------
-- CivilizationTraits
-----------------------------------------------

INSERT INTO    CivilizationTraits
        (CivilizationType,                TraitType                            )
VALUES    ('CIVILIZATION_MC_OLMEC',    'TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US'    );

-----------------------------------------------
-- TraitModifiers
-----------------------------------------------

INSERT INTO    TraitModifiers   
        (TraitType,                                ModifierId                                        )
VALUES    ('TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US',    'MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD'        ),
        ('TRAIT_CIVILIZATION_LET_THE_GODS_FEED_US',    'MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD'        );

-----------------------------------------------
-- EmergencyBuffs
-----------------------------------------------

-----------------------------------------------
-- EmergencyRewards
-----------------------------------------------

-----------------------------------------------
-- Modifiers
-----------------------------------------------

INSERT INTO    Modifiers
        (ModifierId,                                        ModifierType,            Permanent    )
VALUES    ('MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD',        'MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_YIELD_CHANGE',    1            ),
        ('MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD',        'MODIFIER_PLAYER_CITIES_ADJUST_BUILDING_YIELD_CHANGE',    1            );

-----------------------------------------------
-- ModifierArguments
-----------------------------------------------

INSERT INTO    ModifierArguments
        (ModifierId,                                            Name,                            Value                                    )
VALUES    ('MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD',            'BuildingType',               'BUILDING_SHRINE'                        ),
        ('MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD',            'YieldType',                    'YIELD_FOOD'                            ),
        ('MODIFIER_LET_THE_GODS_FEED_US_SHRINE_YIELD',            'Amount',                        '2'                                      ),
        ('MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD',            'BuildingType',                 'BUILDING_TEMPLE'                        ),
        ('MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD',            'YieldType',                    'YIELD_FOOD'                            ),
        ('MODIFIER_LET_THE_GODS_FEED_US_TEMPLE_YIELD',            'Amount',                       '2'                                        );
Note that I have "texted" your Value settings in table ModifierArguments. Column "Value" is actually defined as being text rather than integer. Usually it make no difference for numerical data whether "texting" the Value column or not, but some other mod-makers have reported that they've gotten better results conforming to text because the column is actually defined as text.

---------------------------------------------------------

EDIT -- And also you want AbilityType and not UnitAbilityType in table ModifierArguments.
 
Last edited:
Code:
-----------------------------------------------
-- Types
-----------------------------------------------

INSERT INTO    Types
	(Type,						Kind )
VALUES	('TRAIT_LEADER_FEAR_NOT_EXPLORATION',		'KIND_TRAIT' ),
	('ABILITY_BUILDER_SETTLER_IGNORE_TERRAIN_COST',	'KIND_ABILITY');

-----------------------------------------------
-- Tags
-----------------------------------------------

INSERT INTO    Tags
	(Tag,				Vocabulary            )
VALUES	('CLASS_BUILDER_SETTLER',	'ABILITY_CLASS');

-----------------------------------------------
-- Tags
-----------------------------------------------

INSERT INTO    TypeTags
	(Type,						Tag            )
VALUES	('UNIT_BUILDER',				'CLASS_BUILDER_SETTLER'),
	('UNIT_SETTLER',				'CLASS_BUILDER_SETTLER'),
	('ABILITY_BUILDER_SETTLER_IGNORE_TERRAIN_COST',	'CLASS_BUILDER_SETTLER');

-----------------------------------------------
-- UnitAbilities
-----------------------------------------------

INSERT INTO UnitAbilities
	(UnitAbilityType,                        Name,                                            Description,                                            Inactive    )
VALUES	('ABILITY_BUILDER_SETTLER_IGNORE_TERRAIN_COST',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_NAME',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_DESCRIPTION',        1            );

-----------------------------------------------
-- UnitAbilityModifiers
-----------------------------------------------

INSERT INTO UnitAbilityModifiers
	(UnitAbilityType,					ModifierId )
VALUES	('ABILITY_BUILDER_SETTLER_IGNORE_TERRAIN_COST',        'ALTITUDE_TRAINING_IGNORE_HILLS'    );
	-- 'ALTITUDE_TRAINING_IGNORE_HILLS' is the existing ModifierId used by both Everest and the Altitude Training Ability.
	-- We can re-use it.


-----------------------------------------------
-- Traits
-----------------------------------------------

INSERT INTO    Traits
        (TraitType,                                Name,                                            Description                                            )
VALUES    ('TRAIT_LEADER_FEAR_NOT_EXPLORATION',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_NAME',    'LOC_TRAIT_LEADER_FEAR_NOT_EXPLORATION_DESCRIPTION'    );
       
-----------------------------------------------
-- LeaderTraits
-----------------------------------------------

INSERT INTO    LeaderTraits
        (LeaderType,            TraitType                            )
VALUES    ('LEADER_MC_PO_NGBE',    'TRAIT_LEADER_FEAR_NOT_EXPLORATION'    );

-----------------------------------------------
-- Modifiers
-----------------------------------------------

INSERT INTO Modifiers (ModifierId, ModifierType, Permanent)
VALUES ('TRAIT_GRANT_SETTLERS_BUILDERS_ALTITUDE_TRAINING', 'MODIFIER_PLAYER_UNITS_GRANT_ABILITY', 1);

-----------------------------------------------
-- TraitModifiers
-----------------------------------------------

INSERT INTO TraitModifiers (TraitType, ModifierId)
VALUES ('TRAIT_LEADER_FEAR_NOT_EXPLORATION', 'TRAIT_GRANT_SETTLERS_BUILDERS_ALTITUDE_TRAINING');

-----------------------------------------------
-- ModifierArguments
-----------------------------------------------

INSERT INTO ModifierArguments (ModifierId, Name, Value)
VALUES ('TRAIT_GRANT_SETTLERS_BUILDERS_ALTITUDE_TRAINING', 'AbilityType', 'ABILITY_BUILDER_SETTLER_IGNORE_TERRAIN_COST');
 
@LeeS - thank you for the comprehensive and clear reply.

Just wanted to feed back my gratitude for taking the time to unpick my code. I am glad to report that all elements are now working - and I am also much more clued up on why they are working.

LeeS said:
So far as you civilization ability I don't see anything obviously wrong there although I would not have specified "RunOnce". I've done similar type code to adjust the yield of a "regular" building for a specific leader or civilization and did not use "RunOnce" in any of these cases and it worked fine for me.

I did make the change as you suggested - though I am not entirely sure I understand why RunOnce wouldn't work; my understanding is that this would mean the execution of the modifier occurs once (at the start of the game) and applies to all of the buildings of that type...though perhaps it calculates the yield at different intervals (first one being when you first 'build' the building, subsequent calculations being if any other 'thing' changes the yield), which does make sense now I think about it.

Next step is now to move through the steps to learn assigning artwork, i.e. 'the pretty bits'.
 
Top Bottom