#Adding control over NPC's pitch and yaw

1 messages · Page 1 of 1 (latest)

dapper bison
#

Heya :)
I am proposing 2 new, additional ways to control the NPC's viewing direction, consisting of yaw and pitch.

Current State
Currently you can only influence the NPC's pitch/yaw (I will call it "eye direction") with the turn_to_player setting, as well as moving them via /npc move_here npc_name, the latter will just copy the player's eye direction.

Proposed Additions

  1. Yaw and Pitch setting
    This aims towards adjusting the eye direction of an NPC to a fixed position, after the NPC was created.
    This could be implemented as /npc npc_name yaw set <[-180.0 to 180.0]>|clear and /npc npc_name pitch set <[-90.0 to 90.0]>|clear, as a single command with flags such as /npc npc_name turn --yaw 123.4 --pitch 56.7 , or as flags upon creation of the npc via /npc create npc_name --type player --yaw 123.4 --pitch 56.7

  2. Randomized eye directions
    This aims towards making the NPCs appear more alive, enhancing the immersion and would provide the settings to configure:

  • A yaw range in which the NPC is supposed to look, e.g. -90.0 to 180.0
  • A pitch range in which the NPC is supposed to look, e.g. -20.0 to 35.0
  • A time interval (or even a range of time, e.g. 3 seconds to 5 seconds) after which the NPC will choose a new direction to look at, within the given ranges. If no ranges are defined, they will look in any direction.
    This could be implemented as /npc npc_name random_turn set yaw_range min,max, /npc npc_name random_turn set pitch_range min,max and /npc npc_name random_turn set interval min,max, or via flags as /npc npc_name random_turn false|true --yaw min,max --pitch min,max --interval min,max.

I really appreciate your consideration and if you need any additional input please ping!

dapper patio
#
  1. Yaw and pitch can't be set directly, but can be overridden with /npc move_here (npc) command or /npc move_to (x) (y) (z) (world) --look-in-my-direction. Proposed command is a good addition and will probably be added in the future. (PRs are welcome)
  2. Can't comment on that, but I don't think this is going to happen before NPC walking and pathfinding, which is a feature we would like to work on later this year.