Différences entre les versions de « Utilisateur:Jupotter/Sandbox »

De Wiwiki
Aller à la navigation Aller à la recherche
Ligne 5 : Ligne 5 :
{{Tutorial Index
{{Tutorial Index
|series=Quest Design Fundamentals
|series=Quest Design Fundamentals
|chapter=2
|chapter=3
|Prev=Bethesda_Tutorial_Planning_the_Quest
|Prev=Bethesda_Tutorial_Creating_an_Actor
|Next=Bethesda_Tutorial_Dialogue
|Next=Bethesda_Tutorial_Creating_an_Item
}}
}}


=Résumé=
=Overview=
Ce chapitre vas vous montrer comment faire des PNJ dans l'éditeur, a la fois civils (qui ne seront pas un challenge de combat) et ennemis.
This chapter will walk you through creating specific dialogue for our tutorial quest, "Bendu Olo's Only Hope."
<br><br>Vous apprendrez:
<br><br>The reader will learn:
*Comment créer des PNJ dans l'éditeur.
* How dialogue for Skyrim is authored in the Creation Kit.
*Comment donner des statistiques de combat basique à un PNJ.
* How to script events based on the player's dialogue choices.  


=Acteurs=
=Dialogue Views=
Dans Skyrim, toute les créatures son un type d'objet spécial appelés Acteur (Actor). Tous les animaux et humanoïdes utilisent cet objet, et c'est ici que son définies l'apparence, le comportement et tout les reste a propos d'un personnage.
Skyrim provides a simple visual layout system so you can see the flow of your dialogue as you're creating it.  


::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
|-
|-
|style="border-style: solid; border-width: 0"|[[Image:CKNewFeature.jpg|48px]]
|style="border-style: solid; border-width: 0"|[[Image:NewFeature.jpg|48px]]
|style="border-style: solid; border-width: 0"|Si vous êtes familier avec Fallout 3 et les moteurs précedents, Créatures et PNJ ont été combinés dans les Acteurs, ce qui vous laisse plus de possibilité pour définir leur comportement.
|style="border-style: solid; border-width: 0"|If you're used to the old-style dialogue creation system from Fallout 3 and earlier, it's still available to you under the [[Player_Dialogue_Tab|Player Dialogue tab]] (and in fact, the views are just a snazzier front-end to that same system).  
|}
|}


Dans la Object Window, naviguez vers Actors -> Actors dans la liste de catégories. Faites un clic-droit n'importe-où dans la liste des acteurs et sélectionnez "New".
To get started with the view, navigate to your quest (GSQ01) and double click to open the quest window. Then navigate to the [[Dialogue_Views_Tab|Dialogue Views tab]]. Your window should now look like this:


=Créer Bendu Olo=
[[Image:EmptyDialogueTab.png|600px]]
Heureusement, beaucoup de champs de la fenêtre d'acteur ([[COnstruction Kit : Actor Window|Actor Window]]) sont assez explicites. Cela dit, il y a un certaine quantité de mise en place a faire pour créer quelqu'un. Allons y.


[[image:CKEmptyActor.png|700px|]]
To make a new view, right-click in the table in the left part of the window and select "New." You'll be prompted to give an ID to this view, and it will automatically have the quest ID ready for you to use as a prefix. Call this view "GSQ01BenduView." Click on it in the table to select it.  


