NPC Yaw Rotation
NPC Yaw Rotation
Here is the basic Yaw value if you want to set a NPC's heading.
Here is a breakdown to help explain it.
You can also do this do a /loc ingame and take your rotation and multiple it by 91.02
Example 180 x 91.02 = 16384
16384 will be the yaw value that i enter into the DBE.
Code: Select all
East -> 0
south -> 16384
west -> 32768
North -> 49152
Max value is 65536 which is basically East since it resets to 0
Code: Select all
Unreal Units Degrees Radians * π Steps per circle
1024 5.625 1/32 64 (default step size of the rotation grid)
2730 15 1/12 24 (not quite round, it's actually 2730.6666... )
8192 45 1/4 8
16384 90 1/2 4
24576 135 3/4 2.66...
32768 180 1 2
65536 360 2 1 - full circle
Example 180 x 91.02 = 16384
16384 will be the yaw value that i enter into the DBE.
You do not have the required permissions to view the files attached to this post.
Re: NPC Yaw Rotation
For my own notes, since I'm a dumbass and won't remember this when I need it later, if you have a negative rotation:
Rot + 180 then multiply it by 91.02.
Rot + 180 then multiply it by 91.02.

Re: NPC Yaw Rotation
If this is useful for anyone, please feel free to use it - I created a simple function to return an NPC to their original heading after x seconds.
Add these 2 lines into your scripts:
require "Spawns/Generic/spawn_functions"
and
Return_Rotation(Npc, pause)
That will return the NPC to its original rotation (pitch, yaw, roll) that's in the db after however many seconds you set for pause. I'm starting to add that into the hailed() function which also has facetarget() in it, so when you hail the NPC it faces you, then returns to where it started x seconds later.
Add these 2 lines into your scripts:
require "Spawns/Generic/spawn_functions"
and
Return_Rotation(Npc, pause)
That will return the NPC to its original rotation (pitch, yaw, roll) that's in the db after however many seconds you set for pause. I'm starting to add that into the hailed() function which also has facetarget() in it, so when you hail the NPC it faces you, then returns to where it started x seconds later.
Haiku is easy -
But sometimes it makes no sense.
Refridgerator.
But sometimes it makes no sense.
Refridgerator.
Re: NPC Yaw Rotation
OK, added a better one.
Face_and_Return(Npc, Player, pause)
That will make the NPC face the player and return after x seconds. Put that into your hailed() and your good to go.
Face_and_Return(Npc, Player, pause)
That will make the NPC face the player and return after x seconds. Put that into your hailed() and your good to go.
Haiku is easy -
But sometimes it makes no sense.
Refridgerator.
But sometimes it makes no sense.
Refridgerator.
Re: NPC Yaw Rotation
Yeah...
Some of mine don't turn at all, some do. I guess something to keep in mind moving forward. Or maybe a nice project for a new content dev! That way he/she can learn the ropes from looking through various scripts!
Some of mine don't turn at all, some do. I guess something to keep in mind moving forward. Or maybe a nice project for a new content dev! That way he/she can learn the ropes from looking through various scripts!
Haiku is easy -
But sometimes it makes no sense.
Refridgerator.
But sometimes it makes no sense.
Refridgerator.