10.03.2018, 16:44
Quote:
Thanks for updating, i found one thing that i think must be different:
Code:
CA_RayCastLineAngle(X, Y, Z + 0.75, X, Y, Z - 3.0, waste, waste, waste, surface_rx, surface_ry, waste); Code:
CA_RayCastLineAngle(DriverPath[driverid][cnode][0], DriverPath[driverid][cnode][1], DriverPath[driverid][cnode][2] + 0.75, DriverPath[driverid][cnode][0], DriverPath[driverid][cnode][1], DriverPath[driverid][cnode][2] - 3.0, waste, waste, waste, surface_rx, surface_ry, waste); You wouldn't be needing this part on line 1834 as well anymore: Code:
FCNPC_GetPosition(npcid, X, Y, Z); |
There are situations where the next node's surface angle is a lot different than the last node's surface angle, so it's generally better to use the NPC's current position.
With the QuaternionStuff Plugin I calculated the X and Z angle based on the Nodes, not the surface. A correct version would update the surface angle constantly, not only when passing a node.
Anyway this whole script could use a re-write. The code base is 5 years old and nowadays I would do A LOT very differently and more efficiently.