* '''ID:''' Comme avec l'ID de quête, il doit être unique dans tout le jeu. Donnez lui l'ID GSQBenduOlo. (Notez que les ID ne peuvent contenir d'espace ou de caractère spéciaux.)
We haven't added anything to the view yet, so it's a boring white expanse. Right-click in that expanse, and select "Create Branch." That will prompt you to name this branch, which you should call "GSQ01MeetingBenduBranch". One more prompt for naming a topic (you can just accept the default of "GSQ01MeetingBenduBranchTopic"), and on hitting Enter you'll see a series of rectangles that probably don't mean much to you.  
* '''Name:''' Le nom qui sera visible par le joueur. "Bendu Olo" dans notre cas.
* '''Short Name:''' Comment quelqu'un de familier avec notre personnage l’appellerais. Ce nom est utilisé par le système de Radiant Story, auquel nous reviendrons plus tard. Pour le moment, mettons juste "Bendu".
* '''Unique:''' Voici la seul case cochable dont vous devez vous soucier pour le moment. Elle laisse le moteur savoir que il ne doit y avoir que un seul de cet acteur dans le monde (contrairement a un nouveau type d'animal que nous ferions, par exemple). Vérifiez que elle soit bien cochée.


Il y a un certain nombre de choses a faire dans l'onglet des traits ([[Traits tab]]), juste a droite.
[[Image:DialogueStartingBranch.png]]


* '''Race:''' Plutôt explicite, choisis la race de l'acteur. Sélectionnez "DarkEldRace" dans le menu déroulant. Maintenant Bendu aura l'apparence et les bonus raciaux d'un Elfe Noir.
Before we go on, there's some terminology that can be confusing and we need to get straight:
* '''Voice Type:''' Ceci détermine les dialogues génériques et les cris de combat de cet acteur. Choisissez MaleDarkElf.
* '''[[Topic_Info#The_Response_Form|Response]]:''' A single line of dialogue said by an NPC. The text is limited to 150 characters. It can be assigned an emotion and animation for the NPC to play physically while saying it.
* '''[[Topic_Info|Info]]:''' A collection of responses put together for a single circumstance. When a character says multiple lines one after the other, that's a single Info with multiple responses.  
* '''[[Topic]]:''' A collection of infos that an NPC might say in a given situation, often in response to a specific dialogue choice.  
* '''[[Dialogue_Branch|Branch]]:''' A collection of topics that comprise a particular piece of conversation flow from the player's perspective.  


[[Image:CKStartedActor.png|600px]]
So in that set of clicks and typings above, we created a branch, which automatically created a topic for itself. The topic currently contains no infos.
 
[[Image:DialogueStartingBranchLabeled.png|600px]]
 
=Topics=
 
Double-click on the topic to open the Topic Window.
 
[[Image:EmptyTopicWindow.png|450px]]
 
The only thing we need to worry about here is the "Topic Text" field. This will be the prompt that the player will select from a list of dialogue options when talking to an NPC. We're going to set the player up to be a standard helpful adventurer, so fill this in with "Do you need help with anything?"
 
Double-click in the Info table, and we'll be able to write the NPC's response.
 
[[Image:EmptyResponseWindow.png|300px]]
 
In the "Response Text" field, enter: "Why, yes, now that you mention it. Some dirty thief has made off with my amulet. Would you be so kind as to... ahem... fetch it back?"
 
Now hit the OK button at the bottom of the window '''twice'''. The window will disappear and you'll see the Topic Info window.


::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
|-
|-
|style="border-style: solid; border-width: 0"|[[Image:CKInDepth.jpg|48px]]
|style="border-style: solid; border-width: 0"|[[Image:InDepth.jpg|48px]]
|style="border-style: solid; border-width: 0"|Dans la plupart des cas, les personnages ne sont pas préfixés avec un identifiant car ils peuvent êtres utilisés par plusieurs quêtes. Puisque Bendu a peut être un grand futur devant lui, on pourrais juste l'appeler "BenduOlo".
|style="border-style: solid; border-width: 0"|The first time you hit the "OK" button in the response window, the editor runs a simple spell-check on what you just entered. If you copied that precisely, there are no spelling errors, so the first button press won't do anything.
|}
|}


Finalement, rendez vous a l'onglet d'Inventaire ([[Inventory tab]]). Nous allons luis donner quelques vêtements afin que il ne se promène pas en caleçon.
=Topic Infos=
[[Image:TopicInfoWindowStart.png|600px]]
 
