Talents
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.
Dependencies
Initialization
Initialize with LeGo_PermMem
flag.
Implementation
Functions
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
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
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
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
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