[GS] How to give Ai free city walls?

Taa

Warlord
Joined
Jan 1, 2009
Messages
229
Hi

Ai is often late building ancient walls, and I remember seeing a mod that gave city walls to Ai at some point in the game, but cant remember what mod it was.

What I want is to give ancient walls to all Ai's, maybe when entering classical era.
So is this something that can be done with some easy tweaks, or do I need to make a big mod?
 
hmm after doing some testing I'm struggling to make this work.
I can change Trait type but I have no idea what to do with requirements and modifiers, I see no logical pattern or system.

This mod work for city states so its just my ignorance that cant make it work for major civs.

Code:
--=====
--TYPES
--=====
INSERT INTO Types (Type, Kind)
    VALUES
        ('TCS_MINOR_CIV_GRANT_WALLS_IN_CITY_IGNORE', 'KIND_MODIFIER');

--=================
--DYNAMIC MODIFIERS
--=================   
INSERT INTO DynamicModifiers (ModifierType, CollectionType, EffectType)
    VALUES
        ('TCS_MINOR_CIV_GRANT_WALLS_IN_CITY_IGNORE', 'COLLECTION_PLAYER_CITIES', 'EFFECT_GRANT_BUILDING_IN_CITY_IGNORE');
 
--===============
--TRAIT MODIFIERS
--===============
INSERT INTO TraitModifiers (TraitType, ModifierId)
    VALUES
        ('MINOR_CIV_DEFAULT_TRAIT', 'TCS_MINOR_CIV_FREE_ANCIENT_WALLS'),
        ('MINOR_CIV_DEFAULT_TRAIT', 'TCS_MINOR_CIV_FREE_MEDIEVAL_WALLS'),
        ('MINOR_CIV_DEFAULT_TRAIT', 'TCS_MINOR_CIV_FREE_RENAISSANCE_WALLS');

--=========
--MODIFIERS
--=========
INSERT INTO Modifiers (ModifierId, ModifierType, OwnerRequirementSetId, SubjectRequirementSetId)
    VALUES
        ('TCS_MINOR_CIV_FREE_ANCIENT_WALLS', 'TCS_MINOR_CIV_GRANT_WALLS_IN_CITY_IGNORE', NULL, NULL),
        ('TCS_MINOR_CIV_FREE_MEDIEVAL_WALLS', 'TCS_MINOR_CIV_GRANT_WALLS_IN_CITY_IGNORE', 'TCS_MINOR_CIV_IN_MEDIEVAL_ERA', NULL),
        ('TCS_MINOR_CIV_FREE_RENAISSANCE_WALLS', 'TCS_MINOR_CIV_GRANT_WALLS_IN_CITY_IGNORE', 'TCS_MINOR_CIV_IN_RENAISSANCE_ERA', NULL);

--==================
--MODIFIER ARGUMENTS
--==================
INSERT INTO ModifierArguments (ModifierId, Name, Value)
    VALUES
        ('TCS_MINOR_CIV_FREE_ANCIENT_WALLS', 'BuildingType', 'BUILDING_WALLS'),
        ('TCS_MINOR_CIV_FREE_MEDIEVAL_WALLS', 'BuildingType', 'BUILDING_CASTLE'),
        ('TCS_MINOR_CIV_FREE_RENAISSANCE_WALLS', 'BuildingType', 'BUILDING_STAR_FORT');

--============
--REQUIREMENTS
--============
INSERT INTO RequirementSets (RequirementSetId, RequirementSetType)
    VALUES
        ('TCS_MINOR_CIV_IN_MEDIEVAL_ERA', 'REQUIREMENTSET_TEST_ALL'),
        ('TCS_MINOR_CIV_IN_RENAISSANCE_ERA', 'REQUIREMENTSET_TEST_ALL');

INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId)
    VALUES
        ('TCS_MINOR_CIV_IN_MEDIEVAL_ERA', 'TCS_REQUIRES_MINOR_CIV_IN_MEDIEVAL_ERA'),
        ('TCS_MINOR_CIV_IN_RENAISSANCE_ERA', 'TCS_REQUIRES_MINOR_CIV_IN_RENAISSANCE_ERA');