There is a lot of data in this window, but most of it is superfluous for our purposes. What we care about is the [[:Category:Conditions|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.
 
[[Image: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.
 
[[Image:ConditionItemFilled.png]]


Ce qu'un acteur choisis de porter est déterminé par leur Tenue ([[Outfit]]). Skyrim possède déjà un certain nombre de tenues définies, mais vous pouvez créer les autre facilement si vous le souhaitez. POur le moment, donnez luis des vêtements simples et un chapeau en choisissant "FarmClothesOutfit01WithHat" dans le menu déroulant Default Outfit.  
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.  


[[Image:CKActorInventory.png|400px]]
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.  


=Placer l'Acteur=
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.  
Pour le moment, nous n'avons fait que créer l'objet de base pour notre acteur;  pour le placer dans le jeu, il fut lui créer une référence.


Nous allons placer Bendu dans un espace préexistant. À la Scierie de Méliflot, il y a une maison où les travailleurs habitaient, mais a depuis été abandonnée. Faisons-en la maison de Bendu!
[[Image:ConditionItemGetStage.png]]


Regardez la fenêtre Cell View. Vérifiez que le menu déroulant a droite de "World Space" est sur "Interiors", puis sélectionnez "MixwaterMillWorkersHouse" dans la liste des cells. Double-cliquez pour la charger.
::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
|-
|style="border-style: solid; border-width: 0"|[[Image:InDepth.jpg|48px]]
|style="border-style: solid; border-width: 0"|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.
|}


[[Image:CKCellViewSelected.png|600px]]
Our final topic info window should look like this:


Dé-zoomez un peu pour voir un peu mieux l'espace.
[[Image:TopicInfoWindowFilled.png|600px]]


[[Image:CKMixwaterInterior.png|500px]]
Hit OK to close the Topic Info window, then OK again in the Topic window to close it.


Ajouter notre bon M. Olo dans la cellule est aussi sumple que attrapper GSQBenduOlo dans la fenêtre d'objets, et le glisser dans la fenêtre de rendu.
=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.  


[[Image:CKMixwaterInteriorPlusBendu.png|500px]]
[[Image:DialogueViewWithStuff.png]]


=Tester l'Acteur en jeu=
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.)


Si vous êtes impatient de rencontrer votre nouvelle création, c'est plutôt simple. Soyez sur que votre plugin est chargé dans les Data Files, et lancez le jeu. Puis, chargez un personnage et ouvrez la console. Entrez y:
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.  


<pre>
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.
COC MixwaterMillWorkersHouse
</pre>


À l'intérieur, vous devriez trouver Bendu se promenant, peut être assis sur une chaise. Il n'a pas encore grands choses a vous dire, puisque nous n'avons pas encore écris de dialogues pour lui, et pas grands choses a faire tant que nous ne luis aurons pas donné d'activité. Mais vous venez de créer un nouveau PNJ, félicitations.
[[Image:BadSoundExport.png|300px]]


[[Image:CKBenduInGame.png|500px]]
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.  


=Créer un Ennemi=
[[Image:GoodSoundExport.png|300px]]


Maintenant, nous allons faire le  voleur qui a pris l'amulette de Bendu. Créez ce nouvel acteur comme vous l'avez fait avant, et donnez lui l'ID "GSQThief" et le nom "Sale Voleur".
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.  


Maintenant, les choses deviennent un peu plus intéressantes. Plutôt que de spécifier le reste des données, nous allons utiliser un template. En bas a gauche de la fenêtre d'Acteur, vous pouvez voir une section "Template Data".
[[Image:MultiTopicBranch.png|450px]]


[[Image:CKActorWindowTemplateArea.png|600px]]
Now the beauty of Dialogue Views is that we can arrange these topics however makes sense for us. At runtime, the game doesn't care all 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.  


Utiliser un template nous permet de baser cet acteur sur un autre. C'est très bien pour tout type d'acteur que vous prévoyez être un combattant, car vous pouvez facilement utiliser les stats et Leveled List déjà existantes, en changeant juste les parties que vous souhaitez.
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.  


Depuis la liste déroulante ActorBase, choisissez donc "LvlBanditMele1H". Ce nom est assez imprononçable, mais peut être facilement décortiqué:
[[Image:UnconnectedDialogue.png|450px]]
* '''Lvl:''' Cet acteur utilise une Leveled List, afin que, lorsque le joueur deviens plus puissant, cet acteur monte aussi en difficulté.
* '''Bandit:''' L'apparence et l'équipement de cet acteur correspondent a l’archétype des bandits dans ce monde, et sera vu comme "Bandit"dans l'interface de combat du joueur.
* '''Melee:''' Cet acteur utilisera des attaques de mêlée plutôt que des attaques a distance ou de la magie.
* '''1H:''' Cet acteur utilisera des armes a une main.


Il y a ici plein de variations et d'aléas. Une fois vous pourriez avoir une Khajiite femelle, un mâle Nord la fois suivante. Utiliser des templates levelé nous permet d'offrir des challenges correspondant au progrès du joueur, ainsi que de la variété.
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.  


[[Image:ConnectedDialogue.png|450px]]


::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
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.
|-
 
|style="border-style: solid; border-width: 0"|[[Image:CKAchtung.png]]
=Scripting Dialogue=
|style="border-style: solid; border-width: 0"|Notez que la plupart des templates lévelés peuvent mener a une multitude de voix, vous devrez donc prendre garde lorsque vous écrivez des dialogue pour une acteur a template. Dans notre cas, il s'agit juste d'un obstacle de quête, il n'y a donc pas a s’inquiéter.
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|Topic Info Fragments]] for more details.)
 
