Raised This Month: $ Target: $400
 0% 

set_pev vs set_kvd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
VEN
Veteran Member
Join Date: Jan 2005
Old 04-18-2007 , 04:55   Re: set_pev vs set_kvd
Reply With Quote #1

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).

Last edited by VEN; 04-18-2007 at 05:06.
VEN is offline
Ryu2877
Member
Join Date: Sep 2006
Location: China
Old 04-18-2007 , 05:25   Re: set_pev vs set_kvd
Reply With Quote #2

Quote:
Originally Posted by VEN View Post
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).
receive, thanks!
Ryu2877 is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 04-18-2007 , 13:27   Re: set_pev vs set_kvd
Reply With Quote #3

So do I have this right...

I would use set_kvd to setup my entity parameters in advance and then put the whole thing in the game at once with a dispatchspawn or something?

And I would use set_pev to change an existing entity's parameters and the changes will automatically be applied to the entity on the next frame/think?
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode