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

Question

King
Joined
Mar 12, 2008
Messages
950
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"...
 
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.
 
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:
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>
 
You need to add more requirements to the requirement set definition. No need to change requirements.

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...
 
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:
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?
 
Code:
       <Row>
           <RequirementId>AOE_REQUIRES_ANCIENT_UNIT</RequirementId>
           <RequirementType>REQUIREMENT_UNIT_ERA_TYPE_MATCHES</RequirementType>
       </Row>

I had this in my GreatPeople.xml file.
This is not vanilla GreatPeople.xml.
 
Top Bottom