Nuclide
Software Development Kit for id Technology (BETA)
|
Universal look-up system for named animation sequences. More...
Universal look-up system for named animation sequences.
Instead of hard-coding framegroups/sequences in the code or in the decl we have access to a universal look-up system for named sequences. The system is fully extendable through external means.
Global activities can be defined within decls/typeinfo/activities.decl
which will look a lot like the following:
For example, when entities try to look up GetAct("walk")
, it will figure out if an activity with the ID of 2
exists inside for the entity. If not, it will return ACTIVITY_NOTFOUND
and the code will skip performing an action altogether.
Generally, if an activity does not exist for an entity/model, said activity never takes place. Neither visually nor functionally.
This system powers NPCs, but also weapons. So some weapon functionality is only available when certain activities exist.
The primary way of assigning activities to sequences within models is to do so when compiling it. Formats such as Half-Life MDL support activities, others do not.
There is currently no way to assign them to a model per external means.
An entityDef can override activities or define new activities for an entity on a non-model basis.
For this, you will simply define activities in your entityDef decl as you would in Defining New Activities, but instead of the value being the supposed internal act ID it will have to match the numeric value of the animation sequence in the model that is defined within the decl.
Simply put, if you want the very first animation in the model to be an idle animation, add this line to your entityDef:
Functions | |
void | Activities_Init (void) |
Initializes the sub-system for Activities. More... | |
void | Activities_Shutdown (void) |
Shuts the Activities system down. More... | |
float | Activities_GetSequenceForEntity (ncEntity targetEntity, string actNameCheck) |
Looks up the animation sequence for an entity by name of activity. More... | |
float | Activities_GetSequenceForEntityDef (ncEntity targetEntity, string actNameCheck, string subDef) |
Looks up the animation sequence by name of activity in another entityDef (or fireInfo), before looking it up in an entity. More... | |
Macros | |
#define | ACTIVITY_NOTFOUND -1 |
Activity does not exist. More... | |
float Activities_GetSequenceForEntity | ( | ncEntity | targetEntity, |
string | actNameCheck | ||
) |
Looks up the animation sequence for an entity by name of activity.
targetEntity | the entity to query. |
actNameCheck | the name of activity to look up for this entity |
ACTIVITY_NOTFOUND
when not valid. float Activities_GetSequenceForEntityDef | ( | ncEntity | targetEntity, |
string | actNameCheck, | ||
string | subDef | ||
) |
Looks up the animation sequence by name of activity in another entityDef (or fireInfo), before looking it up in an entity.
targetEntity | the entity to query. |
actNameCheck | the name of activity to look up for this entity |
subDef | the name of entityDef in which we'll look it up first |
ACTIVITY_NOTFOUND
when not valid. void Activities_Init | ( | void | ) |
Initializes the sub-system for Activities.
void Activities_Shutdown | ( | void | ) |
Shuts the Activities system down.
Every query will return ACTIVITY_NOTFOUND
.
#define ACTIVITY_NOTFOUND -1 |
Activity does not exist.