Bethesda Tutorial Dialogue/ru

From the CreationKit Wiki
Revision as of 09:33, 8 April 2012 by imported>Vitamant (→‎Topics)
Jump to navigation Jump to search

Диалоги




RoundRussianFlag.pngНа русском языке
Требуется помощь переводчика


Диалоги
Серия: Основы квестописания, глава 3
К другим учебникам
LeftArrow.png Предыдущая статья Следующая статьяRightArrow.png


Обзор

В этой главе мы будем создавать диалоги к тренировочному квесту "Единственная надежда Бенду Оло".

Ты узнаешь:

  • Как писать диалоги для Skyrim в Creation Kit.
  • Как привязать события к выбранным игроком пунктам диалога.

Представления диалогов

Creation Kit визуализирует весь процесс создания диалога, предоставляя удобный интерфейс взаимодействия.

NewFeature.jpg Если ты писал диалоги для предыдущих игр серии TES или Fallout 3, то можешь воспользоваться родной вкладкой Player Dialogue (en) (на самом деле, система диалогов осталась прежней, просто прячется за новым интерфейсом).

Для начала, дважды щелкни по своему заданию (в нашем случае GSQ01), чтобы открыть окно квеста. Перейди на вкладку Dialogue Views (en). Выглядеть это должно как-то так:

EmptyDialogueTab.png

Чтобы создать новый диалог, щелкни ПКМ по таблице в левой части окна и выбери пункт "New." Тебе предложат указать ему ID, а ID квеста будет автоматически использован в качестве префикса. Дай ему имя: "GSQ01BenduView." Щелчком в таблице выбери его.

Справа ты видишь белый девственно чистый холст без единого намека на что-нибудь интересное. ПКМ по нему и выбирай "Create Branch" из меню. Да-да, и снова тебе нужно указать ID, на этот раз ветви диалога. Называй: "GSQ01MeetingBenduBranch"... и еще один ID для темы (впрочем, тут можешь оставить вариант по-умолчанию "GSQ01MeetingBenduBranchTopic"). Еще одно нажатие на Enter и пред тобой несколько прямоугольников мерзкого цвета, которые, наверняка, тебе ни о чем не говорят.

DialogueStartingBranch.png

Перед тем как продолжить, давай разберемся с терминами:

  • Ветвь (en): Набор связанных по смыслу тем.
  • Тема (en): Выбираемая игроком тема диалога, на которую последует монолог персонажа.
  • Монолог (en): Набор произносимых подряд фраз.
  • Topic_Info/ru#The_Response_Form|Фраза: Одна строка монолога, произносимая NPC. Длина строки ограничена 150 символами. С ответом могут быть связаны эмоции и анимации, проигрываемые говорящим.


Итого ты создал ветвь диалога, содержащую одну тему, которая пока что не содержит монолога персонажа.

DialogueStartingBranchLabeled.png

Темы

Двойной ЛКМ по теме (рыжей полоске над серым пространством) откроет окно темы (en).

EmptyTopicWindow.png

Пока тебя интересует только поле "Topic Text". Его содержимое будет выведено игроку в качестве варианта диалога во время разговора с персонажем. Делаем из игрока стандартного героя-дурачка, готового помогать всем и каждому. Пишем: "Тебе чем-нибудь помочь?"

Achtung.png Как только поле ввода потеряет фокус, может выскочить окошко Check Spelling. Не пугайся. Это всего лишь окно проверки орфографии, которое не знает русских слов и будет постоянно тебя донимать. Возможно, проверку можно как-нибудь отключить - не знаю. Но лучше всего взять ее на вооружение и потратить некоторое время на составление словаря, чтобы в последствии не допускать ошибок. Щелкай по кнопке Dictionaries, затем New dictionary, сохрани новый словарь под понятным тебе именем, затем вернись к окну Check Spelling выбери его в выпадающем списке в нижней части окна и нажми кнопку "Add" для добавления слова в словрь, Ignore для пропуска или исправь слово и нажми Change, если умудрился допустить ошибку.

