Talents
Info
Dependencies:
- PermMem
Implementation:
Talents.d on GitHub
The Talents package does two things:
- save any number of values for a specific NPC (effectively AIVar array extension).
- identify NPC by unique ID.
Talents package uses one free AIVar variables, the default is AIVar with the index 89 that can be customized in Userconst.d
the AIV_TALENT
constant.
Initialization
Initialize with LeGo_PermMem
flag.
Functions
Npc_GetID
Npc_GetID
Returns unique ID specific for provided NPC.
var C_NPC slf
NPC to get ID
Return value
The function returns NPCs unique ID.
Npc_FindByID
Npc_FindByID
Finds the NPC pointer of an NPC with the given ID.
var int ID
NPC ID
Return value
The function returns NPC pointer.
TAL_CreateTalent
TAL_CreateTalent
Creates a talent into which you can later save a value for every NPC (just like AI_Var
).
The function returns value that can be later used as a talent ID.
TAL_SetValue
TAL_SetValue
Sets a new value to the specified talent.
var C_NPC npc
Set the talent value for this NPCvar int talent
Talent IDvar int value
Value to be set
TAL_GetValue
TAL_GetValue
Returns the value of a saved talent for specified NPC.
var C_NPC npc
Get the talent value from this NPCvar int talent
Talent ID