Jump to content

Building new dialogues with interjections


Lauriel

Recommended Posts

I swear, I read documentation...honestly...

I'm building a new dialogue and want interjections from various group members.  If I were updating one already in the game, I'd know what to do.  Which I find odd because that should be harder, you'd think.  It's not a chain because the PC has options to talk.

Here's my dialogue:

Spoiler

IF ~~ THEN BEGIN L_WARNARMOR
    SAY @2017 /*~Oh!  It's you again!~  */
    = @2018 /* ~I have to say, be careful with wearing that. For a second I thought you're him! Nearly got out my dagger, I did.~ */
    ++ @2020 /* ~Of course you were.~ */ + L_EXPLAINBODIES     << WANT TO MOVE THIS TO GARRICK IF HE'S IN THE GROUP
    ++ @2019 /* ~Hah!~ */ + L_EXPLAINBODIES      <<  WANT TO MOVE THIS TO DORN IF HE'S IN THE GROUP
    ++ @2021 /* ~We could tell our lives were in imminent danger.~ */ + L_EXPLAINBODIES
    ++ @2022 /* ~Warning noted.~ */ + L_EXPLAINBODIES
END

I bet this is super simple.  I just couldn't find it in the documentation or an example in a mod. 

EDIT:  I don't suppose it's possible to move the lines to the PC if the one designated to say them isn't in the group...is it?

Edited by Lauriel
Link to comment
2 hours ago, Lauriel said:

It's not a chain because the PC has options to talk.

It's no problem to end a CHAIN with reply options. I am not sure I undestand what exactly you want to do. Should some of the reply options only show if the according NPCs are in the group (and the NPCs will say something if the reply options are chosen), or should they not show and the NPCs are supposed to talk instead but only if the NPCs are present?

Link to comment

I want the conversation with the originating NPC (in this case, Denkod) with the protagonist to be interrupted by Garrick, Dorn (and perhaps others).  Denok says his lines, if Garrick is in the group, he chimes in, if Dorn is in the group, he chimes in, finally the protagonist gets an options to speak and the conversation moves to it's next phase.

Ultimately, I'd like the lines for Garrick and Dorn to be options for the protagonist to select in his/her reply if they're not in the group.  But I've never seen that before so I'm thinking that would be pretty messy.

Link to comment

There is a quite non-messy way to do this. If you want reply options only to show for certain conditions (i.e. in this case, if certain NPCs are not in party or can't speak), it's easy to give them according triggers. Your examüle above would become:

CHAIN
IF ~~ THEN DENKOD L_WARNARMOR
@2017 /*~Oh!  It's you again!~  */
    = @2018 /* ~I have to say, be careful with wearing that. For a second I thought you're him! Nearly got out my dagger, I did.~ */
== %GARRICK_JOINED% IF ~InParty("GARRICK") InMyArea("GARRICK") !StateCheck("GARRICK",CD_STATE_NOTVALID)~ THEN @2020 /* ~Of course you were.~ */
== %DORN_JOINED% IF ~InParty("DORN") InMyArea("DORN") !StateCheck("DORN",CD_STATE_NOTVALID)~ THEN @2019 /* ~Hah!~ */
END
    + ~OR(3)
!InParty("GARRICK") !InMyArea("GARRICK") StateCheck("GARRICK",CD_STATE_NOTVALID)~ + @2020 /* ~Of course you were.~ */ EXTERN DENKOD  L_EXPLAINBODIES     
    + ~OR(3)
!InParty("DORN") !InMyArea("DORN") StateCheck("DORN",CD_STATE_NOTVALID)~ + @2019 /* ~Hah!~ */ EXTERN DENKOD L_EXPLAINBODIES      
    ++ @2021 /* ~We could tell our lives were in imminent danger.~ */ EXTERN DENKOD L_EXPLAINBODIES
    ++ @2022 /* ~Warning noted.~ */ EXTERN DENKOD L_EXPLAINBODIES

For the %GARRICK_JOINED% etc. you need to read in the cpmvars.tpa. The CD_STATE_NOTVALID gets patched to the state.ids.

Link to comment

I take it that CHAIN can't be used in the middle of a conversation?  Just the word CHAIN itself is causing a Weidu error.  I have a prior block of dialogue that transitions to this block after the protagonist responds.  Do I have to use a messy solution?

Link to comment
1 hour ago, Lauriel said:

I'll try setting a global to trick it into not seeing the previous part of the conversation.  I'll post results here when I'm done hitting this piece of code over the head with a mallet.

Yes, the CHAIN couldn't be within an APPEND.  I took it out of that block and just used global variables to queue it up.  SO HAPPY!

Link to comment
40 minutes ago, Lauriel said:

Yes, the CHAIN couldn't be within an APPEND.  I took it out of that block and just used global variables to queue it up.  SO HAPPY!

It was unnecessary to use a global variable to get to the chain.  Just had to go to as normal.  The code for it had to be outside of the APPEND, but that's it.  Just for future reference if anyone else having the same issue happens to stumble across this thread.

Link to comment
3 hours ago, Lauriel said:

I take it that CHAIN can't be used in the middle of a conversation?  Just the word CHAIN itself is causing a Weidu error.  I have a prior block of dialogue that transitions to this block after the protagonist responds.  Do I have to use a messy solution?

Normal dialogue states should be wrapped inside

APPEND dlgname

...

END //APPEND

(unless it's a completely new dialogue that starts with BEGIN

Then you can use a CHAIN

...

Then continue with APPEND - END.

I don't know whether it's the most elegant way of of scripting dialogues, but it makes reading them much easier because this way the dialogue is inside the d-file in the order it appears in the game, and you do not have to hop from top to bottom to follow it.

Have an example from my Brage mod:

Spoiler

/* Reaction to Bhaal heritage */

IF ~Global("C#BE_KnowOfBhaal","GLOBAL",2)~ THEN bhaalchild
SAY @70
++ @71 + bhaalchild_01
++ @72 + bhaalchild_01
++ @73 + bhaalchild_02
++ @74 + bhaalchild_03
END

IF ~~ THEN bhaalchild_01
SAY @75
IF ~~ THEN + bhaalchild_03
END

IF ~~ THEN bhaalchild_02
SAY @76
IF ~~ THEN + bhaalchild_03
END

END //APPEND

CHAIN
IF ~~ THEN C#BrageJ bhaalchild_03
@77
== C#BrageJ IF ~OR(2)
ReputationLT(Player1,10)
Alignment(Player1,MASK_EVIL)~ THEN @251
== C#BrageJ @268
END
++ @78 + bhaalchild_04
++ @79 + bhaalchild_04
++ @80 + bhaalchild_04


APPEND C#BrageJ

IF ~~ THEN bhaalchild_04
SAY @81
IF ~~ THEN DO ~SetGlobal("C#BE_KnowOfBhaal","GLOBAL",3)~ EXIT
END

The reason I used CHAIN here in teh middle of the dialogue is that he has an extra remark in case the reputation of the PC is low. CHAIN is super handy if it comes to things like that.

 

EDIT: oh, it happens I didn't see the second page of this thread.

Link to comment

As a newb who really does read the documentation (HONEST!) I think a tutorial on this in the Weidu documentation would be extremely helpful.  It states that CHAIN is only used when the PC doesn't have an option to speak.  It never says anything about adding PC replies to the end or that the entire chain needs to be outside of an append...well, actually it sort of does.  But not emphasized at all.

Who should I reach out to about this? (yeah yeah yeah, not proper grammar - oh well - c'est la vie!)

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