Ниже расположена таблица монолога. Дважды щелкни по ней, чтобы создать новую фразу.

EmptyResponseWindow.png

В поле "Response Text" введи: "Странно, что вы спросили... Как раз недавно один грязный ворюга утащил мой амулет! Не могли бы вы... ммм... вернуть его?"

Теперь дважды щелкни по кнопке ОК внизу окна. Надеюсь, ты это сделал достаточно быстро и не успел заметить еще одно окошко с кучей настроек. В нем тебе еще предстоит разобраться, но все по порядку. Окно исчезло и ты вновь видишь окно темы, в котором появилась одна строчка монолога.

Topic Infos

TopicInfoWindowStart.png

There is a lot of data in this window, but most of it is superfluous for our purposes. What we care about is the Conditions table in the middle. This is where we narrow down who is capable of saying this info. If we just hit "OK" from here and left the conditions blank, every NPC in the world would now have a dialogue topic saying "Do you need help with anything?"

Right-click in the Conditions list and select "New" to make our first condition for this info.

ConditionItem.png

Each condition is an independent check that is definitively True or False. If all of the conditions in the list are valid, then this Info will be valid. Our first condition will simply limit who is able to say this line. "GetIsID" is selected by default, because it's so commonly used for dialogue conditions. Click on the button in the middle that currently says "INVALID" so we can choose the appropriate actor. Select "GSQBenduOlo" from the pull-down menu and hit OK.

ConditionItemFilled.png

Hit OK on the condition window to close it out, and you should then see it in the list. Now only Bendu can say it, but we don't want him saying it all the time; just before he's given the quest to the player. So we're going to add one more condition. Right-click in the condition list and select "New" again.

We're going to further limit this bit of dialogue based on the quests current stage. So click on the Condition Function pull-down and select "GetStage." (You can type the first few letters to skip around in the list -- much faster than scrolling.) Now if you click the "INVALID" button to select parameters, it will bring up a list of quests rather than base objects (since it knows that the GetStage condition only deals with quests). Select "GSQ01" from the menu and hit OK.

Now all that's left is to tell the condition which quest stage we care about. Since we know the quest is starting at stage 0, we could select "==" for our comparison and set the value to "0," but that might break this condition if we ended up adding some stage before this one. The safer way to set the condition is to check that our current stage is lower than 10, so choose "<" from the Comparison list and put "10" in the value field.

ConditionItemGetStage.png

InDepth.jpg Note that you can reorder conditions with the left and right arrow keys or the buttons at the bottom left of the condition window. In this example the order doesn't matter, but if you started setting up your conditions with ORs as well as ANDs, it would.

Our final topic info window should look like this:

TopicInfoWindowFilled.png

Hit OK to close the Topic Info window, then OK again in the Topic window to close it.

Linking Dialogue

Finally, we're back at the Dialogue View! With our new bit of dialogue present. If you want to actually see all the text (and why wouldn't you?), click the "Show All Text" checkbox at the bottom of the view.

DialogueViewWithStuff.png

Since Bendu is posing a question with his line, we want to give the player a chance to answer. Right-click in the branch area and select "Add Topic." (If you don't see that in the contextual menu, you probably did not click in the branch.)

This will open up another topic window. You'll have to assign an ID to this one; "GSQ01MeetingBenduYes" works, since this will be our choice where the player agrees to help. Put "Sure, I can do that." as the topic text, and double click in the info table to make a response. For the text, enter "Oh, thank you so much. It's been taken to Reachwind Eyrie. Please hurry! I'll give you twice what it's worth!" This time when you hit OK the spell-check will complain about "Reachwind." Just hit the Ignore button to dismiss it, hit OK one more time, and you're back to the Topic Info window.

Now that you're here, double click on the response text again to bring it back up. Notice the list of sound files at the bottom of this window.

BadSoundExport.png

Since we haven't put any conditions on this dialogue, the game still thinks everyone in the world can say it, and will try to make appropriate sound files for every voice type. This is a big waste of disk space and (if you're planning to record voice) a waste of time recording unnecessary performances. So close this window and add a GetIsID condition looking for GSQBenduOlo (like we did in the previous topic info). Now if you look at the response again, you'll see that it knows that this line is only said by a MaleDarkElf voicetype, and so only lists the one file.

