View Single Post
Re: How to detect entity [properties] ?
Old
  (#13)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: How to detect entity [properties] ? - 03-06-2004

"Now my final question is how can I call the Keyvalue() in the bot.cpp ?"

DispatchKeyValue() is used by the engine to tell the MOD DLL code what a value for a key is for an entity.

The engine creates the entity, then calls DispatchKeyValue() for each key in the entity that the level designer has specified (see the Worldcraft/Hammer .fgd file for details on which key/value pairs exist for each entity in the MOD). If there are 5 keys in the entity, DispatchKeyValue() will be called 5 times with the same edict_t pointer value (pointing to the same entity).

You can intercept these calls to DispatchKeyValue() to observe what values are being assigned to an entity when it spawns.

Go back and look at the code I posted for the "info_tfdetect" entity for TFC. That shows how you intercept the key/value data.

I can't explain it any more than this. The HPB bot code shows how it's done. You might want to set breakpoints in the DispatchKeyValue() function in the HPB bot and trace through that code to see what the engine is passing to the MOD code.

botman
  
Reply With Quote