Lauriel Posted January 29, 2020 Share Posted January 29, 2020 (edited) 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 January 29, 2020 by Lauriel Quote Link to comment
jastey Posted January 29, 2020 Share Posted January 29, 2020 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? Quote Link to comment
Lauriel Posted January 29, 2020 Author Share Posted January 29, 2020 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. Quote Link to comment
Lauriel Posted January 29, 2020 Author Share Posted January 29, 2020 Oh wait! I think I know how to do this! I think... Have originating NPC say his line and then have a series of IF ... GOTO statements pointing to different sections... I think I have this. It'll be messy, but it'll be fun. Quote Link to comment
jastey Posted January 29, 2020 Share Posted January 29, 2020 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. Quote Link to comment
Lauriel Posted January 29, 2020 Author Share Posted January 29, 2020 Oooo. Thanks @jastey! It'll take a while to wrap my head around that, but I'll get busy on it. Quote Link to comment
Lauriel Posted January 29, 2020 Author Share Posted January 29, 2020 This made my life SOOO much easier. Thank you again, @jastey! I'm having WAY too much fun with this dialogue. I hope other people think it's as funny as I do. Quote Link to comment
Lauriel Posted January 30, 2020 Author Share Posted January 30, 2020 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? Quote Link to comment
Lauriel Posted January 30, 2020 Author Share Posted January 30, 2020 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. Quote Link to comment
theacefes Posted January 30, 2020 Share Posted January 30, 2020 You want to make sure you're transitioning to the correct dialogue file (maybe a different NPC). So maybe it's not CHAIN as a concept causing the error but how its being implemented. (Sorry if that's unhelpful - if you want to post code we can look at it too) Quote Link to comment
Lauriel Posted January 30, 2020 Author Share Posted January 30, 2020 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! Quote Link to comment
Lauriel Posted January 30, 2020 Author Share Posted January 30, 2020 2 minutes ago, theacefes said: So maybe it's not CHAIN as a concept causing the error but how its being implemented. Oh, it was definitely how it was being implemented. Quote Link to comment
Lauriel Posted January 30, 2020 Author Share Posted January 30, 2020 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. Quote Link to comment
jastey Posted January 30, 2020 Share Posted January 30, 2020 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. Quote Link to comment
Lauriel Posted January 30, 2020 Author Share Posted January 30, 2020 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!) Quote Link to comment
Recommended Posts
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.