Jump to content

Entity Classes


panther42
 Share

Recommended Posts

Where can you find all of the available entity classes in the game listed?

I looked on trac.wildfiregames.com, but all links to entity documentation give a non-working page: entity documentation.

Looking for where in the game entity is defined, such as "Worker", "Citizen Soldier", etc. for use in such things as templates.

"affects": ["Worker"]

 

Thank You

Link to comment
Share on other sites

4 hours ago, wowgetoffyourcellphone said:

So mods don't have to edit identity.js to include new classes right?

I don't believe that is what the schema entry is for... more for template on how to make a template_unit or template_structure, etc.

Main question is, can a MOD add a Class to Classes or VisibleClasses in the game, to be used for i.e. technologies, etc.

Questions:

Spoiler
  1. What is the difference between Classes and VisibleClasses, particularly when used by technologies.   "affects": ["Worker"]
    • health_females_01 uses FemaleCitizen(from Classes), whereas many use Worker(from VisibleClasses)
  2. Can a MOD expand the list of either Classes or VisibleClasses to include new?
    • Example:  MOD has a SuperHero class, which inherits from template_unit_hero
    • MOD has technology for Kryptonite, which affects only SuperHero class.
    • Do not want to affect all other units which inherit from template_unit_hero
  3. What is the difference between CivCentre(Classes), and CivilCentre(VisibleClasses)?
    • CitizenSoldier(Classes) vs Citizen(VisibleClasses) + Soldier(VisibleClasses)
  4. Are there templates for Worker, Citizen, Support, etc?  Where defined?
  5. Does inheritance build off of base entity, or replace for listed Classes/VisibleClasses in child, if written
    • template_unit
      1. Classes:  Unit  ConquestCritical
      2. No VisibleClasses
    • template_unit_support
      1. Classes:  Human  Organic  (Does Unit and ConquestCritical apply to this entity)
      2. VisibleClasses:  Support
    • template_unit_support_female_citizen
      1. Classes:  FemaleCitizen  (Does Unit, ConquestCritical, Human, Organic apply to this entity)
      2. VisibleClasses:  Citizen  Worker (Does Support still apply)

What had me thinking about this, is going through Delenda, and seeing technology affects applied to such entities as "Gatherer".  I could not find "Gatherer" in main game.

CultStatue is another.  Does just adding it to VisibleClasses, add it to the game?  Seems to answer some of above questions, if so.

Spoiler

<Identity>
    <Civ>gaia</Civ>
    <GenericName>Cult Statue</GenericName>
    <SpecificName>Mnimeíon</SpecificName>
    <Classes datatype="tokens">-ConquestCritical</Classes>
    <VisibleClasses datatype="tokens">-City Town CultStatue</VisibleClasses>
    <Tooltip>Build these to generate the Glory resource over time. Task units to pray at the statue to generate Glory even faster. Can only build 1 at a time, one after another.</Tooltip>
    <Icon>structures/statue.png</Icon>
    <RequiredTechnology>phase_town</RequiredTechnology>
  </Identity>

 

Is there a command to query all Classes and VisibleClasses loaded?

Edited by panther42
  • Like 1
Link to comment
Share on other sites

(First let me curse about the forum software that managed to have an "autosave" feature that doesn't work, thus I'm writing this again... Now in a proper editor because @#&#036;% WYSIWYG doesn't help with splitting quotes.)

I don't believe that is what the schema entry is for... more for template on how to make a template_unit or template_structure, etc.

As the schema should say that is just an example. More specifically an example of what is currently used in the public mod (though it might not be accurate and complete).

Main question is, can a MOD add a Class to Classes or VisibleClasses in the game, to be used for i.e. technologies, etc.

Yes, just add them to the respective token list under the Identity tag.

What is the difference between Classes and VisibleClasses, particularly when used by technologies. "affects": ["Worker"]

For the purpose of the game: None. Most of the games code doesn't even know that there are two different lists, that is an internal detail of the Identity component. The only difference is that VisibleClasses might end up being shown to the user in e.g. GUI tooltips (requirements tooltips, unit training tooltips) and are translated (if the mod has a translation).

Can a MOD expand the list of either Classes or VisibleClasses to include new?

Yes, just add them to the respective list. Done.

What is the difference between CivCentre(Classes), and CivilCentre(VisibleClasses)?

They aren't the same. They could as well be named A and B, apart from the detail that CivilCentre is displayed in the GUI. There is no meaning in a class which is just a bunch of characters, the only meaning comes from specifying the same string in a few places (e.g. technology requirements).

Are there templates for Worker, Citizen, Support, etc?  Where defined?

If you mean entity templates that are used to reduce duplication when specifying those look for files named template_unit_support.xml. If you mean for classes (be that in Classes or VisibleClasses) then no, since those are just a bunch of characters without any intrinsic meaning.

Does inheritance build off of base entity, or replace for listed Classes/VisibleClasses in child, if written

  • template_unit: Classes: {Unit ConquestCritical} ; VisibleClasses: {}
  • template_unit_support: Classes: {Human Organic} ; VisibleClasses: {Support}
  • template_unit_support_female_citizen: Classes: {FemaleCitizen} ; VisibleClasses: {Citizen Worker}

(Slighly modified, blame me being lazy after fighting with the forum.) This is related to how we handle template inheritance which is explained in some detail in the CParamNode documentation. I'll give a short overview of how token lists are handled (which is what both Classes and VisibleClasses are; notice the

datatype="tokens"

attribute). The token list elements of the parent (after the parent was already handled fully, taking care of inheritance) is enlarged by adding all tokens in the template. Except for those starting with a -, these remove the token from the list. Note that trying to remove tokens that are not present in the parent will result in a warning. So for your example we get

  • template_unit: Classes: {Unit ConquestCritical} ; VisibleClasses: {}
  • template_unit_support: Classes: {Unit ConquestCritical Human Organic} ; VisibleClasses: {Support}
  • template_unit_support_female_citizen: Classes: {Unit ConquestCritical Human Organic FemaleCitizen} ; VisibleClasses: {Support Citizen Worker}

CultStatue is another.  Does just adding it to VisibleClasses, add it to the game?  Seems to answer some of above questions, if so.

Yes, that's all there is to it.

Is there a command to query all Classes and VisibleClasses loaded?

For a specific unit open the developer overlay (Alt+D) and toggle "Display selection state", you will see the Classes and VisibleClasses for that unit. If you mean all, then no. Some grepping of the templates should give you an idea, but since there is nothing to "load" it doesn't seem very interesting. You could however write a little code and use the Units Demo map that places all entities and get a full list if that is really what you want.

  • Like 5
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...