Help - Search - Members - Calendar
Full Version: Request help with dialogue coding
The Black Wyrm's Lair - Forums > Mod development resources & discussion > Modder's Workshop
Moongaze
I'm still busy trying to get Wikaede's quest to work. However, I'm not having much luck getting the dialogues to install properly. Currently, this is the part where it hiccups, as indicated by <------------


CODE
BEGIN MGWIKHR



IF ~!InParty("Wikaede")~ THEN BEGIN MGMeetHarahWithoutWikaede
SAY ~Kind <PRO_SIRLADY>, please excuse me. I am very busy with my chores. If you have any questions, you may ask one of the others.~
IF ~~ THEN EXIT
END


CHAIN IF ~InParty("Wikaede")
See("Wikaede")
!StateCheck("Wikaede",STATE_SLEEPING)
Global("MGWikaHarahQuestStart","GLOBAL",0)~ THEN BEGIN MGMeetHarahWithWikaede  <------------

// ACCORDING TO WEIDU, THE ERROR IS SOMEWHERE AROUND HERE. I DO NOT SEE IT.


SAY ~Wikaede... It has been some time. It is good to see you again.~
== MGWIKAJ
~Indeed it has been. I have missed you. Have you been well?~
== MGWIKHR
~Yes, everything has been fine. No need to worry. However, I do have a small task that needs to be completed, which I currently cannot do, due to my schedule.~
== MGWIKAJ
~Which would be...?~
== MGWIKHR
~A gnomish alchemist by the name of Bunyan had been commissioned to create a certain type of potion. We have received word that it is ready, and it needs to be delivered to us. Would you be interested in taking on such a task?~
== MGWIKAJ
~Of course. It is but a small task and shall not harm our greater plans. However, I fear it is not my choice alone. <CHARNAME>, what do you think?~
++ ~It shouldn't be a problem, Wikaede. We will get it for you.~ GOTO MGWikaAcceptPotionQuest
++ ~We don't have the time for this right now.~ GOTO MGWikaRefusePotionQuest
END

CHAIN IF ~~ THEN BEGIN MGWikaAcceptPotionQuest
SAY ~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
== MGWIKAJ
~I understand. In that case, I shall be off. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
IF ~~ THEN DO ~SetGlobal("MGWikaHarahQuestStart","GLOBAL",1)~
EXIT
END

CHAIN IF ~~ THEN BEGIN MGWikaRefusePotionQuest
SAY ~It is fine. There is no rush to perform such a task.~
== MGWIKAJ
~Still, it is a pity. Since we cannot be of further assistance here at this time, I shall depart. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
  IF ~~ THEN DO ~SetGlobal("MGWikaHarahRefuseQuest","GLOBAL",1)~
EXIT
END


I have already started using CHAIN IF as a result of my earlier query on how to get a new in-party NPC to converse with a new out-party NPC, allowing Wikaede to interject into the player's conversation with Harah (MGWIKHR). I have no idea as to why it hiccups and refuses to install.

I also do not know if it's allowed to have the PC provide his/her decision on accepting or refusing the quest in this manner.
I assume the dialogue right AFTER the PC makes his/her decision, the dialogue would come from MGWIKHR rather than Wikaede, yet again I am not certain.

Some assistance would be appreciated. happy.gif
The Bigg
QUOTE
BEGIN MGWIKHR

IF ~!InParty("Wikaede")~ THEN BEGIN MGMeetHarahWithoutWikaede
SAY ~Kind <PRO_SIRLADY>, please excuse me. I am very busy with my chores. If you have any questions, you may ask one of the others.~
IF ~~ THEN EXIT
END


CHAIN IF ~InParty("Wikaede")
See("Wikaede")
!StateCheck("Wikaede",STATE_SLEEPING)
Global("MGWikaHarahQuestStart","GLOBAL",0)~ THEN MGWIKHR MGMeetHarahWithWikaede
~Wikaede... It has been some time. It is good to see you again.~
== MGWIKAJ
~Indeed it has been. I have missed you. Have you been well?~
== MGWIKHR
~Yes, everything has been fine. No need to worry. However, I do have a small task that needs to be completed, which I currently cannot do, due to my schedule.~
== MGWIKAJ
~Which would be...?~
== MGWIKHR
~A gnomish alchemist by the name of Bunyan had been commissioned to create a certain type of potion. We have received word that it is ready, and it needs to be delivered to us. Would you be interested in taking on such a task?~
== MGWIKAJ
~Of course. It is but a small task and shall not harm our greater plans. However, I fear it is not my choice alone. <CHARNAME>, what do you think?~
END
++ ~It shouldn't be a problem, Wikaede. We will get it for you.~ EXTERN MGWIKHR MGWikaAcceptPotionQuest
++ ~We don't have the time for this right now.~ EXTERN MGWIKHR MGWikaRefusePotionQuest

