Difference between revisions of "How do you set up a scripted conversation between two or more NPCs?"

m
imported>Vagrant0
imported>Vagrant0
Line 111: Line 111:


Similar to above, but a bit less complicated, another way to approach this is to first setup the quest script with just a variable defined. For our purposes, we'll just use the variable (short) ''nuline''. Save that script, and attach it to your quest. Then have all your dialogues created in the order you want them spoken, setting up a condition of who you want to speak them, and adding a condition using the quest variable ''nuline''. Using that variable, make every new dialogue assigned to a new value of this variable eg. first dialogue uses a value of 1, second dialogue uses a value of 2, and so on. Now, you have a clean list of all the dialogues, in order.
Similar to above, but a bit less complicated, another way to approach this is to first setup the quest script with just a variable defined. For our purposes, we'll just use the variable (short) ''nuline''. Save that script, and attach it to your quest. Then have all your dialogues created in the order you want them spoken, setting up a condition of who you want to speak them, and adding a condition using the quest variable ''nuline''. Using that variable, make every new dialogue assigned to a new value of this variable eg. first dialogue uses a value of 1, second dialogue uses a value of 2, and so on. Now, you have a clean list of all the dialogues, in order.
(By creating them in the order they are to be spoken, you can then sort the list of dialogues by form ID to keep them viewed in that order. It also makes it easier, later when you have to figure out what sound files go with what dialogues since they will be sequential)


The way that this method differs from what is mentioned above is that most of the nuts and bolts is in the result script of each dialogue, allowing for finer tuning, and less clutter in the quest script.
The way that this method differs from what is mentioned above is that most of the nuts and bolts is in the result script of each dialogue, allowing for finer tuning, and less clutter in the quest script.
Line 150: Line 151:
'''set <quest>.target to <ref who will be spoken to (0 if none)>'''
'''set <quest>.target to <ref who will be spoken to (0 if none)>'''


If the dialogue is supposed to pause until after an event takes place, you do not need to include these lines, but instead directly call ''<speaker>.sayto <target> <topic>'' within separate scripting when that event is done (such as a quest stage update). During such a time that you don't want any lines spoken, you should set the ''<quest>.speaker'' to 0, and ''<quest>.nuline'' to some value which is not used by any dialogues. You can also use another condition in the quest script to act as a switch to turn on and off the portion that controls calling the next dialogue (the bit mentioned earlier).
If the dialogue is supposed to pause until after an event takes place, you do not need to include these lines, but instead directly call '''''<speaker>.sayto <target> <topic>''''' within separate scripting when that event is done (such as a quest stage update). During such a time that you don't want any lines spoken, you should set the '''''<quest>.speaker''''' to '''0''', and '''''<quest>.nuline''''' to some value which is not used by any dialogues. You can also use another condition in the quest script to act as a switch to turn on and off the portion that controls calling the next dialogue (the bit mentioned earlier).




This method is a bit easier to apply to your standard quest since you can rather easily add additional lines or speakers without having to go back to the quest script to register a new reference, all you have to do is adjust the result script to point to a different speaker, and change the ''nuline'' conditions for dialogues that take place afterward. This method is also a bit easier to understand since it is presented without the context of existing quests.
This method is a bit easier to apply to your standard quest since you can rather easily add additional lines or speakers without having to go back to the quest script to register a new reference, all you have to do is adjust the result script to point to a different speaker, and change the '''''nuline''''' conditions for dialogues that take place afterward. This method is also a bit easier to understand since it is presented without the context of existing quests.




Anonymous user