Jump to content

How to force NPC talk to Player1 in a banter?


Recommended Posts

I was recently studying how banters works (for bg2ee) and found out that a NPC talks to the nearest NPC in a banter, not to Player1, even if the dialog has REPLY options and it is assumed that it should happen to Player1. Eg the banter from BVALYGA.D dialog:

IF WEIGHT #2 /* Triggers after states #: 139 even though they appear after this state */
~See(Player1)
CombatCounter(0)
!StateCheck(Player1,STATE_SLEEPING)
Global("BValygar7","LOCALS",0)~ THEN BEGIN 91 // from:
  SAY #21516 /* ~I am curious. How much experience have you had with magic?~ [VALYGA67] */
  IF ~Class(Player1,MAGE)
~ THEN REPLY #21517 /* ~I am a mage, Valygar. My experience with magic is quite thorough, I assure you. Why do you ask?~ */ DO ~SetGlobal("BValygar7","LOCALS",1)~ GOTO 92
  IF ~Class(Player1,CLERIC)
~ THEN REPLY #21518 /* ~As a cleric I gain my magic through the worship of my god. Why do you ask?~ */ DO ~SetGlobal("BValygar7","LOCALS",1)~ GOTO 93
  IF ~~ THEN REPLY #21519 /* ~I have had considerable encounters with magic throughout my travels, Valygar, if that's what you mean.~ */ DO ~SetGlobal("BValygar7","LOCALS",1)~ GOTO 94
  IF ~~ THEN REPLY #21520 /* ~This is no time for chatter, Valygar.~ */ DO ~SetGlobal("BValygar7","LOCALS",1)~ GOTO 95
END

And in the game, it looks like:

Screenshot_20240519_063545.png.a57cb208628703efb5d9d9d579c1eccf.png

Because Yoshimo was closer to Valygar than Player1.

So, is there a way to make sure that NPC starts dialog with Player1 in a banter?

Link to comment

I guess this happens if the engine-internal random banter calling is happening. All I'd know is to force the banter via scripting. I would asume that Interact(Player1) would indeed show the PC as one participant in the conversation.

For the randomly happening banter, one could add another trigger to teh banter that Player1 should be LastSeenBy(Myself) or the nearest or something, but this could lead to instances where the banter hardly ever happens because the NPC and Player1are never close enough together for it to happen (EDIT because they would have to be in that exact moment).

The third option is to put a note into the readme for people to ignore the wrong name. 😅

 

Link to comment
52 minutes ago, jastey said:

I guess this happens if the engine-internal random banter calling is happening. All I'd know is to force the banter via scripting.

Thank you. Do you know mods that implement random banters of this sort using scripts? I guess, the global flag "time_for_banter" should be raised with a timer and every individual NPC script should try to start a banter and lower this flag if succeeded. I am not sure how random it is going to be, though.

Link to comment

Some banter accelerators work like this imho. Especially the old ones that already existed for the old engine, in PPG Banterr Pack for example. It's a set of script blocks, I think added to PLayer2/3.bcs, that start with "Interact" (although I think it is "Myself", which would be even funier to read up on...).

Also, the BioWare romances use the banter file for their romance dialogues, triggered by Intract(Player1).

It would only be random if the timers used would simulate randomsess.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...