[R&F] Moving a unit to another Tech.

Cordell

Chieftain
Joined
Mar 21, 2018
Messages
22
Hello
Sorry english is not my mother tongue. Hope i am understandable.
And my skills for coding are very limited.
(a noob if u want but editing text is not that hard when u spent time to it)
Using notepad++ , i manage to deeply change the techtree, and it's working perfectly.well.
But i have now a problem, i would like to Move Pike and Shoot unit from Metal Chasing to Siege tactics.
I tryied few tricks but it do not work yet.
Here my last attempt.(maybe not the best one)
Thanks for help.
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Units>
        <Update>
            <Where Row UnitType="UNIT_PIKE_AND_SHOT" BaseMoves="2" Cost="250" AdvisorType="ADVISOR_CONQUEST" BaseSightRange="2" ZoneOfControl="true" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_LAND_COMBAT" Name="LOC_UNIT_PIKE_AND_SHOT_NAME" Description="LOC_UNIT_PIKE_AND_SHOT_DESCRIPTION" PurchaseYield="YIELD_GOLD" PromotionClass="PROMOTION_CLASS_ANTI_CAVALRY" Maintenance="4" Combat="55" PrereqTech="TECH_METAL_CASTING" MandatoryObsoleteTech="TECH_COMBINED_ARMS"/>
            <Set Row UnitType="UNIT_PIKE_AND_SHOT" BaseMoves="2" Cost="250" AdvisorType="ADVISOR_CONQUEST" BaseSightRange="2" ZoneOfControl="true" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_LAND_COMBAT" Name="LOC_UNIT_PIKE_AND_SHOT_NAME" Description="LOC_UNIT_PIKE_AND_SHOT_DESCRIPTION" PurchaseYield="YIELD_GOLD" PromotionClass="PROMOTION_CLASS_ANTI_CAVALRY" Maintenance="4" Combat="55" PrereqTech="TECH_SIEGE_TACTICS" MandatoryObsoleteTech="TECH_COMBINED_ARMS"/>
           
        </Update>
    </Units>
<GameInfo>
 
Try this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
    <Units>
        <Update>
            <Where UnitType="UNIT_PIKE_AND_SHOT"/>
            <Set PrereqTech="TECH_SIEGE_TACTICS"/>
        </Update>
    </Units>
</GameData>
Or, in SQL
Code:
UPDATE  Units
SET     PrereqTech = 'TECH_SIEGE_TACTICS'
WHERE   UnitType = 'UNIT_PIKE_AND_SHOT;
 
Thanks a lot. It's working perfectly.
Is it better to use sql or xml for this kind of issue?
 
Last edited:
SQL is much better for editing files. I wish the entire community would abandon XML for SQL, at least for updating existing data. (Arguably SQL is useful for creating new data, but that's extremely debatable).

I recommend downloading a SQL tool that can hook to the database so you can query your code after injecting it with a mod.
 
Back
Top Bottom