Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Focus Distance Debug Variable?
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#12
RE: Focus Distance Debug Variable?

I don't see how you're gonna detect when the players look at any of those area, cause they are kinda far and probably many objects will interfere, like the same bridge on his feet.

Apart from that, I made a function to get the distance between two entities the other day.
You maybe find it useful.

PHP Code: (Select All)
float GetEntitiesDistance string &in fromEntitystring &in toEntity )
{
    
float x1 GetEntityPosXfromEntity );
    
float y1 GetEntityPosYfromEntity );
    
float z1 GetEntityPosZfromEntity );
    
    
float x2 GetEntityPosXtoEntity );
    
float y2 GetEntityPosYtoEntity );
    
float z2 GetEntityPosZtoEntity );
    
    
float distance1 MathSqrt(MathPow(MathAbs(x1),2) + MathPow(MathAbs(z1),2));
    
distance1 MathSqrt(MathPow(MathAbs(y1),2) + MathPow(MathAbs(distance1),2));
    
    
float distance2 MathSqrt(MathPow(MathAbs(x2),2) + MathPow(MathAbs(z2),2));
    
distance2 MathSqrt(MathPow(MathAbs(y2),2) + MathPow(MathAbs(distance2),2));
    
    
float totalDistance MathMax(distance1,distance2) - MathMin(distance1,distance2);
    
    return 
totalDistance;
    


12-27-2014, 04:22 PM
Find


Messages In This Thread
RE: Focus Distance Debug Variable? - by Daemian - 12-20-2014, 03:40 PM
RE: Focus Distance Debug Variable? - by Mudbill - 12-20-2014, 09:34 PM
RE: Focus Distance Debug Variable? - by Mudbill - 12-20-2014, 10:09 PM
RE: Focus Distance Debug Variable? - by Daemian - 12-27-2014, 04:22 PM
RE: Focus Distance Debug Variable? - by Daemian - 12-29-2014, 11:12 PM



Users browsing this thread: 2 Guest(s)