set_kvd is mainly used to
store values of KeyValueData (KVD) structure members.
In general to the first parameter should be passed global handle (0).
There are four KVD members:
- ClassName - used to store entity classname (type: string)
- KeyName - used to store name of key (type: string)
- Value - used to store value of key (type: string)
- fHandled - [see below] (type: integer)
Once KVD member values is stored they needs to be "fired" to the game dll with KeyValue (DLLFunc_KeyValue).
Right after firing it's possible to check whether given KVD was understood by game dll by checking fHandled value.
KVD is applied to entity on its Spawn so KVD should be fired only for entities that isn't spawned yet (DLLFunc_Spawn).
fm_set_kvd() is a function from
Fakemeta Utilities that can be used to fire KVD easily.
set_pev is used to
change values of several entity variables (entvars_t structure members).