CHAIN IF ~~ THEN MGWIKHR MGWikaAcceptPotionQuest
~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
== MGWIKAJ
~I understand. In that case, I shall be off. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
END
IF ~~ THEN DO ~SetGlobal("MGWikaHarahQuestStart","GLOBAL",1)~ EXIT

CHAIN IF ~~ THEN MGWIKHR MGWikaRefusePotionQuest
~It is fine. There is no rush to perform such a task.~
== MGWIKAJ
~Still, it is a pity. Since we cannot be of further assistance here at this time, I shall depart. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
END
IF ~~ THEN DO ~SetGlobal("MGWikaHarahRefuseQuest","GLOBAL",1)~ EXIT


You need to write your initial dialog file name after the THEN in a CHAIN (and not use the BEGIN). You don't need SAY. The synthax for the transitions here is "END ++ etc. ++ etc." rather than "++ etc ++ etc END" (don't you love consistent design?), and you should use EXTERN rather than GOTO. Ditto for the following two CHAINs. thumb.gif

EDIT: more fixes.
Sir_Carnifex
Well, after pretending this was my problem and trying to solve it, I must say that I failed miserably. Therefore, I looked at the answer and, sure enough, I saw the problem instantly! biggrin.gif

(sigh) I guess that means I'm not ready to troubleshoot for others. sad.gif
Moongaze
Not quite familiar with seeing the code in such a way. First END and followed by a IF ~~ THEN DO ~SetGlobal. Well, as long as it works, 'tis fine with me. Also, using the dialogue filename in the bits there is something I had not thought of. Thank you very much for the quick assistance. It was more complex than I had first thought. However, I have an additional question regarding EXTERN and APPEND.

I'm slightly familiar with EXTERN, in that I have used it on one occassion during creating Wikaede for the first time.
A block such as this would appear at the bottom of the dialogue file, if I am correct:

CODE
APPEND MGWIKHR
IF ~~ THEN BEGIN MGWikaAcceptPotionQuest
SAY ~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
IF ~~ THEN EXIT
END


However, there are some lines being spoken by Wikaede as well. Does this require a CHAIN, or something like the following?

CODE
APPEND MGWIKHR
IF ~~ THEN BEGIN MGWikaAcceptPotionQuest
SAY ~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
== MGWIKAJ
~I understand. In that case, I shall be off. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
IF ~~ THEN DO ~SetGlobal("MGWikaHarahQuestStart","GLOBAL",1)~
EXIT
END


