Trying to add Landwehrs to Malta

Hi there,

I’m currently trying to add the Landwehr to Malta, replacing the Crossbowman.
Replacing them was no problem, but I can’t seem to get them to upgrade.
The update currently comes with the dignitary card as a stopgap.
You can see my modfile down in the screenshot.
Any help would be appreciated.

Look these techs:

DEVeteranLandwehrsShadow
DEGuardLandwehrsShadow
DEImperialLandwehrsShadow

  <tech name="DEVeteranLandwehrsShadow" type="Normal">
    <dbid>10323</dbid>
    <researchpoints>0.0000</researchpoints>
    <status>UNOBTAINABLE</status>
    <flag>Shadow</flag>
    <prereqs>
      <techstatus status="Active">VeteranCrossbowmen</techstatus>
(...)

They need the normal crossbow upgrades, they will not work with the arbalester maltese upgrades

(post deleted by author)

The only problem left is that they don’t upgrade to Imperial, modifying those shadowtechs doesn’t seem to be necessary in general (can’t get it to work anyway), since the guard upgrade works for some reason and the generic veteran upgrade doesn’t need to be modified. I made those techs obtainable, but it doesn’t work for the Imperial tech though and I can’t seem to find out why.

DEImperialLandwehrsShadow needs ImperialCrossbowmen to be active

  <tech name="DEImperialLandwehrsShadow" type="Normal">
    <dbid>10325</dbid>
    <researchpoints>0.0000</researchpoints>
    <status>UNOBTAINABLE</status>
    <flag>Shadow</flag>
    <prereqs>
      <techstatus status="Active">ImperialCrossbowmen</techstatus>
(...)

DERGArbalester gives you the GuardCrossbowmen upgrade by default

 <tech name="DERGArbalester" type="Normal">
(...)
      <effect type="TechStatus" status="active">GuardCrossbowmen</effect>
(...)

But DEImperialArbalester doesn´t give the ImperialCrossbowmen upgrade

So you have many options, for example, you can add to your code some shadowtech like this:

  <tech name="DEImperialLandwehrsARBALESTERShadow" type="Normal">
    <dbid>XXXX</dbid> <-- CHANGE THIS!!
    <researchpoints>0.0000</researchpoints>
    <status>UNOBTAINABLE</status>
    <flag>Shadow</flag>
    <prereqs>
      <techstatus status="Active">DEImperialArbalester</techstatus>
    </prereqs>
    <effects>
      <effect type="Data" amount="1.50" subtype="Hitpoints" relativity="BasePercent">
        <target type="ProtoUnit">deLandwehr</target>
      </effect>
      <effect type="SetName" proto="deLandwehr" culture="none" newname="125263">
      </effect>
      <effect type="Data" amount="0.00" subtype="UpdateVisual" unittype="deLandwehr" relativity="Absolute">
        <target type="Player">
        </target>
      </effect>
      <effect type="Data" amount="1.50" subtype="Damage" allactions="1" relativity="BasePercent">
        <target type="ProtoUnit">deLandwehr</target>
      </effect>
    </effects>
  </tech>

This is a new Imperial Landwehr shadow tech that should work with the DEImperialArbalester upgrade
Or you can explore another alternatives if you want.

Hmm I tried your code but that doesn’t seem to work either, for some reason it just ignores it. I didn’t want to do it this way but I just removed the Arbalester upgrade completely, now they just get generic (still the best) crossbows and that way it works no problem. I tried getting it to work for hours now by either trying to modify the
prereqs or by adding a new tech like you proposed but to no avail.

(Ok, the fix was a bit more complicated than I expected) I went through your mod data and rewrote it to fit the way I would do it: Added a tech in the hospital for Fortress Age (III) that replace the crossbowmen with Landwers, this because it seems to me that it would be more balanced and make more sense to me (Maltese are supposed to be an archaic civ), but you can look at my data to get an idea of ​​what I did and then do the modifications that you want (Or leave it as it is, it’s your decision). I didn’t add the ability to change Homecity crossbowmen to Landwehrs because that would require card modifications (The original German cards also give Uhlans, and the Maltese crossbowman cards are the normal versions, etc.) , but this change can be done, you just need to put more work into it if you want. Remember that you must remove the GuardCrossbowmen and ImperialCrossbowmen upgrades from your protomods.xml if you want my code to work. I already tested it and it works correctly, so you can add the other card modifications you made if you want. You can also change the dbid numbers of the techs to whatever you want to avoid conflicts with other mods, each tech must have a unique dbid number.

