Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
HLEnhanced comes with an upgraded entity classification system. Whereas the old system used hardcoded constants to identify classes and establish relationships between classes, the new system is designed to give complete control to the mapper.
The entity classification system provides mappers with the means to define which classes are available, what their defaults relationships to and from other classes are, and which explicit relationships are established between classes.
Classifications can have relationships between each-other. The following relationships are available:
|R_AL||(ALLY) pals. Good alternative to R_NO when applicable.|
|R_FR||(FEAR) will run.|
|R_NO||(NO RELATIONSHIP) disregard.|
|R_DL||(DISLIKE) will attack.|
|R_HT||(HATE) will attack this character instead of any visible DISLIKEd characters.|
|R_NM||(NEMESIS) A monster Will ALWAYS attack its nemesis, no matter what.|
A classification is a way for entities to identify which group they belong to. For example, all HECU entities use
HUMAN_MILITARY to identify themselves as allies, and to identify scientists and security guards, who are
HUMAN_PASSIVE, as enemies.
A classification is identified by its name, and has settings that can be changed:
|Default source relationship||The default relationship from one classification to another. If no relationship is defined between a classification and its target, this relationship will be implied. Defaults to R_NO.|
|Default target relationship||The default relationship from the target classification to a source classification. This lets a classification define a default response to itself, sort of like an aura of effect that overrides the default source relationship. If not specified, this will have no effect.|
Classifications can also be aliased to remap one to another. Useful when a classification is removed so it can adopt anothers' behavior.
The classification system can be reset to wipe all existing classifications and relationships. This allows one to rebuild the classifications and their relationships from the ground up.
When reset, only the default
NONE classification will be defined, with a default relationship of R_NO.
Map configuration syntax
Classes and relationships can be defined using the map configuration file.
All options are defined within the
entity_classifications section, inside the main
The reset keyvalue can be used to reset the classification system. When set to 1, a reset will be performed prior to classification processing.
This can be either a keyvalue or a section. In keyvalue form, all settings will be their default values, and optional settings will not be defined.
In section form, the following settings are available:
|name||Name of this classification. Required.|
|defaultSourceRelationship||The default source relationship.|
|defaultTargetRelationship||The default target relationship. Optional.|
See the description for classes above for more information about the settings and their default values.
The alias section defines an alias.
The following settings are available:
|source||Name of the alias.|
|target||Name of the classification to map to.|
The relationship section defines an alias.
The following settings are available:
|source||Name of the classification that the relationship is from.|
|target||Name of the classification to check the relationship with.|
|relationship||Relationship type. See [[Relationship|
|biDirectional||Whether this relationship should be established between target and source as well. Set to 1 to enable.|
Level design features
All monsters have a keyvalue called "Classification Override" that lets you specify which classification that monster should use. This keyvalue can be used on any other entity as well, but is only defined for monsters at this time.
monstermaker has a keyvalue that lets you specify the override for the monster it spawns.
This command will output a matrix of all classifications and their relationships with each-other to a text file. The name of the text file is provided as input, and includes the extension. This file will be created in
The file will contain the number of classes on the first line, the matrix following it, and the number of aliases and mappings of aliases to classifications.
When modifying the classification of an entity, all one has to do is override
EntityClassification_t GetClassification() and return the Id of the classification. Typically this is done by calling
EntityClassifications().GetClassificationId( "my entity classification" ).
The default classifications used by entities are defined in the
Determining the classification of an entity is done using the
EntityClassification_t Classify() method.
- In multiplayer, player info is shown if a player has the same classification as the player looking at them, and if the player looking at them does not have the
NONEclassification. If you wish to remove all classes, you must still define
PLAYERfor this information to display. (The
NONEclassification disables this information due to all world objects using that classification)