GoodSoundExport.png

Now hit OK on the Topic Info window and the Topic window until you're back looking at the dialogue view again. You'll have a new topic floating in your branch, which has expanded to accommodate it.

MultiTopicBranch.png

The beauty of Dialogue Views is that we can arrange these topics however makes sense for us. At runtime, the game doesn't care about this positioning; it's purely for the designer's convenience. So grab the new topic by its top bar and drag it to a convenient spot.

Make one more topic, this time with a Topic Text of "Sorry, not right now." Set Bendu's response to be "Well, fine then." Don't forget to put a GetIsID condition on the Topic Info. Once you've created those two, the Dialogue View should look something like this.

UnconnectedDialogue.png

All these topics exist within the branch, but the game doesn't know anything about the flow between them. We have to link them together. Click on GSQ01MeetingBenduBranchTopic to make it active. Then click once more on the text of the line (you'll see the cursor turn into a little hand when you roll over it) and drag a line to the GSQ01MeetingBenduYes. Do the same thing, dragging a line from the initial topic to the GSQ01MeetingBenduNo topic.

ConnectedDialogue.png

Now, when the player selects the prompt "Do you need help with anything?", Bendu will say his line and then present the player with another list of choices based on the links from that topic. The choices will be listed in the order they were linked from that topic.

Scripting Dialogue

We're going to make our first foray into the scripting system here, but it will be very straightforward, so don't worry if that's not your cup of tea.

Right now we have a dialogue flow set up, but the game has no notion of what the various choices mean. When the player says, "Yes," we have to tell it that the player has accepted the quest and we're now at the next stage.

Double-click on the text "Oh, thank you..." under the GSQ01MeetingBenduYes topic. (Note that this brings us directly to the Info window without first bringing up the Topic window.)

At the bottom of this window, you see fields for Scripts marked "Begin" and "End." The Begin script runs when the NPC starts saying the line, and the End script will run when he finishes. (In scripting terminology, these little pieces of script are called "script fragments" - see Topic Info Fragments for more details.)

In the End field, enter this script command:
GetOwningQuest().SetObjectiveDisplayed(10)
GetOwningQuest().SetStage(10)

You don't need to worry about the SetObjectiveDisplyed(10) part yet. It will be explained later on.

The SetStage(10) portion, as you might expect, sets a quest's current stage to 10. The GetOwningQuest() part just says that the quest we care about is the one that contains this dialogue. (Sometimes you might want a line in your quest to muck around in a different quest, so we have to be specific.)

If you press "Compile" you'll see some gobbledygook pop up under "Script Name" to the right. You can ignore that. (If you typed something wrong, though, the Editor will complain at you.)

When you're ready to close the window, it should look like this:

ScriptedDialogue.png

And that's it! Close the window, and you're good to go. You'll note that in the dialogue view, this info's text now has "[S]" at the front of it, so we can easily spot which bits of dialogue have game logic attached to them without having to open each one.

Branches and Conditions

