Difference between revisions of "Tutorial: Dialogue Speech Checks"
imported>Flatmop (created tutorial) |
imported>RobinHood70 m (Wording fix) |
||
Line 4: | Line 4: | ||
==Speech Checks== | ==Speech Checks== | ||
Sometimes in Skyrim, there are NPCs who offer the player some kind of reward or quest shortcut if | Sometimes in Skyrim, there are NPCs who offer the player some kind of reward or quest shortcut if you have a high enough Speechcraft skill (or money, in the case of a bribe). You knew that already. But how do we go about implementing this using the Creation Kit's dialogue system? Let's find out. | ||
==Before you Begin== | ==Before you Begin== |
Revision as of 17:20, 21 December 2014
Speech Checks
Sometimes in Skyrim, there are NPCs who offer the player some kind of reward or quest shortcut if you have a high enough Speechcraft skill (or money, in the case of a bribe). You knew that already. But how do we go about implementing this using the Creation Kit's dialogue system? Let's find out.
Before you Begin
This tutorial assumes that you're already confidant with adding dialogue to a quest using the views frontend, and that you have some experience with Papyrus fragments.
Persuasion option
The first step is to add your persuasion topic to the branch. Obviously, you need to put the player character's attempt to persuade the NPC in your topic text field. The conventional format in Skyrim is "Hello World! (Persuade)". Spell check will make sure you don't manage to spell 'persuade' wrong.
Now we need to add a minimum Speechcraft requirement that the player has to pass. To do this, we use conditions. So along with all the other conditions your 'positive response' info might have, add a new condition item with the function GetActorValue, the paramter here being Speechcraft. Of course, this function needs to run on the player. The comparison should be greater-than-or-equal-to (>=), and the value can be whatever you want, but for completeness it's best if you just choose one of the predetermined constant variables (SpeechVeryEasy, SpeechEasy etc). To select one of these, you need to have checked the Use Global box. You don't need to add an opposite condition to the 'negative response'.
That's all very well, but you still need to add a Papyrus fragment to make it a proper speech check that helps level up the Speech skill on a success and such. Type a comment into the begin box and hit compile to generate a script. Now add a property called something like 'pFDS' (that's short for Favor Dialogue Script). For the type, don't choose anything from the drop down menu, but instead type into the box 'FavorDialogueScript'. Leave the value blank, and hit Ok. If you did this right, you can now change the value to only one value called 'DialogueFavorGeneric' (that's the right one).
Finally, add this code to the begin fragment box:
pFDS.Persuade(akSpeaker)
Compile it and you're done. Fire up Skyrim, find you NPC (I only used Kleppr, the inkeeper at the Silver Blood Inn because I couldn't be bothered to create a new NPC) and test the speech check. You'll have to change your speechcraft skill around for this;
player.setav speechcraft n
Intimidate option
Intimidations are created in exactly the same way as a persuasion, save for that you need to change the fragment code slightly to the following:
pFDS.Intimidate(akSpeaker)
They too use the speechcraft skill. The only real difference lies in the superficial role-playing aspects. Just don't forget to add the suffix '(Intimidate)' to any intimidation topic texts in your plugin.
Bribe option
Bribery works in a slightly different way. You still need to add a pFDS property to the Papyrus fragment as described above, but this time, the begin box contains this code:
pFDS.Bribe(akSpeaker)
Along with any other conditions on the NPCs positive response, you need to run the function GetBribeSuccess on the subject, checking that it returns true. You also need to add '(<BribeCost> gold)' to the end of the topic text so that the player knows how much they have to pay.
You don't need to specify an amount of gold for the bribe, as the favor dialogue script will calculate a levelled amount and handle its removal from the player's inventory. If you want to have a specific bribe amount, or want to have options for the player to be a cheapskate and not offer enough gold, its best to do this other ways without favor dialogue.