Require actions before conversation topic appears

ChrisRT
Hi,

I recently downloaded Quest and read the tutorial, and am currently having fun attempting to create my first adventure. I'm hoping for it to be mostly character-driven, with lots of dialogue (branching and otherwise), so I downloaded the ConvLib library to help with that. So far, I've managed to do everything I've needed with it, and it definitely seems useful. :)

One thing I was wondering, though, is whether it's possible to have certain conversation topics only appear on the menu after the player has completed certain actions, or perhaps if they have a certain item, or have fulfilled some other condition. So far, the only condition I can find for topics appearing is if a previous topic has been chosen, which causes a new one to replace it in the menu. (I'd want to do this in the GUI, if possible - I have very little experience with coding, unfortunately. Also, I'm sorry if this has already been posted.)

XanMag
My solution which is VERY GUI heavy (or more accurately code light) is to copy-paste your NPC into a "dead room". Then, add whatever conversation topics you want to that NPC. When your desired event triggers a new topic you want available, move the old NPC out and the new NPC in. Repeat as many times as needed! I know it's a lame solution, but it definitely will work.

A coder will likely come along and give you a more code intensive (and likely simpler) solution. Good luck!

XanMag

The Pixie
XanMag wrote:... When your desired event triggers a new topic you want available, move the old NPC out and the new NPC in. ...

Rather than sawpping the NPCs around, a better way is to move the new topic to the NPC. That way all the old topics are still there, and any attributes that have changed will still be changed.

However, the way I recommend is to run the topic's "show" script. In code it looks like this (for a topic called "new_conv_topic"):
do (new_conv_topic, "show")


If you want to do it through the GUI, look for the script called "Run an object's script attribute". The first drop-down will already be "name". In the second one select your topic, and in the third it should be "name" again. Now type "show" (no quotes, all lower case) in the last box:

Run object [name] [new_conv_topic] script attribute [name] [show]

The advantage of doing it that way is it keeps all the topics for that NPC in one place.

ChrisRT
Thank you very much for the replies - I've been reading these forums for a couple of weeks, and I'm surprised by how helpful the community is.

I actually already have a 'dead room' that I'm using for certain items and characters - I have an NPC who appears at various points in the story, and to make things simpler, I'm using a different character object each time (for now, anyway). It didn't occur to me that I could actually move conversation topics in the same way, though. Thanks for explaining the 'show' script, too - it seems like a neat solution. :)

XanMag
Here. If you can't make sense of The Pixie's help suggestion...

I found an easier way - I've never done this in any of my big games.

  <object name="Converation Room">
<inherit name="editor_room" />
<object name="Iggy">
<inherit name="editor_object" />
<inherit name="namedmale" />
<inherit name="editor_player" />
<feature_player />
<attr name="pov_look">You are Iggy. Iggy is inquisitive.</attr>
<scenery />
</object>
<object name="Queen Quabble">
<inherit name="editor_object" />
<inherit name="namedfemale" />
<look>Queen Quabble is she. Queen Quabble quickly keys in on questions. She like quilts, quinoa, and Quiditch. She does not like quakes, quaffing, or quizzes. Ask her questions.</look>
<speak>"Please ask me questions. Quickly, quickly," she quips.</speak>
<ask type="scriptdictionary">
<item key="quiz quizzes">
msg ("\"Do NOT quiz the Queen!! Quit it!\"")
</item>
<item key="quinoa">
msg ("\"Oooh,\" she grins. \"Quinoa! I love to quench my hunger with quinoa!")
</item>
<item key="quakes quake">
msg ("\"The quakes are dreadful. They quickly contorted my Queen's Castle!\"")
</item>
<item key="quilts">
msg ("\"Ahhh... Quilts are cozy.\"")
</item>
<item key="quaff quaffing">
msg ("\"Oh, those quaffers quick to quack while quaffing. There are enough quackers in the moat. Quaffing is bad!\"")
</item>
<item key="Quiditch quiditch">
msg ("\"Oh, Harry,\" she smiles. \"Quiditch is quite pleasing!\"")
</item>
<item key="quantumphysics quantum physics">
if (GetBoolean(Queen Quabble, "quantum")) {
msg ("\"Oooh! I love Quantum Physics! I squabbled with Professor Quigley about that at Oxford!\"")
}
else {
msg ("\"Do not speak to me of such matters until you have done your research!\"")
}
</item>
<item key="quill quills">
if (GetBoolean(Queen Quabble, "quills")) {
msg ("\"Quills are quite extraordinary! Quick penmanship is crucial!\"")
}
else {
msg ("\"Shut your mouth when speaking to me! Quit, quit!\"")
}
</item>
<item key="qat qats kat kats">
if (GetBoolean(Queen Quabble, "qats")) {
msg ("\"Ah... Qats. Shrubbery local to the Arab and African countries. I like them put would not quaffle the products created from them!\"")
}
else {
msg ("\"No, no, no! Do not speak of those until you have adequately quenched you qat thirst!\"")
}
</item>
</ask>
</object>
<exit alias="north" to="Research Room">
<inherit name="northdirection" />
</exit>
</object>
<object name="Research Room">
<inherit name="editor_room" />
<object name="Green Book">
<inherit name="editor_object" />
<read type="script">
msg ("You pick up the green book and give it a quick read. It's all about quills! You should ask the queen about it!")
SetObjectFlagOn (Queen Quabble, "quills")
</read>
<look type="script">
msg ("You should read it!")
</look>
<takemsg>No. Just read it!</takemsg>
</object>
<object name="Red Book">
<inherit name="editor_object" />
<look type="script">
msg ("You should read it!")
</look>
<takemsg>No. Just read it!</takemsg>
<read type="script">
msg ("You pick up the red book and read it. This book is all about qats. You should ask the Queen about it!")
SetObjectFlagOn (Queen Quabble, "qats")
</read>
</object>
<object name="Blue Book">
<inherit name="editor_object" />
<look type="script">
msg ("You should read it!")
</look>
<takemsg>No. Just read it!</takemsg>
<read type="script">
msg ("You pick up the blue book and read it. It's all about Quantum Physics. You should ask the Queen about it.")
SetObjectFlagOn (Queen Quabble, "quantum")
</read>
</object>
<exit alias="south" to="Converation Room">
<inherit name="southdirection" />
</exit>
</object>


When an event happens that I want to trigger a new conversation topic, I just set a flag on the NPC and named it that topic I want to be able to ask about. Then, I used an 'If' statement for that topic to get the desired response. Again, if you can follow Pixie's advice, do that. If not, use this. It was quite easy. Ask if you have questions.

Good luck.

XanMag

ChrisRT
Thanks again for your response. The Pixie's suggestion did make sense (sorry if my earlier reply was ambiguous - I'm not really used to using forums). Nonetheless, it's nice to have as many different options as possible, so thanks for the sample code you posted. It's useful to have an example to work from, and quizzing the queen on various topics made me smile. :D

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums