Jump to content

How hard would it be to add "PerAlly" to Entity Limit, Limit Changers?


Recommended Posts

I would like to have PerAlly added to Limit Changers, so that the number of restricted units/structures you can make is limited by the number of allies.

I don't have any programming experience other than working on a team bonus mod for some weeks.  I've done a little reading about JavaScript.  It doesn't seem like it should be hard to get a count of Allies.  But I don't really know how to even start when it comes to the component files.

<EntityLimits>
    <Limits>
      <ArmorerCart>1</ArmorerCart>
      <CivicCenter>1</CivicCenter>

      <Pillar>0</Pillar>
    </Limits>
    <LimitChangers>
      <ArmorerCart>
        <PerAlly>1<PerAlly>   //Meaning that the player can make 1 Armorer Cart per ally.
      </ArmorerCart>
    </LimitChangers>
    <LimitRemovers>
      <CivilCentre>
        <RequiredTechs datatype="tokens">phase_town</RequiredTechs>
      </CivilCentre>
    </LimitRemovers>
  </EntityLimits>

 

Link to comment
Share on other sites

So you should start at the EntityLimits.js file. First you'll need to adapt the schema (and all the templates that use the schema), next you'll need to modify the function that checks the limits, to look for the mentioned diplomatic relationship between players (Allied, Enemy, Global, perhaps?).

To answer your topic title: 13.

(And feel free to ask for more specific questions while you dive in. :))

  • Thanks 2
Link to comment
Share on other sites

You can copy the limitation lines from the hero templates to your unit's template. 

In my opinion, adding a number limit to fire cavalry or mercenary cavalry can resolve some discontent with these units, as the lack of numbers will counteract with their OP stats. 

Consider heroes for example. Each hero itself is incredibly OP compared to any other unit, but because you only have 1 hero among 200 or 300 other units, the strength of the hero is negligible.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...