Thread: Mdll ??
View Single Post
Re: Mdll ??
Old
  (#2)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Mdll ?? - 07-07-2004

MDLL_KeyValue() calls the game DLL KeyValue() function and passes it those 2 parameters.

The game DLL KeyValue() function will extract the key and value from the pkvd argument and store the value in the key of that entity. In this case, it will store the "player_origin" value in the "origin" key of the "armoury_entity" entity.

Sometimes the keys are variables within the entity 'pev' (entvars_t) structure (like 'origin' for example) and sometimes the keys are C++ class member variables (which can't be "easily" accessed outside of the C++ source code for the MOD).

"m_bloodcolor" is a C++ member variable that can't be "easily" accessed outside the MOD source code (the engine and metamod code doesn't have direct access to this variable).

You can get around this with a dirty hack using the pvPrivateData which points to the block of memory used by this C++ class instance. You can modify this data in memory and it will effect the value of variables within that C++ class.

You can search this forum for "pvPrivateData" and it will lead you to examples of doing this.

botman
  
Reply With Quote