The Black Wyrm's Lair - Forums

Mod development resources & discussion => Modder's Workshop => Topic started by: jastey on May 21, 2005, 12:08:25 AM

Title: how to "Face(X)" the PC
Post by: jastey on May 21, 2005, 12:08:25 AM
Hi,
I have the following problem: If an NPC initiates dialogue with the PC, she will turn to him after the talk is finished. If I start a cutscene out of this dialogue, where the NPC cures her wounds for example while saying some nice things, he is doing this while she is turning her back on him - if he approached from the wrong side for the talk.
For coding I neither know in which area this talk appears nor where NPC and PC are facing at that moment.

Question: Is it possible to do "MoveToPoint" and "Face" in a way relative to the PC's position? If yes, how would it be coded?

Does anyone have another idea as to how this problem could be solved?

(It really looks stupid if the NPC is talking to the PC's back...)

Thanks!
Title: how to "Face(X)" the PC
Post by: Rabain on May 21, 2005, 12:17:21 AM
If you are doing a cutscene you can have people approach from whichever direction you want!

So the person starting the dialog approaches from the North and the person listening Faces North...problem solved!

MovetoPoint(whatever) Face (Whatever)...person being spoken too Face(whatever direction speaker is facing oppposite)!
Title: how to "Face(X)" the PC
Post by: jastey on May 21, 2005, 12:43:20 AM
But if I do not know where the persons are standing when the cutscene starts? Maybe the person approaching comes from South... Which I do not know? And I can't give coordinates either, as I do not know in which area it will take place?

Maybe I did not understand what you where saying?
Title: how to "Face(X)" the PC
Post by: devSin on May 21, 2005, 03:52:03 AM
FaceObject(O:Object)
Title: how to "Face(X)" the PC
Post by: jastey on May 21, 2005, 08:07:06 AM
Sometimes the answer is so simple! Thank you, devSin, cutscene looks great now.  ^_^
Title: how to "Face(X)" the PC
Post by: Rabain on May 21, 2005, 12:34:00 PM
Apart from FaceObject (which is a lot better than just Face) my point was that if you have a character in a cutscene there is never a stage when you have no control.  As the author of the cutscene you can create characters wherever you wish and have them movetopoint, face etc any place or direction you wish.

In what circumstance would you not know from which direction someone would come?  Unless you were using CreateCreatureOffscreen (or whatever the correct format of this command is).  However you would still be able to control where this creature moves to and which way they face, no?

Anyway, yes FaceObject() is so much better. :)
Title: how to "Face(X)" the PC
Post by: jastey on May 21, 2005, 12:50:10 PM
In this case it was a cutscene between the PC and an already in party NPC, so I do not have control as to where I could spawn them etc.

FaceObject is perfect in that case. :)
Title: how to "Face(X)" the PC
Post by: jastey on February 27, 2008, 08:33:52 PM
Quote from: jastey on May 21, 2005, 12:50:10 PMFaceObject is perfect in that case. :)
Unfortunately, it doesn't exist in vanilla BG1, though. I would have had a use for it there now. :(
Title: how to "Face(X)" the PC
Post by: devSin on February 27, 2008, 10:48:01 PM
If you don't know where the PC is going to be, you could always do something stupid like have your NPC ReallyForceSpell(Player1,FAKE_SPELL_DOES_NOTHING) Wait(1) StartDialog("DLG",Player1). Spellcasting should have the character zip around to face the target (you have to create the fake spell, though). (There are probably other actions that cause the actor to face the target without causing stupid feedback, but I can't come up with any off hand and don't want to look at BG IDS files right now, sorry.)
Title: how to "Face(X)" the PC
Post by: jastey on February 28, 2008, 07:10:56 AM
That's a good idea, thank you! If you happen to see something that leads to a facing of the "target" without a visible action I would be grateful if you'd let me know. (I also take numbers. :P)
Title: how to "Face(X)" the PC
Post by: kulyok on February 28, 2008, 07:28:06 AM
FaceObject would be the solution, but another one is the solution we implement in RE:

ActionOverride("ppsaem3",MoveBetweenAreas("ARRE01",[472.307],3))
LeaveAreaLUAPanic("ARRE01","",[440.323],10)
LeaveAreaLUA("ARRE01","",[440.323],10)
...
Wait(1)


This way, Saemon and PC turn to each other(3 and 10), and Wait(1) before the start of the dialogue ensures they do.
Title: how to "Face(X)" the PC
Post by: jastey on February 28, 2008, 05:53:20 PM
If you can transfer, or even spawn the NPCs, then this is an option, yes. It wasn't for me in this case, though.