![]() |
DI-Guy SDK Documentation
13.7.1
|
The character type map provides extra information about DI-Guy character types and appearances. More...
#include <diguyCharacterTypeMap.h>
Public Member Functions | |
| const char * | get_type_map_id () |
| This function returns the type map id of this type map object, in which the current value of all fields are concatenated together, separated by slashes. More... | |
| const char * | get_mapped_character_type () |
| This function returns the character type this type map maps to. More... | |
| const char * | get_mapped_appearance () |
| This function returns the appearance this type map maps to. More... | |
| const char * | get_field_value (diguyCharacterTypeMapField field) |
| Returns: the value of the specified field. More... | |
| const diguyCharacterTypeMapFieldValues & | get_field_values () |
| Returns: the value of the specified field. More... | |
| const char * | get_field_value_using_field_string (const char *field) |
| Returns: the value of the specified field. More... | |
| int | match_level (const diguyCharacterTypeMapFieldValues &field_values, const diguyCharacterTypeMapFieldValues *alternate_values=nullptr) |
| Performs a match check against the given field values (and alternates, if given). More... | |
| int | get_most_recent_match_passed () |
| Returns: whether the most recent match call passed or not; 1 if so, 0 if not. More... | |
| int | get_most_recent_match_level () |
| Returns: total match value from most recent match operation; Higher number means better match. More... | |
| int | get_most_recent_exact_value_matches () |
| Returns: number of exact value matches in most recent match operation. More... | |
| int | get_most_recent_alternate_value_matches () |
| Returns: number of alternate value matches in most recent match operation. More... | |
| int | get_most_recent_wildcard_value_matches () |
| Returns: number of wildcard value matches in most recent match operation. More... | |
| int | get_num_wildcards () |
| Returns: number of fields that have wildcard values. More... | |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| bdiMotgenTypeMap * | m_scripted_object |
| A pointer to internal data. More... | |
| class | bdiMotgenTypeMap |
| bdiMotgenTypeMap * | get_scripted_object () |
| diguyCharacterTypeMap (bdiMotgenTypeMap *scripted_object) | |
| A private constructor. More... | |
| ~diguyCharacterTypeMap () | |
| A private destructor. More... | |
The character type map provides extra information about DI-Guy character types and appearances.
This information allows users and DI-Guy Scenario to query DI-Guy about the best match character type and appearance based on certain criteria.
Type maps are broken down into fields, described below.
For example, the function diguyScenario::get_nearest_character_type_map() will return a diguyCharacterTypeMap that best matches the specified class, category, subcategory, sex, age, etc.
The Appearance Wizard in DI-Guy Scenario, provides a graphical user interface for finding the best character types and appearances based on the same information.
Each type map is identified by a number of fields. The value in each field is a string.
The available fields are:
character_class category subcategory sex age race country military_branch carried_object
Refer to the online documentation page "Character Type and Appearance Map Info" for information on exactly what values are available for each field.
Certain field values have special meanings. A "*" is a "wildcard", meaning that in match operations it will match any value. If a type map doesn't specify a value for a field, that field value is by convention set to "-". For example, a human with no weapon would have its carried_object field set to "-".
When calling functions, fields can be specified numerically using the diguyCharacterTypeMapField enumeration, or each field has a string name, as well.
These fields tend to specify the "what it can do" part of a type map. These fields tend to be set by the character type, as the selection of actions provided with different character types tend to be what limits what a DI-Guy character can do.
Sometimes the selected appearance of a character will override the category and subcategory fields. For example, the soldier_07 character type is most often category/subcategory military/soldier. A police officer appearance can be selected for a soldier character, however, which will change the category/subcategory to emergency/police.
character_class
The high-level "class" of a character type. This list may grow as more character types are added to DI-Guy. Examples: - human - object - vehicle - animal
category
A category of a character class. Different classes tend to have different categories. This list may grow as more character types are added to DI-Guy. Human class examples: - military - civilian - emergency - (more)
subcategory
A further breakdown of categories. Different categories tend to have different subcategories. This list may grow as more character types are added to DI-Guy. Human/emergency subclass examples: - fire - medical - police - soldier - (more)
These fields tend to specify the "what does it look like" part of a type map. These fields tend to be set by the appearance of a character, for obvious reasons.
sex
The gender of the appearance. Humans and animals and "male" or "female", while other classes usually have sex "none". - male - female - none
age
The age of the appearance. This is a an age description rather than a specific age in years. - baby - toddler - child - teenager - adult - elderly
race
The race of the appearance. (Note that these race classifications are not meant to offend. Please excuse any unintentional offense or omission.) Generally for human class only. Examples: - white - black - hispanic - asian - native_american - middle_eastern - none - (more in the future)
country
The country of the appearance, if any. This list will grow as more appearances are added to DI-Guy. Examples: - usa - uk - france - japan - iraq - afghanistan - chile - russia - none - (more in the future)
military_branch
The military branch of the appearance, if any. This list may grow as more appearances are added to DI-Guy. Examples: - army - navy - air_force - marines - coast_guard - irregular - none - (more in the future)
carried_object
The object carried by the appearance, if any. Examples: - m16 - m203 - 2x4 - hammer - (more)
Some functions take or return a "type map id". This is a string in which the values of the type map's fields are concatenated in the form:
character_class/category/subcategory/sex/age/race/country/military_branch/carried_object
For example, the string "human/military/soldier/male/adult/black/usa/army/m16" is a valid type map id.
All public functions in this class are callable from:
|
private |
A private constructor.
|
private |
A private destructor.
| const char* diguyCharacterTypeMap::get_type_map_id | ( | ) |
This function returns the type map id of this type map object, in which the current value of all fields are concatenated together, separated by slashes.
An example return value is "human/military/soldier/male/adult/black/usa/army/m16".
Returns:
type map id string; will never be NULL
| const char* diguyCharacterTypeMap::get_mapped_character_type | ( | ) |
This function returns the character type this type map maps to.
This is important for match results.
The returned character type can be used, for example, in a call to diguyScenario::create_character().
Returns:
character type string; will never be NULL
| const char* diguyCharacterTypeMap::get_mapped_appearance | ( | ) |
This function returns the appearance this type map maps to.
This is important for match results.
The returned appearance can be used, for example, in a call to diguyCharacter::set_appearance().
Returns:
appearance string; will never be NULL
| const char* diguyCharacterTypeMap::get_field_value | ( | diguyCharacterTypeMapField | field | ) |
Returns: the value of the specified field.
| const diguyCharacterTypeMapFieldValues& diguyCharacterTypeMap::get_field_values | ( | ) |
Returns: the value of the specified field.
| const char* diguyCharacterTypeMap::get_field_value_using_field_string | ( | const char * | field | ) |
Returns: the value of the specified field.
| int diguyCharacterTypeMap::match_level | ( | const diguyCharacterTypeMapFieldValues & | field_values, |
| const diguyCharacterTypeMapFieldValues * | alternate_values = nullptr |
||
| ) |
Performs a match check against the given field values (and alternates, if given).
This will update the most recent values returned by the following accessors.
Returns:
The total match value for the match operation. Higher number means better match. If match level is 0, match failed.
| int diguyCharacterTypeMap::get_most_recent_match_passed | ( | ) |
Returns: whether the most recent match call passed or not; 1 if so, 0 if not.
| int diguyCharacterTypeMap::get_most_recent_match_level | ( | ) |
Returns: total match value from most recent match operation; Higher number means better match.
If match level is 0, match failed.
| int diguyCharacterTypeMap::get_most_recent_exact_value_matches | ( | ) |
Returns: number of exact value matches in most recent match operation.
| int diguyCharacterTypeMap::get_most_recent_alternate_value_matches | ( | ) |
Returns: number of alternate value matches in most recent match operation.
| int diguyCharacterTypeMap::get_most_recent_wildcard_value_matches | ( | ) |
Returns: number of wildcard value matches in most recent match operation.
| int diguyCharacterTypeMap::get_num_wildcards | ( | ) |
Returns: number of fields that have wildcard values.
|
inline |
|
friend |
|
private |
A pointer to internal data.