.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Re: How to detect entity [properties] ?
Old
  (#11)
KickBot
Member
 
Status: Offline
Posts: 17
Join Date: Apr 2004
Default Re: How to detect entity [properties] ? - 31-05-2004

Quote:
Originally Posted by Tea
2: Even I force the dod_flag to 0 (dod_flag = 0) at the top of BotFindItem(), bot still keep say this is a ALLIES FLAG but not FREE flag. ???
You use the "=" assignment operator instead of comparison "==" in all your "dod_flag" tests in this function.
I can't help with your other questions, I have no experience with the keys system or Dod in general.
  
Reply With Quote
Re: How to detect entity [properties] ?
Old
  (#12)
Tea
Guest
 
Status:
Posts: n/a
Default Re: How to detect entity [properties] ? - 03-06-2004

OMG KickBot you got a pair of bright eyes and help me a lot ! Thank you very much

Now my final question is how can I call the Keyvalue() in the bot.cpp ? Please teach me the full command, botman could you give me the last help ? thanks.

Shrike thanks for you suggest, I have think of this way before, but I think botman way is better, since if I can get use to the keyvalue function, my bot can auto detect many other thing so I don't have to use many specific waypoint.

Last edited by Tea; 03-06-2004 at 13:53..
  
Reply With Quote
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
Re: How to detect entity [properties] ?
Old
  (#14)
Cpl. Shrike
ShrikeBot Coder/Moderator
 
Cpl. Shrike's Avatar
 
Status: Offline
Posts: 550
Join Date: Mar 2004
Location: The Netherlands
Default Re: How to detect entity [properties] ? - 03-06-2004

Quote:
Originally Posted by Tea
Shrike thanks for you suggest, I have think of this way before, but I think botman way is better, since if I can get use to the keyvalue function, my bot can auto detect many other thing so I don't have to use many specific waypoint.
I didn't mean to store it in a waypoint.
Only store the flags team owner.
  
Reply With Quote
Re: How to detect entity [properties] ?
Old
  (#15)
Tea
Guest
 
Status:
Posts: n/a
Default Re: How to detect entity [properties] ? - 03-06-2004

botman I understand how is keyvalue work but I don't know how to call it again after the bot spawned, because now it only detect one time when the bot spawn, but since the flag model in dod always change when someone captured it, so I have to call keyvalue () again before to detect the flag model each time.

Like when I want to call a XXXX(void),
I have to type XXXX();

When I want to call the ClientPrint( edict_t *pEntity, int msg_dest, const char *msg_name),
I have to type ClientPrint(pEntity, HUD_PRINTNOTIFY, "testing");

But how to call KeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd ),
I have to type KeyValue( xxxxxxxxxxxxxx ); ???

Last edited by Tea; 03-06-2004 at 19:00..
  
Reply With Quote
Re: How to detect entity [properties] ?
Old
  (#16)
Tea
Guest
 
Status:
Posts: n/a
Default Re: How to detect entity [properties] ? - 03-06-2004

Shrike I know what you mean, but if KeyValue() can do the same thing than I don't have to store the flag data everytime, since KeyValue() also can do many other thing rather than check the flag model, if I know how to use it, I can also detect a breakable wall is belong to axis or allies, a breakable tank is belong to axis or allies...etc, since those map marker did store many very useful information in the entity properties.

BTW if you know my question (how to call KeyValue() again after the bot spawned), could you help me ?
  
Reply With Quote
Re: How to detect entity [properties] ?
Old
  (#17)
Cpl. Shrike
ShrikeBot Coder/Moderator
 
Cpl. Shrike's Avatar
 
Status: Offline
Posts: 550
Join Date: Mar 2004
Location: The Netherlands
Default Re: How to detect entity [properties] ? - 03-06-2004

I didn't find a way to detect that on the dod flags.
because they are dynamical.
breakable walls and stuff are static... created at map start.
Well the flag is also created at map start but DOD sends a netmessage to client and on that the client displays the right flag model.
Well actually it the same for breakable wall but then the not_draw flag gets set.
  
Reply With Quote
Re: How to detect entity [properties] ?
Old
  (#18)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: How to detect entity [properties] ? - 04-06-2004

Quote:
Originally Posted by Tea
botman I understand how is keyvalue work but I don't know how to call it again after the bot spawned, because now it only detect one time when the bot spawn, but since the flag model in dod always change when someone captured it, so I have to call keyvalue () again before to detect the flag model each time.

Like when I want to call a XXXX(void),
I have to type XXXX();

When I want to call the ClientPrint( edict_t *pEntity, int msg_dest, const char *msg_name),
I have to type ClientPrint(pEntity, HUD_PRINTNOTIFY, "testing");

But how to call KeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd ),
I have to type KeyValue( xxxxxxxxxxxxxx ); ???
Hmm no, you did not understand how that keyvalue works.
DispatchKeyValue() is not a function you can CALL.
DispatchKeyValue() is a function you HOOK. It is part of the GameDLL interface.
Look around in the HPB_bot code and you'll see that nowhere ever does botman call DispatchKeyValue() from the bot code.
DispatchKeyValue() is just like StartFrame(). You don't CALL StartFrame(), you let the engine call it.
It's the same thing here.
The Dispatch() series of functions are called by the engine into the GameDLL code in order to setup an entity, and they are called along with a pointer to the entity they refer to.
So in order to store particular informations about these entities that you couldn't be able to get through their entvars (pEdict->v.something), you have to count how many of them there are in the game and fill an array with them. An array of structures, in each of which you can put as many information as you want. And why not the whole key/value string.
AS SOON as the engine calls DispatchKeyValue(), fill in this array with the appropriate changes.
THEN, whenever you want, make your bot code read the information it needs from the right slot in the array that holds these entitie's extra informations.

Have you ever read botman's readme.txt file that comes with his HPB template ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: How to detect entity [properties] ?
Old
  (#19)
Tea
Guest
 
Status:
Posts: n/a
Default Re: How to detect entity [properties] ? - 04-06-2004

Quote:

This method will ONLY work for things that DON'T change their value while the game is being played
Thanks PM, after I read the reply from botman again, I found out botman did answer me already.

So I think catch the net message is the only way, thanks Shrike for the suggestion.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com