1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

[R&F] Making great general bonuses apply to 3 eras?

Discussion in 'Mod Creation Help' started by Question, Mar 8, 2018.

  1. Question

    Question Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    945
    Is it possible to make great general bonuses apply to 3 eras instead of just two? Im looking in the great generals.xml file but i do not see anything that defines that....

    GREATPERSON_COMBAT_STRENGTH_AOE_CLASSICAL_LAND

    But nothing in the file says "this is for classical/medieval eras only"...
     
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,414
    Location:
    Illinois, USA
    Look in the RaF GreatPeople.xml (its name will be something close to that, I don't know the exact name since I don't have RaF)

    For Vanilla the ties to the eras are done in GreatPeople.xml
    Code:
    	<RequirementSetRequirements>
    		<Row>
    			<RequirementSetId>AOE_CLASSICAL_REQUIREMENTS</RequirementSetId>
    			<RequirementId>AOE_REQUIRES_CLASSICAL_UNIT</RequirementId>
    		</Row>
    		<Row>
    			<RequirementSetId>AOE_CLASSICAL_REQUIREMENTS</RequirementSetId>
    			<RequirementId>AOE_REQUIRES_MEDIEVAL_UNIT</RequirementId>
    		</Row>
    		...etc
    	</RequirementSetRequirements>
    
    
    	<RequirementArguments>
    		<Row>
    			<RequirementId>AOE_REQUIRES_CLASSICAL_UNIT</RequirementId>
    			<Name>EraType</Name>
    			<Value>ERA_CLASSICAL</Value>
    		</Row>
    		<Row>
    			<RequirementId>AOE_REQUIRES_MEDIEVAL_UNIT</RequirementId>
    			<Name>EraType</Name>
    			<Value>ERA_MEDIEVAL</Value>
    		</Row>
    		...etc
    GreatPeople.xml also contains a lot of the code for the requirements, requirementsets, etc.
     
  3. Question

    Question Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    945
    Yes but i dont get how you are supposed to make the CLASSICAL_UNIT part apply to two eras. I want to make great generals/admirals give their bonus to ancient, classical and medieval units.

    I dont see anything in the xml file that says "okay this great generals work for X and Y eras".

    I tried changing :

    <Row>
    <RequirementId>AOE_REQUIRES_CLASSICAL_UNIT</RequirementId>
    <Name>EraType</Name>
    <Value>ERA_ANCIENT</Value>
    </Row>

    But I dont see any change ingame...still does not work for ancient era units...
     
    Last edited: Mar 8, 2018
  4. Infixo

    Infixo Warlord

    Joined:
    Jan 9, 2016
    Messages:
    2,196
    Gender:
    Male
    Location:
    Warsaw
  5. Question

    Question Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    945
    Im confused, from what i can see the Value field only works for one ERA?

    I tried doing two rows but it didnt work either.

    Code:
    <Row>
    <RequirementId>AOE_REQUIRES_CLASSICAL_UNIT</RequirementId>
    <Name>EraType</Name>
    <Value>ERA_ANCIENT</Value>
    </Row>
    
    <Row>
    <RequirementId>AOE_REQUIRES_CLASSICAL_UNIT</RequirementId>
    <Name>EraType</Name>
    <Value>ERA_CLASSICAL</Value>
    </Row>
    
     
  6. Infixo

    Infixo Warlord

    Joined:
    Jan 9, 2016
    Messages:
    2,196
    Gender:
    Male
    Location:
    Warsaw
  7. qqqbbb

    qqqbbb Chieftain

    Joined:
    Sep 25, 2010
    Messages:
    411
  8. Question

    Question Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    945
    But you need to define an ancient era requirement as well as that is not in the base game.

    So for example I did :

    Code:
    <RequirementSetRequirements>
               <Row>
               <RequirementSetId>AOE_CLASSICAL_REQUIREMENTS</RequirementSetId>
               <RequirementId>AOE_REQUIRES_ANCIENT_UNIT</RequirementId>
           </Row>
    
    <Requirements>
               <Row>
               <RequirementId>AOE_REQUIRES_ANCIENT_UNIT</RequirementId>
               <RequirementType>REQUIREMENT_UNIT_ERA_TYPE_MATCHES</RequirementType>
           </Row>
    
        <RequirementArguments>
               <Row>
               <RequirementId>AOE_REQUIRES_ANCIENT_UNIT</RequirementId>
               <Name>EraType</Name>
               <Value>ERA_ANCIENT</Value>
           </Row>
    
    However it does not appear to work...
     
  9. Question

    Question Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    945
  10. Question

    Question Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    945
    OK I just started a new game with the great generals mod, I have Timur the great general, but he is not applying any bonuses at all to scouts, archers or immortals.

    I am looking at the SQL but I dont see any issues, nor is database.log showing any errors...why is it not working?

    Code:
    INSERT OR REPLACE INTO RequirementSetRequirements (RequirementSetId, RequirementId)
    VALUES    ('AOE_CLASSICAL_REQUIREMENTS', 'AOE_REQUIRES_ANCIENT_UNIT'),
    
           ('AOE_MEDIEVAL_REQUIREMENTS', 'AOE_REQUIRES_ANCIENT_UNIT'),
           ('AOE_MEDIEVAL_REQUIREMENTS', 'AOE_REQUIRES_CLASSICAL_UNIT'),
     
    Last edited: Mar 18, 2018
  11. Question

    Question Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    945
    After a lot of trial and error testing, I figured out what caused the problem...but i dont understand why.

    Code:
           <Row>
               <RequirementId>AOE_REQUIRES_ANCIENT_UNIT</RequirementId>
               <RequirementType>REQUIREMENT_UNIT_ERA_TYPE_MATCHES</RequirementType>
           </Row>
    I had this in my GreatPeople.xml file.

    The mod had this :

    Code:
    INSERT INTO Requirements (RequirementId, RequirementType)
    VALUES ('AOE_REQUIRES_ANCIENT_UNIT', 'REQUIREMENT_UNIT_ERA_TYPE_MATCHES');
    And for whatever reason, that SQL line above was causing the mod to break. Why? Sure, it was trying to insert a duplicate entry, but it obviously failed because there was a duplicate. But that doesnt matter because its exactly the same row.

    The moment I removed either the existing entry in GreatPeople.xml or the SQL code, everything started working.

    I tried changing it to "INSERT OR REPLACE INTO" but it still broke.

    Can someone explain what happened?
     
  12. qqqbbb

    qqqbbb Chieftain

    Joined:
    Sep 25, 2010
    Messages:
    411
    This is not vanilla GreatPeople.xml.
     
  13. Question

    Question Chieftain

    Joined:
    Mar 12, 2008
    Messages:
    945
    Uh, yea. What i dont get is why that causes the mod to break?
     

Share This Page