Raised This Month: $ Target: $400
 0% 

How do you get an ents key values in Fakemeta's FM_KeyValue?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 05-25-2006 , 19:35   How do you get an ents key values in Fakemeta's FM_KeyValue?
Reply With Quote #1

Can someone please explain how to use Fakemeta to get key values from the FM_KeyValue forward (without using the Engine module). I've tried to use get_kvd, which I probably used incorrectly. But I also noticed in the include it said on FM_KeyValue "-- does't work as of 0.20 RC2", though it seems to work as that part of the code gets run.

I wrote this up really quick so you can see what im asking for (not exactly what I'm doing but close enough):
Code:
new TriggerHurtHealers[200] new Total public plugin_init() {     register_plugin("Find_KVD", "0.0", "this isnt a plugin") } public plugin_precache() {     register_forward(FM_KeyValue, "check_keyvalues", 1) } public check_keyvalues(entid) {     if ( pev_valid(entid) )     {         new classname[32], key[32], value[32]         pev(entid, pev_classname, classname, 31)         // Tried these, but I don't quite understand how to use them, not sure what a kvd_handle is         //get_kvd(0, KV_ClassName, classname, 31) //can get this with pev instead         //get_kvd(0, KV_KeyName, key, 31)         //get_kvd(0, KV_Value, value, 31)         // how would you get the entity's KeyValue name and KeyValue value here using Fakemeta?         if ( equali(classname, "trigger_hurt") )             if ( equali(key, "dmg") )                 if ( floatstr(value) <= 0.0 )                     TriggerHurtHealers[Total++] = entid     } }
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
VEN
Veteran Member
Join Date: Jan 2005
Old 05-26-2006 , 10:52  
Reply With Quote #2

I tried to pass actual handle, global handle and couldn't retrieve kvdata as well. Probably a bug.
VEN is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 05-27-2006 , 05:18  
Reply With Quote #3

Can you tell me what the actual global handle is as I do not know what kvd_handle is supposed to be exactly...

Can anyone else please attempt to see if the can get it to work or use a different method with fakemeta (Rukia, Damaged Soul or Orangutanz), so that i don't feel like I'm trying to do something that can't be done...

and thanks for trying VEN, just glad to know I wasn't the only one.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
VEN
Veteran Member
Join Date: Jan 2005
Old 05-27-2006 , 13:43  
Reply With Quote #4

By the analogy to dllfunc, hook should also pass a handle in the second parameter. I tried global (0) handle and one which passed to the hook without success.
if KV_fHandled value is true that means that the game mod understood a given kvdata.
I showed thal link to faluco and he said he will see later.

EDIT: Tried pre/post hook, global/specific handle w/o success.
VEN is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 06-01-2006 , 18:16  
Reply With Quote #5

Yea I didn't realize FM_KeyValue forward was passing a second parameter, the handle (or id of the kvd, at least i think that's what it is?). Bail explained this to me and I added the second parameter into the function which cleared up everything.
I changed:
public check_keyvalues(entid)
to
public check_keyvalues(entid, kvd_id)
then got the get_kvd natives to work using kvd_id as the kvd_handle...


thx VEN... and Bailopan.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
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 16:33.


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