I would not know.
The Bigg
If there is more than one person speaking (such as in your example), CHAIN. If there's only one, `BEGIN dialogueName' or `APPEND dialogueName' are both fine.
Moongaze
QUOTE
APPEND MGWIKHR
CHAIN IF ~~ THEN BEGIN MGWikaAcceptPotionQuest
SAY ~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
== MGWIKAJ
~I understand. In that case, I shall be off. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
IF ~~ THEN DO ~SetGlobal("MGWikaHarahQuestStart","GLOBAL",1)~
EXIT
END


I reckon it would be like this... could be wrong, though.
The Bigg
CHAIN is a D action, so it lives outside of APPEND, since APPEND contains states.
Moongaze
Mmm... you know, I really despise coding. I'll be glad once I finally know all that I need to know.
Thanks, though. I'll give it a try, see if it will work in the way I intend it to.

I'll be back.
Moongaze
I tried inputting the solution and I still get the same parse error, near the third BEGIN (second segment, "Wikaede... It has been some time"). Even if the way I EXTERN and APPEND is flawed (I'm clueless, truly), that doesn't seem to be the issue with this particular error. What it is, in that case, I have no idea. I wish not to just forget about the whole quest thing... Below is the entire MGWIKHR.d file.

CODE
BEGIN MGWIKHR



IF ~!InParty("Wikaede")~ THEN BEGIN MGMeetHarahWithoutWikaede
SAY ~Kind <PRO_SIRLADY>, please excuse me. I am very busy with my chores. If you have any questions, you may ask one of the others.~
IF ~~ THEN EXIT
END


CHAIN IF ~InParty("Wikaede")
See("Wikaede")
!StateCheck("Wikaede",STATE_SLEEPING)
Global("MGWikaHarahQuestStart","GLOBAL",0)~ THEN BEGIN MGMeetHarahWithWikaede
SAY ~Wikaede... It has been some time. It is good to see you again.~
== MGWIKAJ
~Indeed it has been. I have missed you. Have you been well?~
== MGWIKHR
~Yes, everything has been fine. No need to worry. However, I do have a small task that needs to be completed, which I currently cannot do, due to my schedule.~
== MGWIKAJ
~Which would be...?~
== MGWIKHR
~A gnomish alchemist by the name of Bunyan had been commissioned to create a certain type of potion. We have received word that it is ready, and it needs to be delivered to us. Would you be interested in taking on such a task?~
== MGWIKAJ
~Of course. It is but a small task and shall not harm our greater plans. However, I fear it is not my choice alone. <CHARNAME>, what do you think?~
END
++ ~It shouldn't be a problem, Wikaede. We will get it for you.~ EXTERN MGWIKHR MGWikaAcceptPotionQuest
++ ~We don't have the time for this right now.~ EXTERN MGWIKHR MGWikaRefusePotionQuest


IF ~InParty("Wikaede")
See("Wikaede")
!StateCheck("Wikaede",STATE_SLEEPING)
Global("MGWikaHarahQuestStart","GLOBAL",0)
Global("MGWikaHarahRefuseQuest","GLOBAL",1)~ THEN BEGIN MGWikaPotionQuestRefuse
SAY ~You have returned. Are you ready to retrieve the item for us now?~
++ ~Yes, we will get it for you.~ GOTO MGWikaAcceptPotionQuest2
++ ~We don't have the time for this right no, Dawnmistress.~ GOTO MGWikaRefusePotionQuest2
END

CHAIN IF ~~ THEN BEGIN MMGWikaAcceptPotionQuest2
SAY ~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
== MGWIKAJ
~I understand. In that case, I shall be off. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
END
IF ~~ THEN DO ~SetGlobal("MGWikaHarahQuestStart","GLOBAL",1)~
EXIT


IF ~~ THEN BEGIN MGWikaRefusePotionQuest2
SAY ~Very well. Return with Wikaede once you desire to perform this task for us.~
  IF ~~ THEN EXIT
END


IF ~InParty("Wikaede")
See("Wikaede")
!StateCheck("Wikaede",STATE_SLEEPING)
Global("MGWikaHarahQuestStart","GLOBAL",1)~ THEN BEGIN MGWikaPotionQuestWithoutPotion
SAY ~You are back, though I see you do not have the item just yet. Please return once it is in your possession.~
  IF ~~ THEN EXIT
END



APPEND MGWIKHR
CHAIN IF ~~ THEN BEGIN MGWikaAcceptPotionQuest
SAY ~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
== MGWIKAJ
~I understand. In that case, I shall be off. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
END
IF ~~ THEN DO ~SetGlobal("MGWikaHarahQuestStart","GLOBAL",1)~
EXIT

APPEND MGWIKHR
CHAIN IF ~~ THEN BEGIN MGWikaRefusePotionQuest
SAY ~It is fine. There is no rush to perform such a task.~
== MGWIKAJ
~Still, it is a pity. Since we cannot be of further assistance here at this time, I shall depart. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
END
  IF ~~ THEN DO ~SetGlobal("MGWikaHarahRefuseQuest","GLOBAL",1)~
EXIT
END
The Bigg
CHAIN cannot accept the BEGIN (it's not optional like in states, it's actually forbidden) - in place of the BEGIN, you need the dialogue file for the inital speaker. Also, the SAY in the next line is forbidden too. Also, the states (non-chain statements in your file) go before all CHAINs, and CHAINs go outside of APPEND. APPEND (which you don't currently need) requires an END. There was also a typo (MMGWikaAcceptPotionQuest2 with the double initial M).

This appears to work:
CODE
BEGIN MGWIKHR

IF ~!InParty("Wikaede")~ THEN BEGIN MGMeetHarahWithoutWikaede
SAY ~Kind <PRO_SIRLADY>, please excuse me. I am very busy with my chores. If you have any questions, you may ask one of the others.~
IF ~~ THEN EXIT
END

IF ~InParty("Wikaede")
See("Wikaede")
!StateCheck("Wikaede",STATE_SLEEPING)
Global("MGWikaHarahQuestStart","GLOBAL",0)
Global("MGWikaHarahRefuseQuest","GLOBAL",1)~ THEN BEGIN MGWikaPotionQuestRefuse
SAY ~You have returned. Are you ready to retrieve the item for us now?~
++ ~Yes, we will get it for you.~ GOTO MGWikaAcceptPotionQuest2
++ ~We don't have the time for this right no, Dawnmistress.~ GOTO MGWikaRefusePotionQuest2
END

IF ~~ THEN BEGIN MGWikaRefusePotionQuest2
SAY ~Very well. Return with Wikaede once you desire to perform this task for us.~
  IF ~~ THEN EXIT
END


IF ~InParty("Wikaede")
See("Wikaede")
!StateCheck("Wikaede",STATE_SLEEPING)
Global("MGWikaHarahQuestStart","GLOBAL",1)~ THEN BEGIN MGWikaPotionQuestWithoutPotion
SAY ~You are back, though I see you do not have the item just yet. Please return once it is in your possession.~
  IF ~~ THEN EXIT
END

CHAIN IF ~InParty("Wikaede")
See("Wikaede")
!StateCheck("Wikaede",STATE_SLEEPING)
Global("MGWikaHarahQuestStart","GLOBAL",0)~ THEN MGWIKHR MGMeetHarahWithWikaede
~Wikaede... It has been some time. It is good to see you again.~
== MGWIKAJ
~Indeed it has been. I have missed you. Have you been well?~
== MGWIKHR
~Yes, everything has been fine. No need to worry. However, I do have a small task that needs to be completed, which I currently cannot do, due to my schedule.~
== MGWIKAJ
~Which would be...?~
== MGWIKHR
~A gnomish alchemist by the name of Bunyan had been commissioned to create a certain type of potion. We have received word that it is ready, and it needs to be delivered to us. Would you be interested in taking on such a task?~
== MGWIKAJ
~Of course. It is but a small task and shall not harm our greater plans. However, I fear it is not my choice alone. <CHARNAME>, what do you think?~
END
++ ~It shouldn't be a problem, Wikaede. We will get it for you.~ EXTERN MGWIKHR MGWikaAcceptPotionQuest
++ ~We don't have the time for this right now.~ EXTERN MGWIKHR MGWikaRefusePotionQuest



CHAIN IF ~~ THEN MGWIKHR MGWikaAcceptPotionQuest2
~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
== MGWIKAJ
~I understand. In that case, I shall be off. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
END
IF ~~ THEN DO ~SetGlobal("MGWikaHarahQuestStart","GLOBAL",1)~
EXIT


CHAIN IF ~~ THEN MGWIKHR MGWikaAcceptPotionQuest
~Thank you very much. Bunyan can usually be found beside his stand at Waukeen's Promenade.~
== MGWIKAJ
~I understand. In that case, I shall be off. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
END
IF ~~ THEN DO ~SetGlobal("MGWikaHarahQuestStart","GLOBAL",1)~
EXIT

CHAIN IF ~~ THEN MGWIKHR MGWikaRefusePotionQuest
~It is fine. There is no rush to perform such a task.~
== MGWIKAJ
~Still, it is a pity. Since we cannot be of further assistance here at this time, I shall depart. Do take care, would you?~
== MGWIKHR
~Yes. And you as well. Until we meet again.~
END
  IF ~~ THEN DO ~SetGlobal("MGWikaHarahRefuseQuest","GLOBAL",1)~
EXIT

Moongaze
QUOTE(The Bigg @ May 28 2008, 10:15 AM) *
CHAIN cannot accept the BEGIN (it's not optional like in states, it's actually forbidden) - in place of the BEGIN, you need the dialogue file for the inital speaker. Also, the SAY in the next line is forbidden too. Also, the states (non-chain statements in your file) go before all CHAINs, and CHAINs go outside of APPEND. APPEND (which you don't currently need) requires an END. There was also a typo (MMGWikaAcceptPotionQuest2 with the double initial M).


Ah, I had not seen that typo. Thank you. smile.gif
And indeed, I didn't know anything about the commands being forbidden. Apparently it is all more complicated than I had thought.

I just tried it and it installed correctly. happy.gif Now we're getting somewhere. I still need to complete the latter part of the quest. If I get stuck (and I'm sure I will), I'll be back.

Thanks!
The Bigg
QUOTE(Moongaze @ May 28 2008, 10:43 AM) *
And indeed, I didn't know anything about the commands being forbidden. Apparently it is all more complicated than I had thought.

I know - I always have to refer to the WeiDU readme myself when writing D files (because the synthax is so inconsistent, and I almost never write D files). In general, if you haven't, a good idea would be to download Ghareth (from the One Day NPC section at PPG) and use it as an example of how D files are written, and then attempt to compare its code to yours and pick up the differences (teach one man to fish and whatnot).
Moongaze
Yes, I have Ghareth lying around somewhere. I'll do that, see if I can use it as a reference.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.