Alternative conversations

The Pixie
I was wondering whether an Elder Scrolls approach to conversation could be done in Quest 5. What I would envisage from a player point of view is that you "talk to npc" to start the conversation. A list of available topics would then appear in their own pane on the right, whiuch the player can click on, or she can type "ask about <subject>".

Alternatively, this could be done with "ask <npc> about <subject>".

For the writer, I am thinking this would be handled as a list of objects (one list for all NPCs). The system runs though the list looking for a match, and presents the first object that matches the situation. If the object has a name, then that must match the name of the NPC. If the object has a pattern, then that must match the subject. You could also match attributes on the player as desired.

Conversation objects would be arranged with more specific ones at the top (this topic, this NPC, these attributes set), less specific towards the bottom (this topic, but NPC not speficied; this NPC, but any topic), to a generic "I don't know" at the bottom of the list to catch anything unspecified.

I am wondering if this is doable in the current version. Have a dummy room that contains a bunch of objects that are conversation objects. Use a scope function to collect them into a list (does that preserve order?). Create my own ask-about command to iterate through them.

Is there a way to collect the names of attributes on an object? If not, you may need to put a script on the object; check the npc name if it has a name attribute, check the subject pattern, run the script and check the result (can a script return a result?).

If the game had to run through the list every time the player asks a question, and there are hundreds of conversation objects, would this be slow?

An advantage to this is that several NPCs can have the same response to questions that do not concern them. Or the first one asked can give a full response, but all subsequent questions get the generic response. You can have responses generic to a gender or some other grouping, say a member of the secret cult, but checking for the cult_member attribute on the NPC.

The actual conversation would also be a script that can access both object1 (the npc) and object2 (the subject).

Pertex
Could you post a simple example? I don't understand why you want to use objects and attributes in the script.

The Pixie
NPCs

Adam
Boris (cult_member = true)
Claire (cult_member = true)
etc.


Conversation Objects

"Yeah I heard something about a cult. You might want to talk to Boris."
name = "Adam", pattern = "cult"

"Sure, there is a secret cult. If you want to join, you have to do the initiation"
pattern = "cult", script = (is cult_member = true ?)

"I know nothing about a cult"
pattern = "cult"

"It's awful weather, isn't it?"
pattern = "weather"

"I don't know about that
-


The player types "ask Boris about cult", and the game goes through the list. The fitrst fails, that is for Adam, but the second is accepted, because "cult" matches and the script returns true.

The player types "ask Claire about the weather", and the game goes through the list. The first three fail, because the pattern does not match. The fourth is accepted, because "weather" matches and there is nothing else to check.

Does that make sense?

Pertex
Hmmm, I think I would do this with a function something like this:

<function name="testinput" parameters="actor, pattern ">
if (pattern ="CULT") {
if (actor.name="Adam") {
msg(""Yeah I heard something about a cult. You might want to talk to Boris."")
} else if (actor.cult_member) {
msg(""Sure, there is a secret cult. If you want to join, you have to do the initiation"")
} else {
msg(""I know nothing about a cult"")
}
} else if (pattern="WEATHER") {
msg(""It's awful weather, isn't it?"")
} else {
msg("I don't know about that")
}
<function>


It should be the same you want to do

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

Support

Forums