View Single Post
Re: POD-bot back into shape.
Old
  (#29)
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: POD-bot back into shape. - 24-02-2004

Quote:
Originally Posted by stefanhendriks
! Finally some good news pmb Hehe. Well i am glad to hear this.

I was hoping you could shed a light on 'multiple bots working together on metamod'. I know it has something to do with the indexes not being updated properly or something. But i have not taken a look into this properly yet.

I think something like a bool bIsOtherBot is needed, so when a fakeclient is found, but is not created using botCreate it is automaticly an 'otherbot'. Therefor it should not 'think'. But as i said i don't know the exact problems so i cannot say what a fix can be
Actually the solution is simple: put the FL_FAKECLIENT flag (as Turtle Rocker says), but NEVER rely on him to tell if an edict is one of your bots or not.

I.e, never do
Code:
if (pEdict->v.flags & FL_FAKECLIENT)
// this beast is a bot
but do (a la botman)
Code:
int bot_index = UTIL_GetBotIndex (pEdict);
if ((bot_index != -1) && bots[bot_index].is_used)
// this beast is one of MY bots
Note that you can simplify all this by always filling the bots array according to their entity index (which range from 1 to 33). That is, instead of "finding a free slot in the bot's array" to stuff this bot in it during BotCreate(), ask for the entity index once the player() function has been called, and it will give you directly the right slot index in the bots array in which to put your bot. You can then get rid of UTIL_GetBotIndex() and the likes, and replace them all with ENTINDEX (pEdict) - 1.

I have RACC and POD-bot running at the same time, so I don't think the problem is in the POD-bot code. See where I'm looking at ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 24-02-2004 at 00:36..