In the End field, enter this script command: <code>GetOwningQuest().SetStage(10)</code>
 
The <code>SetStage(10)</code> portion, as you might expect, sets a quest's current stage to 10. The <code>GetOwningQuest()</code> 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:  
 
[[Image:ScriptedDialogue.png|600px]]
 
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 <code>COC MixwaterMillWorkersHouse</code>.) He should now have something to say to you.
 
[[Image:DialogueInGame.png|500px]]
 
There are a few problems with the dialogue as it currently stands:
# 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.)
# 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. 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. Hit the Save button to commit this file to disk.


Après avoir choisis un template, il faut choisir les aspects que nous voulons utiliser, en cochant les boites appropriées. Cochez les toutes sauf "Use Script" et "Use Base Data".
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.)


[[Image:CKTemplatedActorFilled.png|300px]]
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.)


Nous n'avons pas a nous inquieter de choisis une race, inventaire, équipement ou quoique ce soit, puisque nous prenons tout dans le template.
=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.  


Cliquez sur "OK" pour sauvegarder le voleur.
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.  


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


Il n'y a pas beaucoup de donjons libres dans Skyrim, mais un est disponible, loin dans la Faille. Chargez la cellule "ReachwindEyrie01" et placez la référence a l'objet voleur de la même manière que nous avons placé Bendu dans la cellule de Méliflot.
[[Image:FinishingQuestDialogue.png|600px]]


[[Image:CKTemplatedActorPlaced.png|500px]]
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!


::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
::{|style="border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000; padding: 0"
|-
|-
|style="border-style: solid; border-width: 0"|[[Image:CKInDepth.jpg|48px]]
|style="border-style: solid; border-width: 0"|[[Image:InDepth.jpg|48px]]
|style="border-style: solid; border-width: 0"|Vous renmarquerz que la référence apparait dans l'éditeur comme un ''M'' vert. Comme cet acteur utilise un template, l'éditeur ne sait pas ecore a quoi il ressemble. Il met donc un ''M'' pour des raisons perdues dans les limbes du temps (les théories vont de "monstre" a "marqueur" en passant par "Ninja Monkey"(singe ninja)). Il est vert car le niveau de difficulté de base pour u acteur lévelé est "Facile".
|style="border-style: solid; border-width: 0"|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.  
|}
|}


