View Single Post
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 01-18-2024 , 20:51   Re: Get Map Plane (Surface) Direction
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
You need to execute a traceline from a point in/to a wall/floor/ceiling/surface and then collect the required data from the tracehandler according to what you need which is TR_vecPlaneNormal
Thanks for your reply.
I work with cannons (func_tankmortar) on the crossfire map (Half-Life). Specifically, I intercept env_explosion:

At the moment of its call, I can determine that it was produced from the cannon (func_tankmortar), the coordinates, and angles of the cannon (if I'm doing everything correctly). Therefore, having the final coordinates of env_explosion, I can call EngFunc_TraceLine (with subsequent TR_vecPlaneNormal), but this code doesn't work.
Code:
    new szClassname[32]     pev(inflictor, pev_classname, szClassname, 31)     client_print(0, print_chat, "CLASSNAME: %s", szClassname)     new Float:originet[3]     pev(inflictor, pev_origin, originet)     client_print(0, print_chat, "ORIGIN OF CANNON: %f %f %f", originet[0], originet[1], originet[2])     new Float:angles[3]     pev(inflictor, pev_angles, angles)     client_print(0, print_chat, "ANGLES OF CANNON: %f %f %f", angles[0], angles[1], angles[2])         new Float:NormalVector[3]     new trace = create_tr2()     engfunc(EngFunc_TraceLine, originet, angles, IGNORE_MONSTERS, 0, trace)     get_tr2(trace, TR_vecPlaneNormal, NormalVector)     free_tr2(trace)     client_print(0, print_chat, "NORMAL_VEC: %f %f %f", NormalVector[0], NormalVector[1], NormalVector[2])
I must be doing something wrong. There are plenty of examples on the forum, but most of them are related to the player's point of view.
Phant is offline
Send a message via ICQ to Phant