UFO: Alien Invasion
|
UFO scripts used in client and server. More...
#include "scripts.h"
#include "../shared/parse.h"
#include "../shared/keyvaluepair.h"
#include "../game/inventory.h"
#include "../client/cl_screen.h"
Go to the source code of this file.
Data Structures | |
struct | com_constNameInt_s |
Structure to map (script) strings and integer (enum) values. More... | |
struct | parseItemWeapon_t |
Macros | |
#define | CONSTNAMEINT_HASH_SIZE 32 |
#define | MAX_CONSTNAMEINT_NAME 32 |
#define | TERRAIN_HASH_SIZE 64 |
Typedefs | |
typedef struct com_constNameInt_s | com_constNameInt_t |
Structure to map (script) strings and integer (enum) values. More... | |
Enumerations | |
enum | aircraftType_t { CRAFT_DROP, CRAFT_INTER, CRAFT_UFO, CRAFT_MAX } |
enum | { OD_WEAPON, OD_PROTECTION, OD_RATINGS } |
The order here must be the same as in od_vals. More... | |
Functions | |
static const char * | Com_ConstIntGetVariable (const char *name) |
Will extract the variable from a string<=>int mapping string which contain a namespace. More... | |
bool | Com_GetConstInt (const char *name, int *value) |
Searches whether a given value was registered as a string to int mapping. More... | |
bool | Com_GetConstIntFromNamespace (const char *space, const char *variable, int *value) |
Searches whether a given value was registered as a string to int mapping. More... | |
const char * | Com_GetConstVariable (const char *space, int value) |
Searches the mapping variable for a given integer value and a namespace. More... | |
bool | Com_UnregisterConstVariable (const char *name) |
Removes a registered constant from the script mapping hash table. More... | |
void | Com_RegisterConstInt (const char *name, int value) |
Register mappings between script strings and enum values for values of the type V_INT . More... | |
bool | Com_UnregisterConstList (const constListEntry_t constList[]) |
Unregisters a list of string aliases. More... | |
void | Com_RegisterConstList (const constListEntry_t constList[]) |
Registers a list of string aliases. More... | |
static int | Com_FindNameType (const char *nameType) |
const char * | Com_EParse (const char **text, const char *errhead, const char *errinfo, char *target, size_t size) |
Parsing function that prints an error message when there is no text in the buffer. More... | |
static void | Com_ParseVersion (const char *version) |
CASSERT (lengthof(vt_names)==V_NUM_TYPES) | |
CASSERT (lengthof(align_names)==ALIGN_LAST) | |
CASSERT (lengthof(blend_names)==BLEND_LAST) | |
CASSERT (lengthof(style_names)==STYLE_LAST) | |
CASSERT (lengthof(fade_names)==FADE_LAST) | |
CASSERT (lengthof(vt_sizes)==V_NUM_TYPES) | |
CASSERT (lengthof(vt_aligns)==V_NUM_TYPES) | |
const char * | Com_GetLastParseError (void) |
void * | Com_AlignPtr (const void *memory, valueTypes_t type) |
Align a memory to use a natural address for the data type we will write. More... | |
static const char * | Com_GetAircraftDef (aircraftType_t type, short idNum) |
static short | Com_GetAircraftIdNum (aircraftType_t type, const char *idString) |
static void | Com_GetAircraftIdStr (aircraftType_t type, short idNum, char *outStr, const size_t size) |
static short | Com_GetCrashedAircraftIdNum (aircraftType_t type, const char *idString) |
static void | Com_GetCrashedAircraftIdStr (aircraftType_t type, short idNum, char *outStr, const size_t size) |
static ufoType_t | Com_GetUfoIdNum (const char *idString) |
static ufoType_t | Com_GetCrashedUfoIdNum (const char *idString) |
static void | Com_GetUfoIdStr (ufoType_t idNum, char *outStr, const size_t size) |
static void | Com_GetCrashedUfoIdStr (ufoType_t idNum, char *outStr, const size_t size) |
static short | Com_GetHumanCraftIdNum (const char *idString) |
static void | Com_GetHumanCraftIdStr (short idNum, char *outStr, const size_t size) |
short | Com_GetUfoIdsNum (void) |
short | Com_GetDropShipIdsNum (void) |
short | Com_GetHumanAircraftIdsNum (void) |
static void | Com_ParseAircraftNames (const char *const name, const char **text) |
Parse the aircraft names from the scripts. More... | |
resultStatus_t | Com_ParseValue (void *base, const char *token, valueTypes_t type, int ofs, size_t size, size_t *writtenBytes) |
Parse a value from a string. More... | |
int | Com_EParseValue (void *base, const char *token, valueTypes_t type, int ofs, size_t size) |
bool | Com_ParseBoolean (const char *token) |
Parses a boolean from a string. More... | |
int | Com_SetValue (void *base, const void *set, valueTypes_t type, int ofs, size_t size) |
const char * | Com_ValueToStr (const void *base, const valueTypes_t type, const int ofs) |
bool | Com_ParseBlockToken (const char *name, const char **text, void *base, const value_t *values, memPool_t *mempool, const char *token) |
bool | Com_ParseList (const char **text, linkedList_t **list) |
bool | Com_ParseBlock (const char *name, const char **text, void *base, const value_t *values, memPool_t *mempool) |
static effectStages_t | Com_ParseItemEffect (itemEffect_t *e, const char *name, const char **text) |
Parses the item effect. More... | |
static void | Com_ParseFireEffect (fireDef_t *fd, const char *name, const char **text) |
Parses the effect that is bound to a fire definitions. More... | |
static bool | Com_ParseFire (const char *name, const char **text, fireDef_t *fd) |
Parses the firemode. More... | |
static void | Com_ParseArmourOrResistance (const char *name, const char **text, short *ad, bool rating) |
Parses the armour definitions or the team resistance values from script files. The protection and rating values. More... | |
CASSERT (lengthof(air_slot_type_strings)==MAX_ACITEMS) | |
static void | Com_ParseFireDefinition (objDef_t *od, const char *name, const char **text) |
static void | Com_ParseObjDefEffect (objDef_t *od, const char *name, const char **text) |
static void | Com_ParseItem (const char *name, const char **text) |
Parses weapon, equipment, craft items and armour. More... | |
static void | Com_ParseImplant (const char *name, const char **text) |
static void | Com_ParseInventory (const char *name, const char **text) |
static void | Com_ParseEquipment (const char *name, const char **text) |
static const char * | Com_GiveName (int gender, const teamDef_t *td) |
static teamDef_t::model_t const * | Com_GiveModel (int gender, const teamDef_t *td) |
const teamDef_t * | Com_GetTeamDefinitionByID (const char *team) |
Returns the teamDef pointer for the searched team id - or nullptr if not found in the teamDef array. More... | |
bool | Com_GetCharacterModel (character_t *chr) |
static int | Com_GetGender (const teamDef_t *teamDef) |
Return a random (weighted by number of models) gender for this teamDef. More... | |
void | Com_GetCharacterValues (const char *teamDefition, character_t *chr) |
Assign character values, 3D models and names to a character. More... | |
static void | Com_ParseActorNames (const char *name, const char **text) |
Parses "name" definition from team_* ufo script files. More... | |
static void | Com_ParseActorModels (const char *name, const char **text, teamDef_t *td) |
Parses "actors" definition from team_* ufo script files. More... | |
static void | Com_ParseActorSounds (const char *name, const char **text, teamDef_t *td) |
Parses "actorsounds" definition from team_* ufo script files. More... | |
static const BodyData * | Com_GetBodyTemplateByID (const char *id) |
static const teamNames_t * | Com_GetNameListByID (const char *id) |
static void | Com_ParseTeam (const char *name, const char **text) |
const chrTemplate_t * | Com_GetCharacterTemplateByID (const char *chrTemplate) |
Returns the chrTemplate pointer for the given id - or nullptr if not found in the chrTemplates array. More... | |
static void | Com_ParseUGVs (const char *name, const char **text) |
Parse 2x2 units (e.g. UGVs) More... | |
static void | Com_ParseCharacterTemplate (const char *name, const char **text) |
Parses character templates from scripts. More... | |
static void | Com_ParseBodyPart (const char *name, const char **text, BodyData *bd) |
static void | Com_ParseBodyTemplate (const char *name, const char **text) |
const terrainType_t * | Com_GetTerrainType (const char *textureName) |
Searches the terrain definition if given. More... | |
static void | Com_ParseTerrain (const char *name, const char **text) |
Parses "terrain" definition from script files. More... | |
static void | Com_ParseGameTypes (const char *name, const char **text) |
static void | Com_ParseDamageTypes (const char *name, const char **text) |
const char * | Com_GetRandomMapAssemblyNameForCraft (const char *craftID) |
Returns the name of an aircraft or an ufo that is used in the ump files for the random map assembly. More... | |
const char * | Com_GetRandomMapAssemblyNameForCrashedCraft (const char *craftID) |
humanAircraftType_t | Com_DropShipShortNameToID (const char *token) |
Translate DropShip type to short name. More... | |
const char * | Com_DropShipTypeToShortName (humanAircraftType_t type) |
Translate DropShip type to short name. More... | |
ufoType_t | Com_UFOShortNameToID (const char *token) |
Translate short name to UFO type. More... | |
const char * | Com_UFOTypeToShortName (ufoType_t type) |
Translate UFO type to short name. More... | |
const char * | Com_UFOCrashedTypeToShortName (ufoType_t type) |
Translate UFO type to short name when UFO is crashed. More... | |
const ugv_t * | Com_GetUGVByIDSilent (const char *ugvID) |
Searches an UGV definition by a given script id and returns the pointer to the global data. More... | |
const ugv_t * | Com_GetUGVByID (const char *ugvID) |
Searches an UGV definition by a given script id and returns the pointer to the global data. More... | |
static void | Com_AddObjectLinks (void) |
Creates links to other items (i.e. ammo<->weapons) More... | |
static void | Com_ParseMapDefinition (const char *name, const char **text) |
static void | Com_ParseTerrainDefinition (const char *name, const char **text) |
int | Com_GetMapDefNumber (void) |
mapDef_t * | Com_GetMapDefByIDX (int index) |
mapDef_t * | Com_GetMapDefinitionByID (const char *mapDefID) |
void | Com_ParseScripts (bool onlyServer) |
int | Com_GetScriptChecksum (void) |
void | Com_Shutdown (void) |
Variables | |
static com_constNameInt_t * | com_constNameInt |
Linked list of all the registeres mappings. More... | |
static com_constNameInt_t * | com_constNameInt_hash [CONSTNAMEINT_HASH_SIZE] |
Hash of all the registeres mappings. More... | |
static bool | versionParsed |
const char *const | vt_names [] |
possible values for parsing functions More... | |
const char *const | align_names [] |
const char *const | blend_names [] |
const char *const | style_names [] |
const char *const | fade_names [] |
static const size_t | vt_sizes [] |
target sizes for buffer More... | |
static const size_t | vt_aligns [] |
natural align for each targets More... | |
static char | parseErrorMessage [256] |
static const char *const | craftTypeIds [CRAFT_MAX *2] |
static const char * | ufoIdsTable [UFO_MAX] |
Ufoai uses two types of ids for aircraft: the string is used for references in the scripts, the numeric/enum type in the code. This tables and the following functions convert these ids. More... | |
static const char * | dropIdsTable [DROPSHIP_MAX] |
static const char * | interIdsTable [INTERCEPTOR_MAX] |
static const char **const | aircraftIdsTable [CRAFT_MAX] |
static short | aircraftIdsNum [CRAFT_MAX] |
static const char *const | skillNames [SKILL_NUM_TYPES+1] |
static const value_t | od_vals [] |
static const value_t | effect_vals [] |
static const value_t | fdps [] |
const char *const | air_slot_type_strings [] = AIR_SLOT_TYPE_STRINGS |
List of valid strings for slot types. More... | |
static linkedList_t * | parseItemWeapons = nullptr |
Temporary list of weapon ids as parsed from the ufo file "weapon_mod \<id\>" in Com_ParseItem and used in Com_AddObjectLinks. More... | |
static const value_t | implant_vals [] |
static const value_t | idps [] |
const char *const | name_strings [NAME_NUM_TYPES] |
static const value_t | equipment_definition_vals [] |
Valid equipment definition values from script files. More... | |
static const value_t | teamDefValues [] |
possible teamdesc values (ufo-scriptfiles) More... | |
static const value_t | ugvValues [] |
static const value_t | bodyPartValues [] |
static const char *const | penaltyNames [MODIFIER_MAX] |
static terrainType_t * | terrainTypesHash [TERRAIN_HASH_SIZE] |
static const value_t | terrainTypeValues [] |
static const value_t | gameTypeValues [] |
possible gametype values for the gameserver (ufo-scriptfiles) More... | |
static const value_t | mapdef_vals [] |
valid mapdef descriptors More... | |
UFO scripts used in client and server.
Definition in file scripts.cpp.
#define CONSTNAMEINT_HASH_SIZE 32 |
Definition at line 32 of file scripts.cpp.
Referenced by Com_GetConstInt(), Com_RegisterConstInt(), and Com_UnregisterConstVariable().
#define MAX_CONSTNAMEINT_NAME 32 |
Definition at line 34 of file scripts.cpp.
#define TERRAIN_HASH_SIZE 64 |
Definition at line 3072 of file scripts.cpp.
Referenced by Com_GetTerrainType(), and Com_ParseTerrain().
typedef struct com_constNameInt_s com_constNameInt_t |
Structure to map (script) strings and integer (enum) values.
anonymous enum |
The order here must be the same as in od_vals.
Enumerator | |
---|---|
OD_WEAPON |
parse a weapon |
OD_PROTECTION |
parse armour protection values |
OD_RATINGS |
parse rating values for displaying in the menus |
Definition at line 1464 of file scripts.cpp.
enum aircraftType_t |
Enumerator | |
---|---|
CRAFT_DROP | |
CRAFT_INTER | |
CRAFT_UFO | |
CRAFT_MAX |
Definition at line 451 of file scripts.cpp.
CASSERT | ( | lengthof(vt_names) | = =V_NUM_TYPES | ) |
CASSERT | ( | lengthof(align_names) | = =ALIGN_LAST | ) |
CASSERT | ( | lengthof(blend_names) | = =BLEND_LAST | ) |
CASSERT | ( | lengthof(style_names) | = =STYLE_LAST | ) |
CASSERT | ( | lengthof(fade_names) | = =FADE_LAST | ) |
CASSERT | ( | lengthof(vt_sizes) | = =V_NUM_TYPES | ) |
CASSERT | ( | lengthof(vt_aligns) | = =V_NUM_TYPES | ) |
CASSERT | ( | lengthof(air_slot_type_strings) | = =MAX_ACITEMS | ) |
Creates links to other items (i.e. ammo<->weapons)
Definition at line 3417 of file scripts.cpp.
References AC_ITEM_WEAPON, objDef_s::ammos, Com_DPrintf(), objDef_s::craftitem, csi, DEBUG_SHARED, i, objDef_s::id, INVSH_GetItemByID(), INVSH_GetItemByIDX(), LIST_Delete(), LIST_Foreach, m, MAX_AMMOS_PER_OBJDEF, Mem_Free, objDef_s::numAmmos, csi_s::numODs, objDef_s::numWeapons, csi_s::ods, Sys_Error(), craftitem_s::type, objDef_s::weapon, and objDef_s::weapons.
Referenced by Com_ParseScripts().
void* Com_AlignPtr | ( | const void * | memory, |
valueTypes_t | type | ||
) |
Align a memory to use a natural address for the data type we will write.
Definition at line 440 of file scripts.cpp.
References Sys_Error(), type, V_NULL, and V_NUM_TYPES.
Referenced by CL_ParsePtlCmds(), Com_ParseValue(), Com_SetValue(), Com_ValueToStr(), UI_InitRawActionValue(), and UI_ParseProperty().
|
static |
Will extract the variable from a string<=>int mapping string which contain a namespace.
name | The name of the script entry to map to an integer |
nullptr
otherwise Definition at line 57 of file scripts.cpp.
References name.
Referenced by Com_GetConstInt(), Com_RegisterConstInt(), and Com_UnregisterConstVariable().
humanAircraftType_t Com_DropShipShortNameToID | ( | const char * | token | ) |
Translate DropShip type to short name.
Definition at line 3329 of file scripts.cpp.
References Com_ParseValue(), and V_AIRCRAFTTYPE.
Referenced by Com_ParseEquipment(), and GAME_GetImportData().
const char* Com_DropShipTypeToShortName | ( | humanAircraftType_t | type | ) |
Translate DropShip type to short name.
Definition at line 3341 of file scripts.cpp.
References Com_ValueToStr(), and V_AIRCRAFTTYPE.
Referenced by GAME_GetImportData().
const char* Com_EParse | ( | const char ** | text, |
const char * | errhead, | ||
const char * | errinfo, | ||
char * | target, | ||
size_t | size | ||
) |
Parsing function that prints an error message when there is no text in the buffer.
Definition at line 277 of file scripts.cpp.
References Com_Parse(), and Com_Printf().
Referenced by CL_ParseLanguages(), CL_ParseMessageID(), CL_ParseParticle(), CL_ParsePtlCmds(), CL_ParseSequence(), Com_EParse_(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseActorSounds(), Com_ParseAircraftNames(), Com_ParseArmourOrResistance(), Com_ParseBlock(), Com_ParseBlockToken(), Com_ParseBodyPart(), Com_ParseBodyTemplate(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseFire(), Com_ParseFireDefinition(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseItem(), Com_ParseMapDefinition(), Com_ParseTeam(), Com_ParseTerrainDefinition(), SV_GetCvarToken(), SV_GetTileFromTileSet(), SV_GetTilesFromTileSet(), SV_ParseAssembly(), SV_ParseAssemblySeeds(), SV_ParseMapTile(), SV_ParseMapTileSet(), UI_ParseActionList(), UI_ParseCallAction(), UI_ParseComponent(), UI_ParseEventProperty(), UI_ParseExcludeRect(), UI_ParseFont(), UI_ParseNode(), UI_ParseNodeBody(), UI_ParseNodeProperties(), UI_ParseProperty(), UI_ParseSetAction(), and UI_ParseUIModel().
int Com_EParseValue | ( | void * | base, |
const char * | token, | ||
valueTypes_t | type, | ||
int | ofs, | ||
size_t | size | ||
) |
Definition at line 978 of file scripts.cpp.
References Com_ParseValue(), Com_Printf(), RESULT_ERROR, RESULT_OK, RESULT_WARNING, and Sys_Error().
Referenced by CL_ParseMapParticle(), CL_ParsePtlCmds(), CL_SpawnParseEntitystring(), Com_ParseBlockToken(), Com_ParseBodyPart(), Com_ParseCharacterTemplate(), GAME_GetImportData(), SEQ_ExecuteCamera(), SEQ_ExecuteModel(), SEQ_ExecuteObj2D(), UI_InitRawActionValue(), UI_ParseExcludeRect(), UI_ParseFont(), UI_ParseUIModel(), and WEB_ListCGameFilesCallback().
|
static |
Find name type id by is name
Definition at line 263 of file scripts.cpp.
References i, NAME_NUM_TYPES, name_strings, and Q_streq.
Referenced by Com_ParseActorModels(), and Com_ParseActorNames().
|
static |
Definition at line 482 of file scripts.cpp.
References type.
Referenced by Com_GetAircraftIdStr(), and Com_GetCrashedAircraftIdStr().
|
static |
Definition at line 490 of file scripts.cpp.
References AIRCRAFT_NONE, i, Q_streq, Q_strnull(), Q_strstart(), type, and va().
Referenced by Com_GetHumanCraftIdNum(), Com_GetUfoIdNum(), and Com_ParseAircraftNames().
|
static |
Definition at line 502 of file scripts.cpp.
References Com_GetAircraftDef(), and Com_sprintf().
Referenced by Com_GetHumanCraftIdStr(), and Com_GetUfoIdStr().
|
static |
Definition at line 2675 of file scripts.cpp.
References csi_s::bodyTemplates, Com_Printf(), csi, LIST_Foreach, and Q_streq.
Referenced by Com_ParseTeam().
bool Com_GetCharacterModel | ( | character_t * | chr | ) |
Definition at line 2380 of file scripts.cpp.
References teamDef_s::model_t::body, character_s::body, teamDef_s::model_t::bodySkin, character_s::bodySkin, Com_GiveModel(), character_s::gender, teamDef_s::model_t::head, character_s::head, teamDef_s::model_t::headSkin, character_s::headSkin, teamDef_s::model_t::path, character_s::path, Q_strncpyz(), and character_s::teamDef.
Referenced by Com_GetCharacterValues(), and GAME_LoadCharacter().
const chrTemplate_t* Com_GetCharacterTemplateByID | ( | const char * | chrTemplate | ) |
Returns the chrTemplate pointer for the given id - or nullptr if not found in the chrTemplates array.
[in] | chrTemplate | The character template id (given in ufo-script files) |
Definition at line 2831 of file scripts.cpp.
References csi_s::chrTemplates, Com_Printf(), csi, i, chrTemplate_s::id, csi_s::numChrTemplates, Q_streq, and Q_strnull().
Referenced by Com_ParseTeam().
void Com_GetCharacterValues | ( | const char * | teamDefition, |
character_t * | chr | ||
) |
Assign character values, 3D models and names to a character.
[in] | teamDefition | The team definition id to use to generate the character values. |
[in,out] | chr | The character that should get the paths to the different models/skins. |
Definition at line 2430 of file scripts.cpp.
References ACTOR_SIZE_INVALID, ACTOR_SIZE_NORMAL, Com_Error(), Com_GetCharacterModel(), Com_GetGender(), Com_GetTeamDefinitionByID(), Com_GiveName(), ERR_DROP, character_s::fieldSize, character_s::gender, character_s::name, NAME_LAST, Q_strcat(), Q_strncpyz(), teamDef_s::size, and character_s::teamDef.
Referenced by CL_GenerateCharacter(), and SV_InitGameProgs().
bool Com_GetConstInt | ( | const char * | name, |
int * | value | ||
) |
Searches whether a given value was registered as a string to int mapping.
[in] | name | The name of the string mapping (maybe including a namespace) |
[out] | value | The mapped integer if found, not touched if the given string was found in the registered values. |
Definition at line 74 of file scripts.cpp.
References Com_ConstIntGetVariable(), Com_HashKey(), CONSTNAMEINT_HASH_SIZE, hash, com_constNameInt_s::hash_next, and Q_streq.
Referenced by Com_GetConstIntFromNamespace(), Com_ParseValue(), GAME_GetImportData(), SV_InitGameProgs(), and TEST_F().
bool Com_GetConstIntFromNamespace | ( | const char * | space, |
const char * | variable, | ||
int * | value | ||
) |
Searches whether a given value was registered as a string to int mapping.
[in] | space | The namespace of the mapping variable |
[in] | variable | The name of the string mapping |
[out] | value | The mapped integer if found, not touched if the given string was found in the registered values. |
Definition at line 103 of file scripts.cpp.
References Com_GetConstInt(), Q_strnull(), and va().
Referenced by GAME_GetImportData(), GAME_LoadCharacter(), and SV_InitGameProgs().
const char* Com_GetConstVariable | ( | const char * | space, |
int | value | ||
) |
Searches the mapping variable for a given integer value and a namespace.
[in] | space | The namespace to search in - might not be nullptr or empty. |
[in] | value | The mapped integer |
Definition at line 122 of file scripts.cpp.
References com_constNameInt, com_constNameInt_s::fullname, com_constNameInt_s::name, com_constNameInt_s::next, and com_constNameInt_s::value.
Referenced by GAME_GetImportData(), GAME_SaveCharacter(), SV_InitGameProgs(), and TEST_F().
|
static |
Definition at line 511 of file scripts.cpp.
References AIRCRAFT_NONE, CRAFT_MAX, i, Q_streq, Q_strnull(), Q_strstart(), type, and va().
Referenced by Com_GetCrashedUfoIdNum().
|
static |
Definition at line 523 of file scripts.cpp.
References Com_GetAircraftDef(), Com_sprintf(), and CRAFT_MAX.
Referenced by Com_GetCrashedUfoIdStr().
|
static |
Definition at line 537 of file scripts.cpp.
References Com_GetCrashedAircraftIdNum(), and CRAFT_UFO.
Referenced by Com_ParseValue(), and Com_SetValue().
Definition at line 547 of file scripts.cpp.
References Com_GetCrashedAircraftIdStr(), and CRAFT_UFO.
Referenced by Com_ValueToStr().
short Com_GetDropShipIdsNum | ( | void | ) |
Definition at line 579 of file scripts.cpp.
References CRAFT_DROP.
Referenced by GAME_GetImportData().
Return a random (weighted by number of models) gender for this teamDef.
[in] | teamDef | pointer to the teamDef to get the gender for. |
Definition at line 2404 of file scripts.cpp.
References Com_Error(), ERR_DROP, teamDef_s::name, NAME_LAST, teamDef_s::numModels, and teamDef_s::numNames.
Referenced by Com_GetCharacterValues().
short Com_GetHumanAircraftIdsNum | ( | void | ) |
Definition at line 584 of file scripts.cpp.
References CRAFT_DROP, and CRAFT_INTER.
Referenced by GAME_GetImportData().
|
static |
Definition at line 552 of file scripts.cpp.
References AIRCRAFT_NONE, Com_GetAircraftIdNum(), CRAFT_DROP, and CRAFT_INTER.
Referenced by Com_ParseValue(), and Com_SetValue().
|
static |
Definition at line 565 of file scripts.cpp.
References Com_GetAircraftIdStr(), CRAFT_DROP, and CRAFT_INTER.
Referenced by Com_ValueToStr().
const char* Com_GetLastParseError | ( | void | ) |
Returns the last error message
Definition at line 431 of file scripts.cpp.
References parseErrorMessage.
Referenced by UI_NodeSetProperty(), and UI_ParseProperty().
Definition at line 3615 of file scripts.cpp.
References cgi, csi, cgame_import_s::csi, index, and csi_s::mds.
Referenced by Com_ParseMapDefinition().
mapDef_t* Com_GetMapDefinitionByID | ( | const char * | mapDefID | ) |
Definition at line 3620 of file scripts.cpp.
References Com_DPrintf(), DEBUG_SHARED, mapDef_s::id, MapDef_Foreach, and Q_streq.
Referenced by GAME_GetImportData(), and TEST_F().
Definition at line 3610 of file scripts.cpp.
References cgi, csi, cgame_import_s::csi, and csi_s::numMDs.
|
static |
Definition at line 2684 of file scripts.cpp.
References csi_s::actorNames, Com_Printf(), csi, LIST_Foreach, and Q_streq.
Referenced by Com_ParseTeam().
const char* Com_GetRandomMapAssemblyNameForCraft | ( | const char * | craftID | ) |
Returns the name of an aircraft or an ufo that is used in the ump files for the random map assembly.
Definition at line 3299 of file scripts.cpp.
References va().
Referenced by GAME_GetImportData(), TEST_F(), GameTest::testCountSpawnpointsForMapWithAssembly(), and GameTest::testCountSpawnpointsForMapWithAssemblyAndAircraft().
const char* Com_GetRandomMapAssemblyNameForCrashedCraft | ( | const char * | craftID | ) |
Definition at line 3307 of file scripts.cpp.
References Q_streq.
Referenced by GAME_GetImportData().
Definition at line 3739 of file scripts.cpp.
References Com_BlockChecksum(), FS_GetFileData(), and LittleLong.
Referenced by CL_CanMultiplayerStart(), and SV_Map().
const teamDef_t* Com_GetTeamDefinitionByID | ( | const char * | team | ) |
Returns the teamDef pointer for the searched team id - or nullptr if not found in the teamDef array.
[in] | team | The team id (given in ufo-script files) |
Definition at line 2367 of file scripts.cpp.
References Com_Printf(), csi, i, teamDef_s::id, csi_s::numTeamDefs, Q_streq, and csi_s::teamDef.
Referenced by Com_GetCharacterValues(), GAME_GetImportData(), GAME_ItemIsUseable(), GAME_LoadCharacter(), and TEST_F().
const terrainType_t* Com_GetTerrainType | ( | const char * | textureName | ) |
Searches the terrain definition if given.
[in] | textureName | The terrain definition id from script files which is the texture name relative to base/textures |
Definition at line 3089 of file scripts.cpp.
References Com_HashKey(), hash, terrainType_s::hash_next, Q_streq, and TERRAIN_HASH_SIZE.
Referenced by Com_ParseTerrain(), LE_PlaySoundFileAndParticleForSurface(), SV_GetBounceFraction(), and SV_GetFootstepSound().
|
static |
Definition at line 532 of file scripts.cpp.
References Com_GetAircraftIdNum(), and CRAFT_UFO.
Referenced by Com_ParseValue(), and Com_SetValue().
short Com_GetUfoIdsNum | ( | void | ) |
Definition at line 574 of file scripts.cpp.
References CRAFT_UFO.
Referenced by GAME_GetImportData(), and TEST_F().
Definition at line 542 of file scripts.cpp.
References Com_GetAircraftIdStr(), and CRAFT_UFO.
Referenced by Com_ValueToStr().
const ugv_t* Com_GetUGVByID | ( | const char * | ugvID | ) |
Searches an UGV definition by a given script id and returns the pointer to the global data.
[in] | ugvID | The script id of the UGV definition you are looking for |
Definition at line 3403 of file scripts.cpp.
References Com_GetUGVByIDSilent(), Com_Printf(), csi, and csi_s::numUGV.
Referenced by GAME_GetImportData(), and TEST_F().
const ugv_t* Com_GetUGVByIDSilent | ( | const char * | ugvID | ) |
Searches an UGV definition by a given script id and returns the pointer to the global data.
[in] | ugvID | The script id of the UGV definition you are looking for |
Definition at line 3384 of file scripts.cpp.
References csi, i, ugv_s::id, csi_s::numUGV, Q_streq, and csi_s::ugvs.
Referenced by Com_GetUGVByID(), GAME_AppendTeamMember(), and GAME_GetImportData().
|
static |
[in] | gender | 1 (female) or 2 (male) |
[in] | td | The team definition |
Definition at line 2340 of file scripts.cpp.
References Com_Printf(), linkedList_t::data, teamDef_s::id, teamDef_s::models, linkedList_t::next, and teamDef_s::numModels.
Referenced by Com_GetCharacterModel().
[in] | gender | 1 (female) or 2 (male) |
[in] | td | The team definition to get the name from |
Definition at line 2305 of file scripts.cpp.
References Com_DPrintf(), linkedList_t::data, DEBUG_ENGINE, teamDef_s::id, name, NAME_NUM_TYPES, teamDef_s::names, linkedList_t::next, teamDef_s::numNames, and Sys_Error().
Referenced by Com_GetCharacterValues().
Parses "actors" definition from team_* ufo script files.
Definition at line 2550 of file scripts.cpp.
References Com_EParse(), Com_Error(), Com_FindNameType(), Com_Parse(), Com_ParseList(), Com_Printf(), linkedList_t::data, ERR_DROP, teamDef_s::id, LIST_Add(), LIST_Count(), LIST_Delete(), Mem_StrDup, teamDef_s::models, linkedList_t::next, teamDef_s::numModels, and teamDef_s::model_t::path.
Referenced by Com_ParseTeam().
|
static |
Parses "name" definition from team_* ufo script files.
Definition at line 2474 of file scripts.cpp.
References csi_s::actorNames, Com_EParse(), Com_Error(), Com_FindNameType(), Com_Parse(), Com_ParseList(), Com_Printf(), csi, ERR_DROP, i, teamNames_s::id, LIST_Add(), LIST_AddString(), LIST_Delete(), LIST_Foreach, NAME_FEMALE, NAME_FEMALE_LAST, NAME_LAST, NAME_MALE, NAME_MALE_LAST, NAME_NEUTRAL, NAME_NUM_TYPES, teamNames_s::names, linkedList_t::next, teamNames_s::numNames, OBJZERO, Q_streq, Q_strncpyz(), and Sys_Error().
Referenced by Com_ParseScripts().
Parses "actorsounds" definition from team_* ufo script files.
Definition at line 2614 of file scripts.cpp.
References Com_EParse(), Com_Parse(), Com_Printf(), i, LIST_AddString(), NAME_LAST, NAME_NUM_TYPES, teamDef_s::numSounds, Q_streq, SND_DEATH, SND_HURT, and teamDef_s::sounds.
Referenced by Com_ParseTeam().
|
static |
Parse the aircraft names from the scripts.
Definition at line 592 of file scripts.cpp.
References AIRCRAFT_NONE, Com_EParse(), Com_GetAircraftIdNum(), Com_Parse(), Com_Printf(), CRAFT_DROP, CRAFT_INTER, CRAFT_MAX, CRAFT_UFO, DROPSHIP_MAX, i, INTERCEPTOR_MAX, Mem_StrDup, Q_streq, UFO_MAX, and va().
Referenced by Com_ParseScripts().
|
static |
Parses the armour definitions or the team resistance values from script files. The protection and rating values.
Definition at line 1769 of file scripts.cpp.
References Com_EParse(), Com_Parse(), Com_Printf(), csi, csi_s::dts, i, damageType_s::id, csi_s::numDTs, Q_streq, damageType_s::showInMenu, and Sys_Error().
Referenced by Com_ParseItem(), and Com_ParseTeam().
bool Com_ParseBlock | ( | const char * | name, |
const char ** | text, | ||
void * | base, | ||
const value_t * | values, | ||
memPool_t * | mempool | ||
) |
Definition at line 1415 of file scripts.cpp.
References Com_EParse(), Com_Parse(), Com_ParseBlockToken(), and Com_Printf().
Referenced by CL_ParseActorSkin(), Com_ParseInventory(), Com_ParseTerrain(), Com_ParseUGVs(), GAME_GetImportData(), GAME_ParseModes(), and TUT_ParseTutorials().
bool Com_ParseBlockToken | ( | const char * | name, |
const char ** | text, | ||
void * | base, | ||
const value_t * | values, | ||
memPool_t * | mempool, | ||
const char * | token | ||
) |
Definition at line 1333 of file scripts.cpp.
References Com_EParse(), Com_EParseValue(), Com_ParseList(), Com_Printf(), Com_UnParseLastToken(), Mem_PoolStrDupTo, value_s::ofs, Q_streq, value_s::size, value_s::string, value_s::type, v, V_HUNK_STRING, V_LIST, and V_TRANSLATION_STRING.
Referenced by Com_ParseBlock(), Com_ParseBodyPart(), Com_ParseEquipment(), Com_ParseFire(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseItem(), Com_ParseItemEffect(), Com_ParseMapDefinition(), Com_ParseTeam(), and GAME_GetImportData().
Definition at line 2955 of file scripts.cpp.
References BodyData::addBodyPart(), BODYPART_MAXTYPE, Com_EParse(), Com_EParseValue(), Com_Error(), Com_Parse(), Com_ParseBlockToken(), Com_ParseList(), Com_Printf(), linkedList_t::data, ERR_DROP, i, BodyPartData::id, BodyData::id(), LIST_Count(), LIST_Delete(), MODIFIER_MAX, linkedList_t::next, BodyData::numBodyParts(), OBJZERO, BodyPartData::penalties, Q_streq, Q_strncpyz(), and V_INT.
Referenced by Com_ParseBodyTemplate().
|
static |
Definition at line 3021 of file scripts.cpp.
References csi_s::bodyTemplates, Com_EParse(), Com_Parse(), Com_ParseBodyPart(), Com_Printf(), csi, LIST_Add(), LIST_Foreach, BodyData::numBodyParts(), Q_streq, and BodyData::setId().
Referenced by Com_ParseScripts().
bool Com_ParseBoolean | ( | const char * | token | ) |
Parses a boolean from a string.
token | The token to convert into a boolean |
false
if the string could not get parsed Definition at line 1000 of file scripts.cpp.
References Com_ParseValue(), RESULT_ERROR, and V_BOOL.
Referenced by GAME_GetImportData(), and HUD_RemainingTUs_f().
|
static |
Parses character templates from scripts.
Definition at line 2887 of file scripts.cpp.
References csi_s::chrTemplates, Com_EParse(), Com_EParseValue(), Com_Parse(), Com_Printf(), csi, i, chrTemplate_s::id, MAX_CHARACTER_TEMPLATES, csi_s::numChrTemplates, OBJZERO, Q_streq, Q_strncpyz(), chrTemplate_s::rate, SKILL_NUM_TYPES, chrTemplate_s::skills, Sys_Error(), and V_INT2.
Referenced by Com_ParseScripts().
|
static |
Definition at line 3216 of file scripts.cpp.
References Com_EParse(), Com_Parse(), Com_Printf(), csi, csi_s::damBlast, csi_s::damFire, csi_s::damIncendiary, csi_s::damLaser, csi_s::damNormal, csi_s::damParticle, csi_s::damPlasma, csi_s::damShock, csi_s::damSmoke, csi_s::damStunElectro, csi_s::damStunGas, csi_s::dts, i, damageType_s::id, MAX_DAMAGETYPES, csi_s::numDTs, Q_streq, Q_strncpyz(), damageType_s::showInMenu, and Sys_Error().
Referenced by Com_ParseScripts().
|
static |
Definition at line 2202 of file scripts.cpp.
References Com_DropShipShortNameToID(), Com_EParse(), Com_Error(), com_genericPool, Com_Parse(), Com_ParseBlockToken(), Com_ParseList(), Com_Printf(), csi, linkedList_t::data, csi_s::eds, ERR_DROP, i, objDef_s::id, equipDef_s::id, objDef_s::idx, INVSH_GetItemByID(), LIST_Count(), LIST_Delete(), MAX_EQUIPDEFS, equipDef_s::name, linkedList_t::next, equipDef_s::numAircraft, csi_s::numEDs, equipDef_s::numItems, OBJZERO, Q_streq, Q_strncpyz(), Sys_Error(), and type.
Referenced by Com_ParseScripts().
|
static |
Parses the firemode.
[in] | name | Already parsed name of the weapon, used for error messages |
[in,out] | text | The string which is to be parsed |
[in,out] | fd | The fire definition to fill |
Definition at line 1690 of file scripts.cpp.
References ABILITY_NUM_TYPES, Com_EParse(), com_genericPool, Com_Parse(), Com_ParseBlockToken(), Com_ParseFireEffect(), Com_Printf(), fireDef_s::delayBetweenShots, fireDef_s::fireAttenuation, fireDef_s::impactAttenuation, fireDef_s::name, Q_streq, fireDef_s::range, fireDef_s::shots, SKILL_NUM_TYPES, SOUND_ATTN_MAX, SOUND_ATTN_NONE, fireDef_s::splrad, UNIT_SIZE, and fireDef_s::weaponSkill.
Referenced by Com_ParseFireDefinition().
Definition at line 1828 of file scripts.cpp.
References Com_EParse(), Com_Parse(), Com_ParseFire(), Com_Printf(), objDef_s::fd, fireDef_s::fdIdx, fireDef_s::fireAttenuation, fireDef_s::impactAttenuation, LIST_Add(), MAX_FIREDEFS_PER_WEAPON, MAX_WEAPONS_PER_OBJDEF, Mem_StrDup, objDef_s::numFiredefs, objDef_s::numWeapons, parseItemWeapon_t::numWeapons, parseItemWeapon_t::od, Q_streq, SOUND_ATTN_NORM, Sys_Error(), parseItemWeapon_t::token, and fireDef_s::weapFdsIdx.
Referenced by Com_ParseItem().
Parses the effect that is bound to a fire definitions.
[in,out] | fd | The fire definition to add the effect to |
[in] | name | Already parsed name of the weapon, used for error messages |
[in,out] | text | The string which is to be parsed |
Definition at line 1642 of file scripts.cpp.
References fireDef_s::activeEffect, Com_ParseItemEffect(), Com_Printf(), fireDef_s::deactiveEffect, EFFECT_ACTIVE, EFFECT_INACTIVE, EFFECT_MAX, EFFECT_OVERDOSE, EFFECT_STRENGTHEN, Mem_AllocType, Mem_Free, and fireDef_s::overdoseEffect.
Referenced by Com_ParseFire().
|
static |
Definition at line 3141 of file scripts.cpp.
References Com_EParse(), Com_Parse(), Com_ParseBlockToken(), Com_Printf(), Com_SkipBlock(), csi, gametype_s::cvars, csi_s::gts, i, gametype_s::id, MAX_CVARLISTINGAMETYPE, MAX_GAMETYPES, MAX_VAR, cvarlist_s::name, gametype_s::num_cvars, csi_s::numGTs, OBJZERO, Q_streq, Q_strncpyz(), Sys_Error(), and cvarlist_s::value.
Referenced by Com_ParseScripts().
|
static |
Definition at line 2040 of file scripts.cpp.
References Com_DPrintf(), Com_EParse(), com_genericPool, Com_Parse(), Com_ParseBlockToken(), Com_Printf(), csi, DEBUG_SHARED, implantDef_s::id, implantDef_s::idx, csi_s::implants, INVSH_GetItemByID(), INVSH_GetItemByIDSilent(), implantDef_s::item, MAX_IMPLANTS, Mem_StrDup, csi_s::numImplants, OBJZERO, Q_streq, Q_strnull(), and Sys_Error().
Referenced by Com_ParseScripts().
|
static |
Definition at line 2129 of file scripts.cpp.
References CID_ARMOUR, CID_BACKPACK, CID_BELT, CID_EQUIP, CID_FLOOR, CID_HEADGEAR, CID_HOLSTER, CID_IMPLANT, CID_LEFT, CID_RIGHT, Com_ParseBlock(), Com_Printf(), csi, csi_s::ids, invDef_s::name, csi_s::numIDs, OBJZERO, Q_streq, Q_strncpyz(), and Sys_Error().
Referenced by Com_ParseScripts().
|
static |
Parses weapon, equipment, craft items and armour.
Definition at line 1910 of file scripts.cpp.
References objDef_s::ammo, objDef_s::armourPath, Com_DPrintf(), Com_EParse(), com_genericPool, Com_Parse(), Com_ParseArmourOrResistance(), Com_ParseBlockToken(), Com_ParseFireDefinition(), Com_ParseObjDefEffect(), Com_Printf(), objDef_s::craftitem, csi, DEBUG_SHARED, objDef_s::deplete, i, objDef_s::id, objDef_s::idx, objDef_s::image, objDef_s::implant, INVSH_GetItemByIDSilent(), objDef_s::isAmmo(), objDef_s::isArmour(), objDef_s::isVirtual, LIST_Add(), MAX_ACITEMS, MAX_OBJDEFS, MAX_WEAPONS_PER_OBJDEF, Mem_StrDup, objDef_s::model, objDef_s::name, csi_s::numODs, objDef_s::numWeapons, parseItemWeapon_t::numWeapons, OBJZERO, parseItemWeapon_t::od, csi_s::ods, objDef_s::oneshot, objDef_s::price, objDef_s::productionCost, objDef_s::protection, Q_streq, Q_strnull(), objDef_s::ratings, objDef_s::reloadAttenuation, objDef_s::reloadSound, objDef_s::shape, SHAPE_SMALL_MAX_HEIGHT, SHAPE_SMALL_MAX_WIDTH, SOUND_ATTN_IDLE, SOUND_ATTN_MAX, SOUND_ATTN_NONE, objDef_s::sx, objDef_s::sy, Sys_Error(), objDef_s::thrown, parseItemWeapon_t::token, craftitem_s::type, objDef_s::type, and objDef_s::weapon.
Referenced by Com_ParseScripts().
|
static |
Parses the item effect.
[in,out] | e | The item effect that is filled in here. |
[in] | name | Already parsed name of the weapon, used for error messages |
[in,out] | text | The string which is to be parsed |
Definition at line 1585 of file scripts.cpp.
References com_genericPool, Com_Parse(), Com_ParseBlockToken(), Com_Printf(), Com_SkipBlock(), EFFECT_ACTIVE, EFFECT_INACTIVE, EFFECT_MAX, EFFECT_OVERDOSE, EFFECT_STRENGTHEN, and Q_streq.
Referenced by Com_ParseFireEffect(), and Com_ParseObjDefEffect().
bool Com_ParseList | ( | const char ** | text, |
linkedList_t ** | list | ||
) |
Parse tokens between '(' and ')' and return them into a linked list. It the list is not well formed, the returned list is null.
[in] | text | Pointer to a token stream |
[out] | list | list to return |
Definition at line 1385 of file scripts.cpp.
References Com_GetToken(), Com_NextToken(), Com_Printf(), LIST_AddString(), LIST_Delete(), TT_BEGIN_LIST, TT_CONTENT, TT_END_LIST, and TT_EOF.
Referenced by CL_ParseLanguages(), CL_ParseSequence(), Com_ParseActorModels(), Com_ParseActorNames(), Com_ParseBlockToken(), Com_ParseBodyPart(), Com_ParseEquipment(), Com_ParseMapDefinition(), Com_ParseTeam(), GAME_GetImportData(), M_ParseMusic(), and TEST_F().
|
static |
Definition at line 3495 of file scripts.cpp.
References mapDef_s::campaign, Com_DPrintf(), Com_EParse(), com_genericPool, Com_GetMapDefByIDX(), Com_Parse(), Com_ParseBlockToken(), Com_ParseList(), Com_Printf(), csi, DEBUG_SHARED, mapDef_s::description, hwclass, mapDef_s::hwclass, mapDef_s::id, cvar_s::integer, lengthof, mapDef_s::mapTheme, mapDef_s::maxAliens, csi_s::mds, Mem_PoolStrDup, mapDef_s::multiplayer, csi_s::numMDs, OBJZERO, mapDef_s::params, Q_streq, mapDef_s::singleplayer, and Sys_Error().
Referenced by Com_ParseScripts().
Definition at line 1889 of file scripts.cpp.
References Com_ParseItemEffect(), Com_Printf(), EFFECT_STRENGTHEN, Mem_AllocType, Mem_Free, and objDef_s::strengthenEffect.
Referenced by Com_ParseItem().
void Com_ParseScripts | ( | bool | onlyServer | ) |
Definition at line 3641 of file scripts.cpp.
References CL_ParseClientData(), Com_AddObjectLinks(), Com_ParseActorNames(), Com_ParseAircraftNames(), Com_ParseBodyTemplate(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseInventory(), Com_ParseItem(), Com_ParseMapDefinition(), Com_ParseTeam(), Com_ParseTerrain(), Com_ParseTerrainDefinition(), Com_ParseUGVs(), Com_ParseVersion(), Com_Printf(), csi, csi_s::damBlast, csi_s::damFire, csi_s::damIncendiary, csi_s::damLaser, csi_s::damNormal, csi_s::damParticle, csi_s::damPlasma, csi_s::damShock, csi_s::damSmoke, csi_s::damStunElectro, csi_s::damStunGas, FS_BuildFileList(), FS_NextScriptHeader(), INVSH_InitCSI(), name, NONE, csi_s::numDTs, csi_s::numEDs, csi_s::numIDs, csi_s::numODs, csi_s::numTeamDefs, OBJZERO, Q_streq, Sys_Error(), type, and versionParsed.
Referenced by Qcommon_Init(), CharacterTest::SetUpTestCase(), ParticleTest::SetUpTestCase(), ScriptTest::SetUpTestCase(), RoutingTest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), FootStepTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), WebApiTest::SetUpTestCase(), MapDefTest::SetUpTestCase(), GameTest::SetUpTestCase(), RandomMapAssemblyTest::SetUpTestCase(), InventoryTest::SetUpTestCase(), and CampaignTest::SetUpTestCase().
|
static |
Definition at line 2709 of file scripts.cpp.
References teamDef_s::armour, teamDef_s::bodyTemplate, teamDef_s::characterTemplates, Com_DPrintf(), Com_EParse(), Com_Error(), Com_GetBodyTemplateByID(), Com_GetCharacterTemplateByID(), Com_GetNameListByID(), Com_Parse(), Com_ParseActorModels(), Com_ParseActorSounds(), Com_ParseArmourOrResistance(), Com_ParseBlockToken(), Com_ParseList(), Com_Printf(), Com_SkipBlock(), csi, teamDef_s::deathTextureName, DEBUG_CLIENT, ERR_DROP, i, chrTemplate_s::id, teamDef_s::id, teamDef_s::idx, INVSH_GetItemByID(), LIST_Delete(), MAX_DEATH, MAX_TEAMDEFS, teamNames_s::names, teamDef_s::names, linkedList_t::next, teamNames_s::numNames, teamDef_s::numNames, csi_s::numTeamDefs, teamDef_s::numTemplates, OBJZERO, teamDef_s::onlyWeapon, Q_streq, Q_strncpyz(), teamDef_s::resistance, Sys_Error(), csi_s::teamDef, va(), and teamDef_s::weapons.
Referenced by Com_ParseScripts().
|
static |
Parses "terrain" definition from script files.
Definition at line 3106 of file scripts.cpp.
References terrainType_s::bounceFraction, com_genericPool, Com_GetTerrainType(), Com_HashKey(), Com_ParseBlock(), Com_Printf(), terrainType_s::footstepVolume, hash, terrainType_s::hash_next, Mem_Free, Mem_PoolAllocType, Mem_PoolStrDup, SND_VOLUME_FOOTSTEPS, TERRAIN_HASH_SIZE, and terrainType_s::texture.
Referenced by Com_ParseScripts().
|
static |
Definition at line 3557 of file scripts.cpp.
References TerrainDefs::add(), KeyValuePair::asFloat(), KeyValuePair::asInt(), Com_EParse(), Com_Parse(), Com_Printf(), csi, KeyValuePair::isKey(), key, MAX_VAR, Q_strncpyz(), TerrainDef::rainChance, TerrainDef::rgbBlue, TerrainDef::rgbGreen, TerrainDef::rgbRed, TerrainDef::snowChance, TerrainDef::survivalChance, csi_s::terrainDefs, and TerrainDef::terrainName.
Referenced by Com_ParseScripts().
|
static |
Parse 2x2 units (e.g. UGVs)
Definition at line 2859 of file scripts.cpp.
References com_genericPool, Com_ParseBlock(), Com_Printf(), csi, i, ugv_s::id, ugv_s::idx, MAX_UGV, Mem_PoolStrDup, csi_s::numUGV, OBJZERO, Q_streq, and csi_s::ugvs.
Referenced by Com_ParseScripts().
resultStatus_t Com_ParseValue | ( | void * | base, |
const char * | token, | ||
valueTypes_t | type, | ||
int | ofs, | ||
size_t | size, | ||
size_t * | writtenBytes | ||
) |
Parse a value from a string.
[in] | base | The start pointer to a given data type (typedef, struct) where the parsed data is stored |
[in] | token | The data which should be parsed |
[in] | type | The data type that should be parsed |
[in] | ofs | The offset for the value |
[in] | size | The expected size of the data type. If 0, no checks are done |
[out] | writtenBytes |
Definition at line 659 of file scripts.cpp.
References AIRCRAFT_NONE, ALIGN_LAST, BLEND_LAST, Com_AlignPtr(), Com_GetConstInt(), Com_GetCrashedUfoIdNum(), Com_GetHumanCraftIdNum(), Com_GetUfoIdNum(), Com_Printf(), csi, DAYS_PER_YEAR, csi_s::dts, f, FADE_LAST, damageType_s::id, int(), MAX_VAR, csi_s::numDTs, Q_streq, Q_strncpyz(), RESULT_ERROR, RESULT_OK, RESULT_WARNING, SECONDS_PER_HOUR, SHAPE_BIG_MAX_HEIGHT, SHAPE_BIG_MAX_WIDTH, SHAPE_SMALL_MAX_HEIGHT, SHAPE_SMALL_MAX_WIDTH, STYLE_LAST, Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, type, UFO_NONE, UFO_SIZE_T, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DAMAGE, V_DATE, V_FADE, V_FLOAT, V_HUNK_STRING, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_RELABS, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_TRANSLATION_STRING, V_UFO, V_UFOCRASHED, and V_VECTOR.
Referenced by Com_DropShipShortNameToID(), Com_EParseValue(), Com_ParseBoolean(), Com_UFOShortNameToID(), TEST_F(), UI_MaterialEditorChangeValue_f(), UI_NodeSetProperty(), UI_ParseProperty(), and UI_PushDropDownWindow_f().
|
static |
Definition at line 294 of file scripts.cpp.
References Q_streq, Sys_Error(), UFO_VERSION, and versionParsed.
Referenced by Com_ParseScripts().
Register mappings between script strings and enum values for values of the type V_INT
.
name | The name of the script entry to map to an integer. This can also include a namespace prefix for the case we want to map back an integer to a string from a specific namespace. In case this string is equipped with a namespace, the string is in the form "namespace::variable" |
value | The value to map the given name to |
Definition at line 198 of file scripts.cpp.
References com_aliasSysPool, Com_ConstIntGetVariable(), com_constNameInt, Com_HashKey(), Com_Printf(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_s::fullname, hash, com_constNameInt_s::hash_next, Mem_PoolAllocType, Mem_StrDup, com_constNameInt_s::name, com_constNameInt_s::next, Q_streq, Q_strncpyz(), and com_constNameInt_s::value.
Referenced by Com_RegisterConstList(), GAME_GetImportData(), SV_InitGameProgs(), TEST_F(), UI_RegisterAbstractNode(), UI_RegisterBaseInventoryNode(), UI_RegisterPanelNode(), UI_RegisterSpinnerNode(), and UI_RegisterTextNode().
void Com_RegisterConstList | ( | const constListEntry_t | constList[] | ) |
Registers a list of string aliases.
[in] | constList | Array of string => int mappings. Must be terminated with a nullptr string ({nullptr, -1}) line |
Definition at line 253 of file scripts.cpp.
References Com_RegisterConstInt(), i, name, constListEntry_s::name, and com_constNameInt_s::value.
Referenced by GAME_GetImportData(), GAME_LoadCharacter(), GAME_SaveCharacter(), and TEST_F().
int Com_SetValue | ( | void * | base, |
const void * | set, | ||
valueTypes_t | type, | ||
int | ofs, | ||
size_t | size | ||
) |
[in] | base | The start pointer to a given data type (typedef, struct) |
[in] | set | The data which should be parsed |
[in] | type | The data type that should be parsed |
[in] | ofs | The offset for the value |
[in] | size | The expected size of the data type. If 0, no checks are done |
Definition at line 1023 of file scripts.cpp.
References AIRCRAFT_NONE, Com_AlignPtr(), Com_GetCrashedUfoIdNum(), Com_GetHumanCraftIdNum(), Com_GetUfoIdNum(), Com_Printf(), int(), len, MAX_VAR, Q_streq, Q_strncpyz(), SHAPE_BIG_MAX_HEIGHT, SHAPE_SMALL_MAX_HEIGHT, Sys_Backtrace(), Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, UFO_NONE, UFO_SIZE_T, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DAMAGE, V_DATE, V_FADE, V_FLOAT, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_UFO, V_UFOCRASHED, and V_VECTOR.
Referenced by CL_ParticleFunction(), and UI_NodeSetPropertyFromRAW().
Definition at line 3754 of file scripts.cpp.
References OBJZERO, and versionParsed.
Referenced by Qcommon_Shutdown(), and TEST_Shutdown().
const char* Com_UFOCrashedTypeToShortName | ( | ufoType_t | type | ) |
Translate UFO type to short name when UFO is crashed.
Definition at line 3373 of file scripts.cpp.
References Com_ValueToStr(), and V_UFOCRASHED.
Referenced by GAME_GetImportData().
ufoType_t Com_UFOShortNameToID | ( | const char * | token | ) |
Translate short name to UFO type.
Definition at line 3351 of file scripts.cpp.
References Com_ParseValue(), and V_UFO.
Referenced by GAME_GetImportData().
const char* Com_UFOTypeToShortName | ( | ufoType_t | type | ) |
Translate UFO type to short name.
Definition at line 3364 of file scripts.cpp.
References Com_ValueToStr(), and V_UFO.
Referenced by GAME_GetImportData().
bool Com_UnregisterConstList | ( | const constListEntry_t | constList[] | ) |
Unregisters a list of string aliases.
[in] | constList | Array of string => int mappings. Must be terminated with a nullptr string ({nullptr, -1}) line |
Definition at line 237 of file scripts.cpp.
References Com_UnregisterConstVariable(), i, name, and constListEntry_s::name.
Referenced by GAME_GetImportData(), GAME_LoadCharacter(), GAME_SaveCharacter(), and TEST_F().
bool Com_UnregisterConstVariable | ( | const char * | name | ) |
Removes a registered constant from the script mapping hash table.
name | The name of the script entry to remove out of the const int hash. In case this string is equipped with a namespace, the string is in the form "namespace::variable". If you try to unregister a variable that was registered with a namespace, this namespace must be included in the given name, too. |
Definition at line 147 of file scripts.cpp.
References Com_ConstIntGetVariable(), com_constNameInt, Com_HashKey(), CONSTNAMEINT_HASH_SIZE, com_constNameInt_s::fullname, hash, com_constNameInt_s::hash_next, Mem_Free, com_constNameInt_s::next, and Q_streq.
Referenced by Com_UnregisterConstList(), GAME_GetImportData(), SV_InitGameProgs(), and TEST_F().
const char* Com_ValueToStr | ( | const void * | base, |
const valueTypes_t | type, | ||
const int | ofs | ||
) |
[in] | base | The start pointer to a given data type (typedef, struct) |
[in] | type | The data type that should be parsed |
[in] | ofs | The offset for the value |
Definition at line 1189 of file scripts.cpp.
References ALIGN_LAST, BLEND_LAST, Com_AlignPtr(), Com_GetCrashedUfoIdStr(), Com_GetHumanCraftIdStr(), Com_GetUfoIdStr(), Com_Printf(), Com_sprintf(), csi, DAYS_PER_YEAR, csi_s::dts, FADE_LAST, MAX_DAMAGETYPES, MAX_VAR, Q_strncpyz(), STYLE_LAST, Sys_Backtrace(), Sys_Error(), TEAM_ALIEN, TEAM_CIVILIAN, TEAM_PHALANX, UFO_SIZE_T, V_AIRCRAFTTYPE, V_ALIGN, V_BLEND, V_BOOL, V_CHAR, V_COLOR, V_DAMAGE, V_DATE, V_FADE, V_FLOAT, V_HUNK_STRING, V_INT, V_INT2, V_LONGSTRING, V_NULL, V_POS, V_RELABS, V_SHAPE_BIG, V_SHAPE_SMALL, V_STRING, V_STYLE, V_TEAM, V_TRANSLATION_STRING, V_UFO, V_UFOCRASHED, and V_VECTOR.
Referenced by Com_DropShipTypeToShortName(), Com_UFOCrashedTypeToShortName(), Com_UFOTypeToShortName(), GAME_GetImportData(), and UI_GetStringFromNodeProperty().
const char* const air_slot_type_strings[] = AIR_SLOT_TYPE_STRINGS |
List of valid strings for slot types.
Definition at line 1813 of file scripts.cpp.
|
static |
Definition at line 480 of file scripts.cpp.
|
static |
Definition at line 475 of file scripts.cpp.
const char* const align_names[] |
Definition at line 341 of file scripts.cpp.
const char* const blend_names[] |
Definition at line 346 of file scripts.cpp.
|
static |
Definition at line 2942 of file scripts.cpp.
|
static |
Linked list of all the registeres mappings.
Definition at line 48 of file scripts.cpp.
Referenced by Com_GetConstVariable(), Com_RegisterConstInt(), and Com_UnregisterConstVariable().
|
static |
Hash of all the registeres mappings.
Definition at line 50 of file scripts.cpp.
|
static |
Definition at line 458 of file scripts.cpp.
|
static |
Definition at line 473 of file scripts.cpp.
|
static |
Definition at line 1527 of file scripts.cpp.
|
static |
Valid equipment definition values from script files.
Definition at line 2194 of file scripts.cpp.
const char* const fade_names[] |
Definition at line 356 of file scripts.cpp.
|
static |
Definition at line 1543 of file scripts.cpp.
|
static |
possible gametype values for the gameserver (ufo-scriptfiles)
Definition at line 3136 of file scripts.cpp.
|
static |
Definition at line 2104 of file scripts.cpp.
|
static |
Definition at line 2033 of file scripts.cpp.
|
static |
Definition at line 474 of file scripts.cpp.
|
static |
valid mapdef descriptors
Definition at line 3464 of file scripts.cpp.
const char* const name_strings[NAME_NUM_TYPES] |
Definition at line 2184 of file scripts.cpp.
Referenced by Com_FindNameType().
|
static |
Definition at line 1470 of file scripts.cpp.
|
static |
Definition at line 425 of file scripts.cpp.
Referenced by Com_GetLastParseError().
|
static |
Temporary list of weapon ids as parsed from the ufo file "weapon_mod \<id\>" in Com_ParseItem and used in Com_AddObjectLinks.
Definition at line 1820 of file scripts.cpp.
|
static |
Definition at line 2951 of file scripts.cpp.
|
static |
Definition at line 1447 of file scripts.cpp.
const char* const style_names[] |
Definition at line 351 of file scripts.cpp.
|
static |
possible teamdesc values (ufo-scriptfiles)
Definition at line 2694 of file scripts.cpp.
|
static |
Definition at line 3073 of file scripts.cpp.
|
static |
Definition at line 3075 of file scripts.cpp.
|
static |
Ufoai uses two types of ids for aircraft: the string is used for references in the scripts, the numeric/enum type in the code. This tables and the following functions convert these ids.
Definition at line 472 of file scripts.cpp.
|
static |
Definition at line 2845 of file scripts.cpp.
|
static |
Definition at line 292 of file scripts.cpp.
Referenced by Com_ParseScripts(), Com_ParseVersion(), and Com_Shutdown().
|
static |
natural align for each targets
Definition at line 394 of file scripts.cpp.
const char* const vt_names[] |
possible values for parsing functions
Definition at line 310 of file scripts.cpp.
Referenced by CL_ParsePtlCmds(), and CL_ParticleFunction().
|
static |
target sizes for buffer
Definition at line 362 of file scripts.cpp.