Si vous voulez rendre visite au méchant que vous avez crée, lancez le jeu avec votre plugin puis...
<pre>
COC ReachwindEyrie01
</pre>
...préparez vous au combat.
[[Image:CKDirtyThiefInGame.png|500px]]


{{Template:Tutorial_Bottom_Bar
{{Template:Tutorial_Bottom_Bar
|Prev=Bethesda_Tutorial_Planning_the_Quest
|Prev=Bethesda_Tutorial_Creating_an_Actor
|Next=Bethesda_Tutorial_Dialogue
|Next=Bethesda_Tutorial_Creating_an_Item
}}
}}

Version du 8 février 2012 à 20:46

Sandbox de Jupotter, utilisé pour faire des traductions Modèle:Tutorial Index

Overview

This chapter will walk you through creating specific dialogue for our tutorial quest, "Bendu Olo's Only Hope."

The reader will learn:

  • How dialogue for Skyrim is authored in the Creation Kit.
  • How to script events based on the player's dialogue choices.

Dialogue Views

Skyrim provides a simple visual layout system so you can see the flow of your dialogue as you're creating it.

48px If you're used to the old-style dialogue creation system from Fallout 3 and earlier, it's still available to you under the Player Dialogue tab (and in fact, the views are just a snazzier front-end to that same system).

To get started with the view, navigate to your quest (GSQ01) and double click to open the quest window. Then navigate to the Dialogue Views tab. Your window should now look like this:

600px

To make a new view, right-click in the table in the left part of the window and select "New." You'll be prompted to give an ID to this view, and it will automatically have the quest ID ready for you to use as a prefix. Call this view "GSQ01BenduView." Click on it in the table to select it.

We haven't added anything to the view yet, so it's a boring white expanse. Right-click in that expanse, and select "Create Branch." That will prompt you to name this branch, which you should call "GSQ01MeetingBenduBranch". One more prompt for naming a topic (you can just accept the default of "GSQ01MeetingBenduBranchTopic"), and on hitting Enter you'll see a series of rectangles that probably don't mean much to you.

Fichier:DialogueStartingBranch.png

Before we go on, there's some terminology that can be confusing and we need to get straight:

  • Response: A single line of dialogue said by an NPC. The text is limited to 150 characters. It can be assigned an emotion and animation for the NPC to play physically while saying it.
  • Info: A collection of responses put together for a single circumstance. When a character says multiple lines one after the other, that's a single Info with multiple responses.
  • Topic: A collection of infos that an NPC might say in a given situation, often in response to a specific dialogue choice.
  • Branch: A collection of topics that comprise a particular piece of conversation flow from the player's perspective.

So in that set of clicks and typings above, we created a branch, which automatically created a topic for itself. The topic currently contains no infos.

600px

Topics

Double-click on the topic to open the Topic Window.

450px

The only thing we need to worry about here is the "Topic Text" field. This will be the prompt that the player will select from a list of dialogue options when talking to an NPC. We're going to set the player up to be a standard helpful adventurer, so fill this in with "Do you need help with anything?"

Double-click in the Info table, and we'll be able to write the NPC's response.

300px

In the "Response Text" field, enter: "Why, yes, now that you mention it. Some dirty thief has made off with my amulet. Would you be so kind as to... ahem... fetch it back?"

Now hit the OK button at the bottom of the window twice. The window will disappear and you'll see the Topic Info window.

48px The first time you hit the "OK" button in the response window, the editor runs a simple spell-check on what you just entered. If you copied that precisely, there are no spelling errors, so the first button press won't do anything.

Topic Infos

600px

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.

Fichier: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.

Fichier: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.

Fichier:ConditionItemGetStage.png

48px 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:

600px

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.

Fichier: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.

300px

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.

300px

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.

450px

Now the beauty of Dialogue Views is that we can arrange these topics however makes sense for us. At runtime, the game doesn't care all 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.

450px

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.

450px

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().SetStage(10)

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:

600px

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.

500px

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. 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. 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.)

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.

600px

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!

48px 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.


Modèle:Tutorial Bottom Bar