Trainable Story Heroes and Units

Discuss Trainable Story Heroes and Units

Hi Nergico, in the “proto_mods” you must add trainpoints to your heroes to be able to train them normally with left click, for example <trainpoints>10.0000</trainpoints> (trainpoints is the time it takes for a unit to train)

	<unit name="Arkantos">
    <trainpoints>10.0000</trainpoints>
		<buildlimit>1</buildlimit>
		<cost resourcetype="Food">200.0000</cost>
		<cost resourcetype="Gold">150.0000</cost>
		<cost resourcetype="Favor">2.0000</cost>
		<initialhitpoints>320.0000</initialhitpoints>
		<maxhitpoints>320.0000</maxhitpoints>
	</unit>

Check out the “SonsOfTheSun” tech for an example of how to transform one unit into another, for example:

      <effect type="TransformUnit" toprotoid="OracleHero" fromprotoid="Oracle" includequeued="true">
      </effect>

In “techtree_mods” you can make a tech activate automatically when another tech activates

  <tech name="NergicoTransformArkantosToArkantosUber">
    <status>OBTAINABLE</status>
    <flag>HideAllNotifications</flag>
    <researchpoints>0.0000</researchpoints>
    <prereqs>
      <techstatus status="active">HeroicAgeGreek</techstatus>
    </prereqs>
    <effects>
      <effect type="TransformUnit" toprotoid="ArkantosUber" fromprotoid="Arkantos" includequeued="true">
      </effect>
    </effects>
  </tech>

  <tech name="NergicoTransformArkantosUberToArkantosGod">
    <status>OBTAINABLE</status>
    <flag>HideAllNotifications</flag>
    <researchpoints>0.0000</researchpoints>
    <prereqs>
      <techstatus status="active">MythicAgeGreek</techstatus>
    </prereqs>
    <effects>
      <effect type="TransformUnit" toprotoid="ArkantosGod" fromprotoid="ArkantosUber" includequeued="true">
      </effect>
    </effects>
  </tech>

You can remove the “Arkantos” command so that you can no longer train him in the “HeroicAge” and replace it with “ArkantosUber”, and then the same with “ArkantosUber” and “ArkantosGod” in the “MythicAge”
(in this example I have removed “ArkantosUber” and “ArkantosGod” from their training in the “Shrine” in “proto_mods”, and I wrote a code to “Enable” them and remove/add their commands to train them through these techs in “techtree_mods”)

  <tech name="NergicoTransformArkantosToArkantosUber">
    <status>OBTAINABLE</status>
    <flag>HideAllNotifications</flag>
    <researchpoints>0.0000</researchpoints>
    <prereqs>
      <techstatus status="active">HeroicAgeGreek</techstatus>
    </prereqs>
    <effects>

      <effect type="TransformUnit" toprotoid="ArkantosUber" fromprotoid="Arkantos" includequeued="true">
      </effect>

      <effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
        <target type="ProtoUnit">ArkantosUber</target>
      </effect>
      <effect type="Data" amount="1.00" subtype="CommandRemove" proto="Arkantos" relativity="Assign">
        <target type="ProtoUnit">Shrine</target>
      </effect>
      <effect type="Data" amount="1.00" subtype="CommandAdd" proto="ArkantosUber" row="1" column="0" relativity="Assign">
        <target type="ProtoUnit">Shrine</target>
      </effect>

    </effects>
  </tech>

  <tech name="NergicoTransformArkantosUberToArkantosGod">
    <status>OBTAINABLE</status>
    <flag>HideAllNotifications</flag>
    <researchpoints>0.0000</researchpoints>
    <prereqs>
      <techstatus status="active">MythicAgeGreek</techstatus>
    </prereqs>
    <effects>

      <effect type="TransformUnit" toprotoid="ArkantosGod" fromprotoid="ArkantosUber" includequeued="true">
      </effect>

      <effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute">
        <target type="ProtoUnit">ArkantosGod</target>
      </effect>
      <effect type="Data" amount="1.00" subtype="CommandRemove" proto="ArkantosUber" relativity="Assign">
        <target type="ProtoUnit">Shrine</target>
      </effect>
      <effect type="Data" amount="1.00" subtype="CommandAdd" proto="ArkantosGod" row="1" column="0" relativity="Assign">
        <target type="ProtoUnit">Shrine</target>
      </effect>

    </effects>
  </tech>

I’m no expert on this, but you can ask me some questions if you want. If I find something else I can help you with, I’ll let you know.

1 Like

It worked! Thank you so much :heart: I’l write you on Discord. I have some new Questions to you ^^