Aller au contenu

Photo

Face original direction after conversation.


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Ryloth

Ryloth
  • Members
  • 1 messages

I have an NPC who's busy "working" at a table. When you chat with the NPC, it turns away from the table to chat. After the conversation completes, I'd like to have the PC turn back to the table and "resume" working.

 

I've tried this with a tagged POST_{NPC_TAG} waypoint, but so far no luck. After the conversation, the character continues facing away from his job.

 

Anyone know a nice way to approach this problem?



#2
Proleric

Proleric
  • Members
  • 2 345 messages
I don't know of a way to do this witnout scripting, but the code can be a one-liner.

On spawn,

SetLocalFloat(OBJECT_SELF, "Facing", GetFacing(OBJECT_SELF);

On normal conversation end, instead of walking waypoints,

SetFacing(GetLocalFloat(OBJECT_SELF, "Facing"));

In practice, conversation may pull the NPC out of position, so I also set a local location. ActionMoveToLocation returns them to post, but then you need to ActionDoCommand the SetFacing so that it happens after the move.

Of course, you can just store the location, then use GetFacingFromLocation, if you find that clearer.

AI is fragile, so if you need a really robust approach, you might walkwaypoints to POST, then set the facing on every heartbeat, using IsInConversation to prevent turning while speaking,

#3
Failed.Bard

Failed.Bard
  • Members
  • 774 messages

Changing the OnConversation script to have the PC talk to an invisible placeable (With the NPCs portrait assigned to it) at the NPCs location instead, is a work-around I've used in the past.