You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the Player :: GetNearByLocation function to spawn Special infected better than Director.
The problem is the Player :: CanTraceToLocation function when trying to find a place that Survivor can not see.
This is theoretically no problem.
Returning Utils.AreVectorsEqual (m_trace.pos, finish) on some maps is problematic.
For example, in map c2m5_concert.
GetNearByLocation finds a position in the tilted audience chair Navmash and when CanTraceToLocation decides.
It returns a false value with an error of Z axis (difference of 0.00035 for example) with a very slight difference.
It is also the same when the player is placed in a tilted navmash.
The conclusion is that the player can see its position, but the CanTraceToLocation function returns false.
So I modified it to "Utils.CalculateDistance (arr [i], m_trace.pos) <15) return true".
And with a little tolerance, I solved this problem.
So VSLib :: Utils :: SpawnZombieNearPlayer has a problem. I used this at first. It did not work well.
TraceMask should use MASK_OPAQUE. (Reason: transparent white barbed wire for example c2m2_fairgrounds)
I do not know why it traces the 128-height of the Z-axis. The general eye level of special infected is about 60.
Below is the function I created. Trace values are returned more naturally in real situations.
I am using the Player :: GetNearByLocation function to spawn Special infected better than Director.
The problem is the Player :: CanTraceToLocation function when trying to find a place that Survivor can not see.
This is theoretically no problem.
Returning Utils.AreVectorsEqual (m_trace.pos, finish) on some maps is problematic.
For example, in map c2m5_concert.
GetNearByLocation finds a position in the tilted audience chair Navmash and when CanTraceToLocation decides.
It returns a false value with an error of Z axis (difference of 0.00035 for example) with a very slight difference.
It is also the same when the player is placed in a tilted navmash.
The conclusion is that the player can see its position, but the CanTraceToLocation function returns false.
So I modified it to "Utils.CalculateDistance (arr [i], m_trace.pos) <15) return true".
And with a little tolerance, I solved this problem.
So VSLib :: Utils :: SpawnZombieNearPlayer has a problem. I used this at first. It did not work well.
TraceMask should use MASK_OPAQUE. (Reason: transparent white barbed wire for example c2m2_fairgrounds)
I do not know why it traces the 128-height of the Z-axis. The general eye level of special infected is about 60.
Below is the function I created. Trace values are returned more naturally in real situations.
function VSLib::Player::CanTraceLocationAround (where, tolerance = 15, traceMask = MASK_OPAQUE)
{
if(!IsEntityValid()) return;
if(!IsAlive()) return;
}
The text was updated successfully, but these errors were encountered: