Jump to content

Possible for player character to talk in a CHAIN?


Bleepbloop

Recommended Posts

Using Weidu's CHAIN system, I'd like to create a conversation between multiple party members, including the player character AKA Player1, if possible.

Ideally, I'd like the player's portrait and name to be displayed when he/she "speaks". But even if the player's comments are displayed with no name or portrait, that would still work OK for me.

I know this goes somewhat against the idea of roleplaying, but IMO it fits in some circumstances where you want a conversation akin to a cut-scene where no choices are necessary.

Is it possible to do this within the CHAIN syntax?

My mod is for BG2 EE only, in case that helps.

Edited by Bleepbloop
Link to comment

In BGII Player1 has a dlg file, it's player1.dlg - BGII uses it for things that "happen" to the PC like the slayer change etc. Even if it weren't, you could still make an invisible helper creature, give it PC's name (portrait I'm not sure) and let it speak.

You already said it yourself - I'd advice against railroading the PC like this, though. It's usually not well received by players. (Cutscenes aren't either.)

Link to comment

Yes, say you start a new .d file with "BEGIN Bb#something" and continue with a CHAIN, you then after END, you just:

END
++ ~text reply~ + Bdreply 

Which can have multiple replies as options...

And then the Bbreply goes to another reply CHAIN ... like for example:


CHAIN
IF ~~ THEN Bb#something Bbreply
~text~
DO ~SetGlobal("balhblah","GLOBAL",1)~
++ ~text~
= ~text~
= ~text~ EXIT

At which point my code ends.

... and the options all end with the EXIT .

Link to comment
6 minutes ago, jastey said:

BGII uses it for things that "happen" to the PC like the slayer change etc.

That's actually a big part of what I want to use it for.

However I tried to write == PLAYER1 ~The text here.~ in a CHAIN initiated by an NPC, and when I tested it out, the conversation terminated right before that line IIRC. When I changed PLAYER1 to the dialogue name of another party member, it worked. Did I mess something up here? Compiled with Weidu 24700, tested in BG2 EE.

Link to comment
11 minutes ago, Jarno Mikkola said:

Yes, say you start a new .d file with "BEGIN Bb#something" and continue with a CHAIN, you then after END, you just:


END
++ ~text reply~ + Bdreply 

Which can have multiple replies as options...

Thanks Jarno, but that's not what I meant. :)

What I'd like is for the player character's dialogue lines, or narration on what's happening to the player character, appear embedded in the chain the same way as when NPCs speak.

Link to comment
12 minutes ago, Bleepbloop said:

However I tried to write == PLAYER1 ~The text here.~ in a CHAIN initiated by an NPC, and when I tested it out, the conversation terminated right before that line IIRC.

Hmm. Maybe I didn't understand how player1.dlg actually works. All I know is that something like "StartDialog("player1",Player1)" works.

Maybe you'd have to set player1.dlg to be Player1's dialogue before using it in a chain. 🤔

Link to comment
3 hours ago, jastey said:

Hmm. Maybe I didn't understand how player1.dlg actually works. All I know is that something like "StartDialog("player1",Player1)" works.

Maybe you'd have to set player1.dlg to be Player1's dialogue before using it in a chain. 🤔

Yeah I'm not sure either. Good clue about the StartDialog, thanks.

Btw, I had a look at the Slayer scene you mentioned, and that's doing exactly what I want. (Although that's not coded with Weidu obviously.) Timestamped YouTube link here.

I'll continue experimenting. If anyone knows how this is supposed to be done, please comment. :)

EDIT: Confirmed that the dialogue ends when Player1 is about to speak in this simple example:

CHAIN MYNPCJ ChainTest
~NPC line~ == PLAYER1 ~Player line~
EXIT

 

Edited by Bleepbloop
Link to comment

Ah, found it. Apparently you have to set Player1's dialogue file using SetDialog.

My above example works as expected if I call the following before the chain is triggered:

DO ~ActionOverride(Player1, SetDialog("Player1"))~

DO ~ActionOverride(Player1, SetDialog("Player1"))~

However since CHAIN doesn't appear to allow FLAGS, I can't set the dialog file in the chain itself, which would have been nice.

Does anyone know why Player1's dialogue file isn't just permanently set to PLAYER1(.DLG) by modders? Will that cause issues elsewhere?

Thanks. :)

Link to comment
1 minute ago, Bleepbloop said:

to set Player1's dialogue file using SetDialog

That's what I was speculating in my last post, sorry for being cryptic.

How do you start the CHAIN? If it's done via script the setting of the dlg could be added there, but I guess you're aware of that.

3 minutes ago, Bleepbloop said:

Will that cause issues elsewhere?

It's always used for the original content afaik so I guess it would be fine (and mods that need something else should take care of it and set it back to player1.dlg afterwards, probably).

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...