What we've just done is craft a Branch of dialogue. By default it's a "Top-Level" branch (which is why it's colored orange in the view). You don't need to worry about the other branch types right now; just know that a top-level branch is available as one of the first things an actor is able to say to the player.

The topic that has a yellow-orange bar at the top of it has been flagged as the branch's Starting Topic. When an actor is determining what choices to offer the player, it looks for starting topics and displays the prompts for all of them which are valid. If you remember, we put a condition on our starting topic that the quest stage had to be less than 10. Once the player chooses to accept the quest, we set the quest stage to 10, which means that starting topic is no longer valid; it won't appear in the actor's topic list anymore.

Non-starting topics can have much smaller lists of conditions, since they are typically only accessed if the starting topic for their branch is valid. That's why we just limited them to a specific NPC so we wouldn't have extra voice files. From a gameplay perspective, it wouldn't have mattered.

Once the player chooses a topic with no links out of it, the game will again look for valid top-level topics to give the player choices. If none are valid, the NPC will release the player from dialogue.

Try It Out

Load the game with your plugin and go meet Bendu. (Remember, you can hop right there with COC MixwaterMillWorkersHouse.) He should now have something to say to you.

DialogueInGame.png

There are a few problems with the dialogue as it currently stands:

  1. It flashes directly to the next choice list. (Since there's no audio, if you don't have captions on, you won't have any idea what he said. Even if you do, they probably flashed by so quickly you couldn't read.)
  2. If you refuse to help, he'll just go right back to the same top level topic, which feels odd.

Luckily these are easily addressed.

Recording a Temp Track

Open up the GSQ01MeetingBenduBranchTopic and navigate through to its Response window. At the bottom of the window, you'll see a "Record" button.

RecordButton.jpg

Press this button and, if you have a microphone hooked up to your computer, you can record a performance of the line yourself. If you don't (or you're self-conscious and don't like the sound of your own voice) you can just record a few seconds of silence, enough to give the captions time to be read. (Note: you MUST have a microphone to record anything. If no microphone was plugged in at the time you started the Creation Kit, the record button will not do anything) Hit the Save button to commit this file to disk.

Do the same thing for the other two topics we made. (While you're in there, consider setting the emotions for those lines, so that Bendu will show Disgust or Happiness depending on your choice.)

In the "No" topic, click the box that says "Goodbye." This will drop the player out of dialogue when it's selected, so you won't end up back at the topic list after the line is done. (You should also make the "Yes" topic a goodbye. Since Bendu only has one top-level topic right now, that's not necessary, because we know he'll have nothing else to say when he's done here. But if another quest had dialogue for him, it might be confusing to the player.)


Protip.jpg Currently there is a rare bug: if you already got audio files (with correct file paths, (read table in "Edit Response" window)), but it does not work inside the Skyrim game (does not matter in Creation Kit, test just in the game itself), then you need to convert sound files from WAV to XWM, then XWM to FUZ, for more info and converter links visit http://forums.bethsoft.com/topic/1347417-dialogue-troubles/page__p__20346206#entry20346206

For some people it is the only way to make recorded tracks working in game.

Additional Dialogue

While we're here, let's also make the dialogue that will close out the quest when we come back with the amulet.

In the dialogue view, right-click to create a new branch, and call it "GSQ01BenduFinishBranch." Accept the default name for the starting topic, and make the topic text, "I've brought your amulet." Give him something good as a response (I went with "I hope you gave that thief a good thrashing!"). It will want two conditions; one that restricts it to Bendu, and another that limits it to stage 30 of the quest. Finally, set it to be a Goodbye, and set the quest to stage 40 when it's said.

You should be able to do all this by now. It will look like this when you're done.

FinishingQuestDialogue.png

We still haven't dealt with the amulet itself yet, and the quest has no way to proceed from stage 10 to 30, so we have work to do!

InDepth.jpg This might seem like a lot of work and unnecessary data-fumbling to just get characters to say a few lines. Part of the complexity is historical -- because it evolved from the old Morrowind text-based dialogue system, the organization can seem a little sideways and non-directed. But the same system also handles multiple characters saying the same line, combat barks, player greetings, hit responses, etc. Flexibility sometimes means complexity.

With some practice, all of this becomes second nature, and you'll be able to mechanically work the dialogue system as fast as you can write the lines themselves.


LeftArrow.png Предыдущая статья К другим учебникам Следующая статья RightArrow.png



Language: English  • français • polski • русский