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

  On 26/06/2017 at 6:48 PM, wowgetoffyourcellphone said:

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

Expand  

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:

  Reveal hidden contents

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.

  Reveal hidden contents

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 @#$% WYSIWYG doesn't help with splitting quotes.)

  Quote

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.

Expand  

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).

  Quote

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

Expand  

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

  Quote

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

Expand  

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).

  Quote

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

Expand  

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

  Quote

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

Expand  

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).

  Quote

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

Expand  

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.

  Quote

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}

Expand  

(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}

  Quote

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

Expand  

Yes, that's all there is to it.

  Quote

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

Expand  

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...