Summary
<techtreemods>
  <tech name="H3LLGHA5TImperialLandwehrsForMaltaShadow" type="Normal">
    <dbid>969696</dbid>
    <researchpoints>0.0000</researchpoints>
    <status>OBTAINABLE</status>
    <flag>Shadow</flag>
    <prereqs>
      <techstatus status="Active">DEAge0Maltese</techstatus>
    </prereqs>
    <effects>
      <effect type="TechStatus" status="obtainable">DEVeteranLandwehrsShadow</effect>
      <effect type="TechStatus" status="obtainable">DEGuardLandwehrsShadow</effect>
      <effect type="TechStatus" status="obtainable">H3LLGHA5TImperialLandwehrsARBALESTERShadow</effect>
      <effect type="TechStatus" status="obtainable">H3LLGHA5TBarracksLandwehr</effect>
      <effect type="CommandAdd" tech="H3LLGHA5TBarracksLandwehr" page="2" column="0">
        <target type="ProtoUnit">deHospital</target>
      </effect>
    </effects>
  </tech>
  <tech name="H3LLGHA5TBarracksLandwehr" type="Normal">
    <dbid>474747</dbid>
    <displaynameid>125268</displaynameid>
    <cost resourcetype="Gold">200.0000</cost>
    <researchpoints>30.0000</researchpoints>
    <status>UNOBTAINABLE</status>
    <icon>resources\images\icons\techs\germans\landwehr.png</icon>
    <rollovertextid>125269</rollovertextid>
    <flag>CountsTowardMilitaryScore</flag>
    <flag>DEHospitalTechnology</flag>
    <prereqs>
      <techstatus status="Active">Fortressize</techstatus>
    </prereqs>
    <effects>
      <effect type="SetName" tech="DEPoliticianPapalGuardMaltese" newname="91550" newrollover="125271">
      </effect>
      <effect type="TechStatus" status="obtainable">DEKeepCrossbowmenTechsAlignedInBarracksShadow</effect>
      <effect type="TechStatus" status="obtainable">DEKeepImperialCrossbowmenTechsAlignedInBarracksShadow</effect>
      <effect type="SetName" tech="VeteranCrossbowmen" newname="125264" newrollover="125267">
      </effect>
      <effect type="SetName" tech="DERGArbalester" newname="125265" newrollover="125267">
      </effect>
      <effect type="SetName" tech="DEImperialArbalester" newname="125266" newrollover="125267">
      </effect>
      <effect type="Data" amount="0.00" subtype="CopyTechIcon" tech="VeteranMusketeers" relativity="Absolute">
        <target type="Tech">VeteranCrossbowmen</target>
      </effect>
      <effect type="Data" amount="0.00" subtype="CopyTechIcon" tech="GuardMusketeers" relativity="Absolute">
        <target type="Tech">DERGArbalester</target>
      </effect>
      <effect type="Data" amount="0.00" subtype="CopyTechIcon" tech="ImperialMusketeers" relativity="Absolute">
        <target type="Tech">DEImperialArbalester</target>
      </effect>
      <effect type="TransformUnit" toprotoid="deLandwehr" fromprotoid="Crossbowman">
      </effect>
      <effect type="Data" amount="0.00" subtype="Enable" relativity="Absolute">
        <target type="ProtoUnit">Crossbowman</target>
      </effect>
      <effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
        <target type="ProtoUnit">deLandwehr</target>
      </effect>
      <effect type="CommandRemove" proto="Crossbowman">
        <target type="ProtoUnit">deHospital</target>
      </effect>
      <effect type="CommandAdd" proto="deLandwehr" page="0" column="0">
        <target type="ProtoUnit">deHospital</target>
      </effect>
      <effect type="CommandRemove" proto="Crossbowman">
        <target type="ProtoUnit">FortFrontier</target>
      </effect>
      <effect type="CommandAdd" proto="deLandwehr" page="0" column="0">
        <target type="ProtoUnit">FortFrontier</target>
      </effect>
      <effect type="CommandRemove" proto="Crossbowman">
        <target type="ProtoUnit">Galleon</target>
      </effect>
      <effect type="CommandAdd" proto="deLandwehr" page="0" column="0">
        <target type="ProtoUnit">Galleon</target>
      </effect>
      <effect type="SetName" proto="Crossbowman" newname="125259" newrollover="125260">
      </effect>
    </effects>
  </tech>
  <tech name="H3LLGHA5TImperialLandwehrsARBALESTERShadow" type="Normal">
    <dbid>696969</dbid>
    <researchpoints>0.0000</researchpoints>
    <status>UNOBTAINABLE</status>
    <flag>Shadow</flag>
    <prereqs>
      <techstatus status="Active">DEImperialArbalester</techstatus>
    </prereqs>
    <effects>
      <effect type="Data" amount="1.50" subtype="Hitpoints" relativity="BasePercent">
        <target type="ProtoUnit">deLandwehr</target>
      </effect>
      <effect type="SetName" proto="deLandwehr" culture="none" newname="125263">
      </effect>
      <effect type="Data" amount="0.00" subtype="UpdateVisual" unittype="deLandwehr" relativity="Absolute">
        <target type="Player">
        </target>
      </effect>
      <effect type="Data" amount="1.50" subtype="Damage" allactions="1" relativity="BasePercent">
        <target type="ProtoUnit">deLandwehr</target>
      </effect>
    </effects>
  </tech>
</techtreemods>

I got around finishing the changes, the Maltese get the tech in the Hospital, and I replaced all the crossbow shipments upon researching the tech and Landwehrs will profit from the 2 % hp increase per shipment as for other Maltese units. The Steel Screw shipment increases the range for Landwehrs just like it does for crossbows minus the siege range and the sovereign order card boosts their hp by 15 %.

I kindly thank you for for helping out, especially since this helps me becoming a bit better at modding.

1 Like