View Single Post
Re: The f____ shield. How to get bots to deal with it?
Old
  (#6)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: The f____ shield. How to get bots to deal with it? - 21-01-2004

Quote:
Originally Posted by Pierre-Marie Baty
why so complicated, guys ?
Code:
// is enemy looking at more than 90° aside of the bot's forward direction ?
if (fabs (WrapAngle (pEnemyEdict->v.v_angle.y - pBotEdict->v.v_angle.y)) > 90)
{
// yes, it is (meaning, bot sees the back of its enemy)
}
else
{
// no, it is not (enemy is facing the bot)
}
Why so complicated? Well, in my case I simply don't know what some of the the v.(whatever) values represent.

For the above example, what does v.v_angle.y represent?

v_angle; // Viewing angle (player only)

Is this the vector describing the direction a player is looking? That's my guess based on the comment. Is there a document somewhere describing what these values are?

I'm not completely clueless. I did take (and pass) a linear algerbra course which covered everything about vectors, but that was years ago, and I've forgotten almost all of it, fortunately I saved the book and I've dusted it off as my reference. I think I just need a few pointers to get me going in the right direction.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote