Hi again, Sebastian et al'

My apologies, this function was mistyped. It should be a float function, not a void. So it should read like:

float DirectionCheck(local entity Subject)
{

// the entity Subject is the one who will be checked in this function
// even though it looks like we're checking TempSelf

// the entity TempSelf is a place holder for the self entity which needs to be switched // as the infront function only works on self, and we need to use it for an entity other than self
// or the Subject entity, in this case...

local entity TempSelf;

TempSelf = self;

self = Subject;

// There is the switch and here is the test

// this tests to see if the entity TempSelf is in front of the Subject entity, which we've temporarily called self, for this function
// then we'll restore self to its original value and return the result

// if true, the entity being tested is faced away from the player
// if false, that entity is facing the player

if(!infront(TempSelf))
{
self = TempSelf;
return true;
}
else
{
self = TempSelf;
return false;
}

}



Please let me know how this works for you if you would. Thanks so much, and again, sorry for the inconvenience...

Smiles,

Cara

At 07:42 PM 8/4/2006 -0700, you wrote:
                  Hi Sebastian et al'

Here is a new function I've written for telling the direction of entities. <smile> I sure wish I knew about the infront function when I wrote my original code as it would have saved me hours and hours and hours of aggravation and tedium! lol!
  But anyway, here it is, and let me know how it works.

You simply call this function with the entity whose direction you want to check, as the argument, and it will return either a true or false result. true means that the entity in question is facing away from you, or in other words, that you're behind them and they cannot see you, and false means that they are facing you and you can be seen by them...

  Here's the function...

void DirectionCheck(local entity Subject)
{

// the entity Subject is the one who will be checked in this function
// even though it looks like we're checking TempSelf

// the entity TempSelf is a place holder for the self entity which needs to be switched // as the infront function only works on self, and we need to use it for an entity other than self
// or the Subject entity, in this case...

local entity TempSelf;

TempSelf = self;

self = Subject;

// There is the switch and here is the test

// this tests to see if the entity TempSelf is in front of the Subject entity, which we've temporarily called self, for this function
// then we'll restore self to its original value and return the result

// if true, the entity being tested is faced away from the player
// if false, that entity is facing the player

if(!infront(TempSelf))
{
self = TempSelf;
return true;
}
else
{
self = TempSelf;
return false;
}

}

Let me know how this works for you , and I'll also be sending along the code for the enhanced ESR as well as going over your earlier code in a little while this evening so will write ya back! <smile>
  Best of luck and can't wait to see your mods!...

  Have a nice evening and a lovely weekend!...

Smiles,

Cara

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.10.5/407 - Release Date: 8/3/2006


_______________________________________________
AGRIP-discuss mailing list
[email protected]
http://lists.agrip.org.uk/cgi-bin/mailman/listinfo/agrip-discuss


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.7/411 - Release Date: 8/7/2006


_______________________________________________
AGRIP-discuss mailing list
[email protected]
http://lists.agrip.org.uk/cgi-bin/mailman/listinfo/agrip-discuss

Reply via email to