INSERT INTO Requirements (RequirementId, RequirementType)
    VALUES
        ('TCS_REQUIRES_MINOR_CIV_IN_MEDIEVAL_ERA', 'REQUIREMENT_PLAYER_ERA_AT_LEAST'),
        ('TCS_REQUIRES_MINOR_CIV_IN_RENAISSANCE_ERA', 'REQUIREMENT_PLAYER_ERA_AT_LEAST');

INSERT INTO RequirementArguments (RequirementId, Name, Value)
    VALUES
        ('TCS_REQUIRES_MINOR_CIV_IN_MEDIEVAL_ERA', 'EraType', 'ERA_MEDIEVAL'),
        ('TCS_REQUIRES_MINOR_CIV_IN_RENAISSANCE_ERA', 'EraType', 'ERA_RENAISSANCE');

This is what I tried and failed:
TCS_MINOR_CIV_FREE_ANCIENT_WALLS is just the name of the trait, so need to change that right?
I can replace MINOR_CIV_DEFAULT_TRAIT -> TRAIT_LEADER_MAJOR_CIV
And I see that there is only requirement for BUILDING_CASTLE and BUILDING_STAR_FORT, but this I dont want to give this to major civs, only BUILDING_WALLS. Can I just make it like this?

Code:
--=====
--TYPES
--=====
INSERT INTO Types (Type, Kind)
    VALUES
        ('TCS_MINOR_CIV_GRANT_WALLS_IN_CITY_IGNORE', 'KIND_MODIFIER');

--=================
--DYNAMIC MODIFIERS
--=================   
INSERT INTO DynamicModifiers (ModifierType, CollectionType, EffectType)
    VALUES
        ('TCS_MINOR_CIV_GRANT_WALLS_IN_CITY_IGNORE', 'COLLECTION_PLAYER_CITIES', 'EFFECT_GRANT_BUILDING_IN_CITY_IGNORE');
 
--===============
--TRAIT MODIFIERS
--===============
INSERT INTO TraitModifiers (TraitType, ModifierId)
    VALUES
        ('TRAIT_LEADER_MAJOR_CIV', 'TCS_MINOR_CIV_FREE_ANCIENT_WALLS');

--=========
--MODIFIERS
--=========
INSERT INTO Modifiers (ModifierId, ModifierType, OwnerRequirementSetId, SubjectRequirementSetId)
    VALUES
        ('TCS_MINOR_CIV_FREE_ANCIENT_WALLS', 'TCS_MINOR_CIV_GRANT_WALLS_IN_CITY_IGNORE', NULL, NULL);

--==================
--MODIFIER ARGUMENTS
--==================
INSERT INTO ModifierArguments (ModifierId, Name, Value)
    VALUES
        ('TCS_MINOR_CIV_FREE_ANCIENT_WALLS', 'BuildingType', 'BUILDING_WALLS');

I'm sry but I have really no idea what Im doing.
Anyone than can help me make this work for major civs?
 
Maybe an easier method is to add buildings in eras.xml. Like MajorStartingUnits and BonusMinorStartingUnits, there is also something called StartingBuildings. Its not bonus StartingBuildings but yeah.
So I tried to add, or more correctly changed:
<Row Era="ERA_ANCIENT" MinorOnly="true" MinDifficulty="DIFFICULTY_IMMORTAL" Building="BUILDING_WALLS" District="DISTRICT_CITY_CENTER"/>
<Row Era="ERA_ANCIENT" Building="BUILDING_WALLS" District="DISTRICT_CITY_CENTER"/>

But this did not do much either.
 
Ok I did a workaround, added dependency on tech that make walls available so all have to research it to continue, so pwn they are building walls :)

Edit: That did only do a little, some is building wall, not others.

Back to start....
 
Last edited:
Back
Top Bottom