Difference between revisions of "Quest and Dialogue Tutorial"

1,037 bytes added ,  11:34, 12 November 2012
m
imported>Entom
imported>Oblq
 
(15 intermediate revisions by 5 users not shown)
Line 3: Line 3:


== Prelude ==
== Prelude ==
Quests are everywhere in the game. Some are the "real" ones, full of dialogues, stages, objectives etc. - these are common quests, that Player accomplish while playing the game. Some quests however can be hidden to Player, and used only to run scripts to check something or set some events. They are also used for dialogues between Player and NPC, as well as between two or more NPCs or even monologues.  
Quests are everywhere in the game. Some are the "real" ones, full of dialogues, stages, objectives etc. - these are common quests, that Player accomplish while playing the game. Some quests however can be hidden to Player, and used only to run scripts to check something or set some events. They are also used for dialogues between Player and NPC, as well as between two or more NPCs or even monologues, ot even as a radio stations.




Line 14: Line 14:
* implementation of a dialogue.
* implementation of a dialogue.


There is only one requirement – you must be familiar with GECK environment. If you do or if you went through "My First Vault" tutorial, then we can start.
There is only one requirement – you must be familiar with GECK environment. If you do or if you went through [[:Category:Getting_Started#My_First_Vault_Tutorial_Series|My First Vault tutorial]], then we can start.




Line 29: Line 29:
'''NPC:''' ''Can I ask you a question?''
'''NPC:''' ''Can I ask you a question?''
</ul>
</ul>


Standard greeting, only for first dialog between Amanda and Player. As you can see, I am already using topic IDs, that will be assigned to topics in the GECK. For this topic there is only NPC response.
Standard greeting, only for first dialog between Amanda and Player. As you can see, I am already using topic IDs, that will be assigned to topics in the GECK. For this topic there is only NPC response.
Line 37: Line 36:
'''NPC:''' ''Could you find my teddy bear please?''<br>
'''NPC:''' ''Could you find my teddy bear please?''<br>
''I lost him while I was escaping with my mother, in Springvale School.''<br>
''I lost him while I was escaping with my mother, in Springvale School.''<br>
''He was my friend... Find him please...'' (Continue with PC choice, 3a-3e)
''He was my friend... Find him please...'' (Continue with PC choice, 3.1-3.5)
</ul>
</ul>


 
This is PC choice dialog and NPC response, also only for the first dialog between Amanda and Player. It will be followed by PC choices from 3.1 to 3.5, according to different conditions. This topic should be said only once in the game.
This is PC choice dialog and NPC response, also only for first dialog between Amanda and Player. It will be followed by PC choices from 3.1 to 3.5, according to different conditions. This topic should be said only once in the game.


<ul><li>'''3.1 aBHTopicAgreeWithChallenge'''<br>
<ul><li>'''3.1 aBHTopicAgreeWithChallenge'''<br>
Line 49: Line 47:
</ul>
</ul>


 
This choice will show up in the dialog menu only if Player has a children perk, actually – the ChildAtHeart perk. I want it also to be a challenge topic, with average difficulty. In case of failure it will need a special topic, but we will take care of it later on.
This choice will show up in the dialog menu only if Player has a children perk, actually – the ChildAtHeart perk. I want it also to be a challenge topic, with average difficulty. In case of failure I will need a special topic, but we will take care of it later on.


<ul><li>'''3.2 aBHTopicAgree'''<br>
<ul><li>'''3.2 aBHTopicAgree'''<br>
Line 68: Line 65:
</ul>
</ul>


 
The 3.4 choice will be available if Player already has a teddy bear for Amanda, before speaking with her for the first time.
The 3d choice will be available if Player already has a teddy bear for Amanda, before speaking with her for the first time.


<ul><li>'''3.5 aBHTopicByeBye'''<br>
<ul><li>'''3.5 aBHTopicByeBye'''<br>
Line 79: Line 75:
All set up. So how it will look like in the game, when Player begins first talk with Amanda? First Amanda will say the #1 topic, the GREETING:
All set up. So how it will look like in the game, when Player begins first talk with Amanda? First Amanda will say the #1 topic, the GREETING:


*''Can you help me?''
*NPC says: ''Can you help me?''


We will talk about greetings and goodbyes later; for now lets simulate the dialog. After the greeting from Amanda, the dialog menu will open. This is the first talk between Amanda and Player, so Player will have only one choice of a dialog, topic #2:


We will talk about greetings and goodbyes later; for now lets simulate the dialog. After the greeting from Amanda, the dialog menu will open. This is first talk between Amanda and Player, so Player will have only one choice of a dialog, topic #2:
* Player says: ''Hello young lady. What can I do for you?''
 
*''Hello young lady. What can I do for you?''
 


After Player clicks on this topic in the dialog menu, he or she will get a NPC response:
After Player clicks on this topic in the dialog menu, he or she will get a NPC response:


*''Could you find my teddy bear please?''
*NPC says: ''Could you find my teddy bear please?''
*''I lost him while I was escaping with my mother, in Springvale School.''
*NPC continues: ''I lost him while I was escaping with my mother, in Springvale School.''
*''He was my friend... Find him please...''
*NPC continues: ''He was my friend... Find him please...''
 


After this there will a couple of topics, #3.1 - #3.5, according to different conditions. Assuming this is the first talk and player do not have a teddy bear yet, then available choices will be all #3, excluding #3.4.  
After this there will a couple of topics, #3.1 - #3.5, according to different conditions. Assuming this is the first talk and player do not have a teddy bear yet, then available choices will be all #3, excluding #3.4.  
Line 177: Line 170:


That’s all for AI. In [[Inventory Tab|inventory]] I found RDGateKey – delete it. KIDOutfitWastelandChild04 is a standard suit for children, so I leave it. Other tabs in NPC properties I leave untouched. However, if you wish, you can play with Amanda's appearance (go [[:Category:NPC|here]] for more info about NPC).
That’s all for AI. In [[Inventory Tab|inventory]] I found RDGateKey – delete it. KIDOutfitWastelandChild04 is a standard suit for children, so I leave it. Other tabs in NPC properties I leave untouched. However, if you wish, you can play with Amanda's appearance (go [[:Category:NPC|here]] for more info about NPC).


=== Teddy Bear – quest item ===
=== Teddy Bear – quest item ===
Line 189: Line 183:




After this modifications I click on the OK button. Editor asks if I want to create a new form – yes, this is what I want, so my answer is Yes.
After these modifications I click on the OK button. Editor asks if I want to create a new form – yes, this is what I want, so my answer is Yes.


This object is flagged as a [[Quest Item]], and if Player takes it, he/she will not be able to remove it from the inventory. That is why quest objects usually have a Weight of 0.0000. Teddy Bear will be removed by result script, that we will set up at the end of tutorial.
This object is flagged as a [[Quest Item]], and if Player takes it, he/she will not be able to remove it from the inventory. That is why quest objects usually have a Weight of 0.0000. Teddy Bear will be removed by result script, that we will set up at the end of tutorial.


=== Adding objects to the world cells ===
=== Adding objects to the world cells ===
Line 211: Line 206:


I think everything is ready to start a quest building now.
I think everything is ready to start a quest building now.


== New quest ==
== New quest ==
Line 222: Line 219:
*'''ID:''' aBHQuest
*'''ID:''' aBHQuest
*'''Priority:''' 55
*'''Priority:''' 55
*'''Start game enabled:''' Yes (I check the box)
*'''Start game enabled:''' Yes (tick the checkbox)
*'''Script processing delay:''' Yes (default)
*'''Script processing delay:''' Default (tick the checkbox)
 
<blockquote><center>
 
'''Important!''' After filling in those fields, click on the OK button in the bottom right side of the Quest Window. This will save the quest data. Then you can open the quest window again and proceed with quest creation.
After filling in these field, click on the OK button in bottom right side of the Quest Window. This will save the quest data.
</center></blockquote>
 
'''Quest Name''' is what Player will see in the quest journal, on the list of quests.
'''Quest Name''' is what Player will see in the quest journal, on the list of quests.


'''Priority''' of 55 is between Miscellaneous (50) and Main quest (60), so it should be enough to start in the game. Actually in this case it is not important what value of the priority I will put, because I am creating an autonomic, totally custom quest. However, to be sure it will show up in the game, I enter the priority of 55.
'''Priority''' of 55 is between Miscellaneous (50) and Main (60) quests, so it should be enough to start in the game. Actually in this case it is not important what value of the priority I will put, because I am creating an autonomic, totally custom quest. However, to be sure it will show up in the game, I enter the priority of 55.


If a quest is '''Start game enabled''', then it is active right from the start of the game, new game or loaded savegame that don't contain data of my custom plugin. Active or Enabled means, that all conditions from scripts or conditions' fields, related to this quest, are processed by the game. So if there are many conditions or scripts that use many arithmetic functions in conditions, it is better to find some way and do not enable a quest from the game start, and leave this field blank and activate a quest with [[StartQuest]], [[SetStage]] or [[SetObjectiveDisplayed]] script functions.
If a quest is '''Start game enabled''', then it is active right from the start of the game, new game or loaded savegame that doesn't contain any data of my custom plugin. Active or Enabled means, that all conditions from scripts or conditions' fields, related to this quest, are processed by the game. So if there are many conditions or scripts that use many arithmetic functions in conditions, it is better to find some other way and do not enable a quest from the game start, leave this field blank and activate the quest with [[StartQuest]], [[SetStage]] or [[SetObjectiveDisplayed]] script functions.


With '''Script processing delay''' box checked the quest scripts processing, by default, will be delayed by 5 seconds of the real time.
With '''Script processing delay''' box checked the quest scripts processing, by default, will be delayed by 5 seconds of the real time.


<blockquote><center>
More information about quest data tab can be found [[Quest_Data_Tab|here]].
</center></blockquote>




Line 242: Line 241:
I have prepared the following list of [[Quest Objectives Tab|quest objectives]]:
I have prepared the following list of [[Quest Objectives Tab|quest objectives]]:


{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
| align="center" style="background:#f0f0f0;"|'''Index'''
| align="center" style="background:#f0f0f0;"|'''Index'''
| align="center" style="background:#f0f0f0;"|'''Display text'''
| align="center" style="background:#f0f0f0;"|'''Display text'''
Line 248: Line 247:
| 0||
| 0||
|-
|-
| 5||I have found strange teddy bear. I should keep it, maybe it would be useful in the future.
| 5||I have found a very strange teddy bear. I should keep it, maybe it would be useful in the future.
|-
|-
| 10||Go to Springvale School and search for Amanda's toy.
| 10||Go to Springvale School and search for Amanda's toy.
Line 262: Line 261:




You can add to your quest something similar, it you wish. It is performed by right click on the list of objectives and choosing New. I set up quest index in the Index field and enter text in the Display Text field. Maybe index #0 is not necessary, but many vanilla quests have it, so I am using it too.
You can add to your quest something similar, if you wish. It is performed by right clicking on the list of objectives and choosing New. Set up quest index in the '''Index''' field and enter text in the '''Display Text''' field. Maybe index #0 is not necessary, but many vanilla quests have it, so I am using it too.
 


While creating a new quest remember to use indices x10, i.e. 10, 20, 30 etc. Why? Because later it may arise a problem, when it would be necessary to add some new quest objectives between the existing ones. Take a look at my list again – did you noticed, that there is no #40 between #30 and #50? Well, it was, but I moved it to index #5. And I was able to do it, because I started with index #10.
While creating a new quest remember to use indices x10, i.e. 10, 20, 30 etc. Why? Because later it may arise a problem, when it would be necessary to add some new quest objectives between the existing ones. Take a look at my list again – did you noticed, that there is no #40 between #30 and #50? Well, it was, but I moved it to index #5. And I was able to do it, because I started my quest objectives with index #10.


<blockquote>
<blockquote>
Minimum objective index is 0, which should be null, with no entries, and maximum is 255.
Minimum objective index is 0 and maximum is 255.
</blockquote>
</blockquote>


'''How to add new quest objectives?''' Just right click on the list and choose "New". In Quest Objective Data options, in the Index field put the index number and in Display Text enter the text that will be displayed to the player.
'''How to add new quest objectives?''' Just right click on the list and choose "New". In Quest Objective Data options, in the Index field put the index number and in Display Text enter the text that will be displayed to the player.


 
'''What is the order of objectives in my quest?''' I made an assumption, that there are three paths for Player to accomplish the quest:
'''What is the order of objectives in my quest?''' I made an assumption, that there are three paths for Player to accomplish the quest.




First one is the following:
First one is the following:
{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
|-
|-
| 5||I have found strange teddy bear. I should keep it, maybe it would be useful in the future.
| 5||I have found strange teddy bear. I should keep it, maybe it would be useful in the future.
|-
|-
| 200||Amanda received her toy and in return she has shown me how to summon a bear.
| 200||Amanda received her toy and in return she has shown me how to summon a bear.
|-
|
|}
|}


second one:
second one:
{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
|-
|-
| 10||Go to Springvale School and search for Amanda's toy.
| 10||Go to Springvale School and search for Amanda's toy.
Line 299: Line 293:
| 200||Amanda received her toy and in return she has shown me how to summon a bear.
| 200||Amanda received her toy and in return she has shown me how to summon a bear.
|}
|}


and third:
and third:
{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
|-
|-
| 50||Find or buy a teddy bear for Amanda, a girl from the Clinic in Megaton.
| 50||Find or buy a teddy bear for Amanda, a girl from the Clinic in Megaton.
Line 310: Line 303:




In first part player first finds a teddy bear, then meets Amanda. In second path Player first speak with Amanda, goes for a bear hunting, and then returns back to Amanda with her toy. At last, in third path Player speaks with Amanda and manages to convince her to forget about her toy in Springvale School, and Player gives her another teddy bear.
In first part player first finds a teddy bear, then meets Amanda. In second path Player first speaks with Amanda, goes for a bear hunting, and then returns back to Amanda with her toy. At last, in third path Player speaks with Amanda and manages to convince her to forget about her toy in Springvale School, and Player gives her another teddy bear.
 


While preparing a story line and quest objectives, remember the following rule:
While preparing a story line and quest objectives, remember the following rule:


<blockquote><center>
<blockquote><center>Player is a very clever and extremely tricky creature.<br>
Player is a very clever and extremely tricky creature.<br>
Be prepared for everything.</center></blockquote>
Be prepared for everything.
</center></blockquote>
 
This means that we should anticipate every Player's move. The Bear Hunting quest can start not only after meeting Amanda, because Player first can go to Springvale School and find her teddy bear.


This means that we should anticipate every Player's move. The Bear Hunting quest can start not only after meeting with Amanda, because Player first can go to Springvale School and find her teddy bear.


I am sure you have also noticed a distinction on #10 and #20, the quest objectives that seem to be very similar – but they are not the same. Let's proceed to the Quest Targets and I will explain what I mean.
I am sure you have also noticed a distinction on #10 and #20, the quest objectives that seem to be very similar – but they are not the same. Let's proceed to the Quest Targets and I will explain what I mean.




=== Quest Targets ===
=== Quest Targets ===


Quest Targets are defined in the [[Quest Objectives Tab]]. You can add them to any objective, first by left clicking on an item of the objectives list, and then adding a Target Ref on the list below. You can choose any reference to the object in the world, but it must a persistent reference.
Quest Targets are defined in the [[Quest Objectives Tab]]. You can add them to any objective, first by left clicking on an item of the objectives list, and then adding a Target Ref on the list below. You can choose any reference to the object in the world, but it must be a persistent reference.




I want to have only two targets in the quest, first for:
I want to have only two targets in the quest, first for:
{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
| 10||Go to Springvale School and search for Amanda's toy.
| 10||Go to Springvale School and search for Amanda's toy.
|}
|}


and second for:
and second for:
{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
| 30||Go to the Clinic in Megaton and give to Amanda her teddy bear.
| 30||Go to the Clinic in Megaton and give to Amanda her teddy bear.
|}
|}




Let's start with quest target for objective #10. It should be a map marker or a teleport door of the Springvale School, the main entrance, that link interior of the school with exterior. I have chosen a door reference.
Let's start with quest target for objective #10. It should be a map marker or a teleport door of the Springvale School, the main entrance, that link interior of the school with exterior area. I have chosen a door reference.


I don't close the Quest Window, only move it aside, so I can see Cell View window and Render Window. In the Cell View I switch to '''Wasteland''' world space and search for something like Springvale Elementary School. Got it - the cell ID is '''SpringvaleSchoolExterior'''.


I don't close the Quest Window, only move it aside, so I can see Cell View window and Render Window. In the Cell View I switch to '''Wasteland world space''' and search for something like the Springvale Elementary School. Got it - the cell ID is '''SpringvaleSchoolExterior'''. In Render Window I move to the main entrance to the school, so I can see the door. Double click on the door to see if it is a persistent reference – it should be, and if so, I close the Reference window. Now back to Quest Window and objective #10. Right click on '''Target Ref''' list and choose '''New''' to add a new quest target. I must change the target data, because it is pointing to some Abandoned Sewer cell. Below, in '''Quest Target Data''' I click on the '''Select Reference in Render Window''' button, move the mouse cursor on the door, so its color changes from red to white, and double click on the door. Quest Target is set, Target Ref may not change, but it only needs refreshing left click.
In Render Window I move to the main entrance to the school, so I can see the door. Double click on the door to see if it is a persistent reference – it should be, and if so, I close the Reference window.  


Now back to Quest Window and objective #10. Right click on '''Target Ref''' list and choose '''New''' to add a new quest target. I must change the target data, because it is pointing to some Abandoned Sewer cell. Below, in '''Quest Target Data''' I click on the '''Select Reference in Render Window''' button, move the mouse cursor on the door, so its color changes from red to white, and double click on the door. Quest Target is set, Target Ref may not change, but it only needs refreshing left click.


'''How to add more quest targets''' for one objective? Just fill in the list of Target Refs.
'''How to add more quest targets''' for one objective? Just fill in the list of Target Refs.


 
I do the same for objective #30, and as a target ref I use '''aBHAmandaFlowerREF''', which was placed earlier in the MegatonClinic interior cell. I am not adding quest targets for any other objectives, especially not for #20, because in this quest stage Player must go into the Springvale School building and search for a teddy bear. I don't want to show on the map where this object is.
I do the same for objective #30, and as a target ref I use aBHAmandaFlowerREF, which was placed earlier in the MegatonClinic interior cell. I am not adding quest targets for any other objectives, especially not for #20, because in this quest stage Player must go into the Springvale School building and search for a teddy bear. I don't want to show on the map where this object is.
 




=== Quest Stages ===
=== Quest Stages ===


[[Quest Stages Tab|It is second tab]] in the Quest Window. You can find here the Log Entries for each Index and Result Scripts. There are also two very useful checkboxes: Complete Quest and Fail Quest. But let's start from the beginning.  
[[Quest Stages Tab|It is second tab]] in the Quest Window. You can find here the '''Log Entries''' for each stage index and '''Result Scripts'''. There are also two very useful checkboxes: '''Complete Quest''' and '''Fail Quest'''. But let's start from the beginning.  




In Oblivion the Log Entries was used to make Player's journal updates, when Player made some progress in the quests. In Fallout 3 there is no journal, only quest objectives with some information about current quest status and quest targets. It means, that you can put in Log Entry whatever you, it will not be displayed to Player in the game. In general:
In Oblivion the Log Entries were used to make Player's journal updates, when Player made some progress in a quest. In Fallout 3 there is no journal, only quest objectives with some information about current quest status and quest targets. It means that you can put in Log Entry whatever you want, it will not be displayed to Player in the game. In general:
* quest stage indexes can be the same as for quest objectives,  
* quest stage indexes can be the same as for quest objectives,  
* result scripts can be used to set objectives displayed or completed,
* result scripts can be used to set objectives displayed or completed,
Line 369: Line 357:




First fill in the list of Indexes by right clicking in the list and choosing New. Index numbers are the same as in Quest Objectives: 0, 5, 10, 20, 30, 50, 200 and on the end I add 210 as a final quest stage, so I also check in the Complete Quest checkbox. For each of stages, except #0, I right click on the list of Log Entries and add an EMPTY text.  
First fill in the list of Indexes by right clicking in the list and choosing New. Index numbers are the same as in Quest Objectives: 0, 5, 10, 20, 30, 50, 200 and on the end I add 210 as a final quest stage, so I also tick the Complete Quest checkbox. For each of stages, except #0, I right click on the list of Log Entries and add an EMPTY text.




For each quest stage I want to display a message about objectives to Player. To show current objective I can use [[SetObjectiveDisplayed]] script function, and [[SetObjectiveCompleted]] to show that previous objective is completed.  I can do it with by adding them to the Result Script of each stage – this is full list:
For each quest stage I want to display a message about objectives to Player. To show current objective I can use [[SetObjectiveDisplayed]] script function, and [[SetObjectiveCompleted]] to show that previous objective is completed.  I can do it by adding them to the Result Script of each stage – this is full list:


{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
| align="center" style="background:#f0f0f0;"|'''Quest Stage'''
| align="center" style="background:#f0f0f0;"|'''Quest Stage'''
| align="center" style="background:#f0f0f0;"|'''Result Script'''
| align="center" style="background:#f0f0f0;"|'''Result Script'''
Line 384: Line 372:
| 10||SetObjectiveDisplayed aBHQuest 10 1
| 10||SetObjectiveDisplayed aBHQuest 10 1
|-
|-
| 20||SetObjectiveCompleted aBHQuest 10 1<br>
| 20||SetObjectiveCompleted aBHQuest 10 1<br>SetObjectiveDisplayed aBHQuest 20 1
|-
|-
|  ||SetObjectiveDisplayed aBHQuest 20 1
| 30||SetObjectiveCompleted aBHQuest 20 1<br>SetObjectiveDisplayed aBHQuest 30 1
|-
| 30||SetObjectiveCompleted aBHQuest 20 1
|-
|  ||SetObjectiveDisplayed aBHQuest 30 1
|-
|-
| 50||SetObjectiveDisplayed aBHQuest 50 1
| 50||SetObjectiveDisplayed aBHQuest 50 1
|-
|-
| 200||SetObjectiveCompleted aBHQuest 200 1
| 200||SetObjectiveCompleted aBHQuest 200 1<br>SetStage aBHQuest 210
|-
|  ||SetStage aBHQuest 210
|-
|-
| 210||
| 210||
Line 402: Line 384:


<blockquote><center>
<blockquote><center>
Remember to compile each result script by clicking on the '''Compile Result''' button, just after adding it to the stage.
Remember to '''compile''' each result script by clicking on the '''Compile Result''' button, just after adding it to the stage.
</center></blockquote>
</center></blockquote>


As you can see, these result scripts refer to each quest objective and the quest itself. The last stage #210 do not have any script, because it is flagged as Complete Quest. This means that even if it had a result script, this script wouldn't be processed. I am using stage #210 only to finish the quest.
As you can see, these result scripts refer to each quest objective and the quest itself. The last stage #210 do not have any script, because it is flagged as Complete Quest. This means that even if it had a result script, this script wouldn't be processed. I am using stage #210 only to finish the quest.
That's all for now, we can save the data and close the Quest Window.


<blockquote><center>
<blockquote><center>
Line 414: Line 393:
</center></blockquote>
</center></blockquote>


That's all for now, we can save the data and close the Quest Window.




Line 422: Line 402:


Our quest is active from the very beginning. Its first stage is #0 and next is #5 with the following objective:
Our quest is active from the very beginning. Its first stage is #0 and next is #5 with the following objective:
{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
| 5||I have found strange teddy bear. I should keep it, maybe it would be useful in the future.
| 5||I have found strange teddy bear. I should keep it, maybe it would be useful in the future.
|}
|}
Line 454: Line 434:
</pre>
</pre>


When the object is taken by the player and the quest stage is smaller than 5, we set up stage #5. We want to set this stage only once, that is why we check if the quest stage if less than 5.  
When the object is taken by the player and the quest stage is smaller than 5, we set up stage #5. We want to set this stage only once, that is why we check if the quest stage is less than 5.  


<blockquote><center>
<blockquote><center>
Line 474: Line 454:
</pre>
</pre>


Notice that I am using "less or equal" comparison. It is better then only "equal" and sometimes it allows to avoid some mistakes. In the IF block first processed code is this:
Notice that I am using "less or equal" comparison. It is better than only "equal" and sometimes it allows to avoid mistakes. In the IF block first processed code is this:


<pre>
<pre>
Line 489: Line 469:
We can save the script, close the Script Editor and add it to the aBHTeddyBear. Next stage is #10:
We can save the script, close the Script Editor and add it to the aBHTeddyBear. Next stage is #10:


{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
| 10||Go to Springvale School and search for Amanda's toy.
| 10||Go to Springvale School and search for Amanda's toy.
|}
|}
Line 495: Line 475:
This should be turned on after conversation between Amanda and Player, when Player agrees to find the teddy bear. We will do it in one of the dialogue topics later.
This should be turned on after conversation between Amanda and Player, when Player agrees to find the teddy bear. We will do it in one of the dialogue topics later.


{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
| 20||Search for Amanda's teddy bear somewhere inside the building.
| 20||Search for Amanda's teddy bear somewhere inside the building.
|}
|}
Line 512: Line 492:
BEGIN onTriggerEnter player
BEGIN onTriggerEnter player


   if getStage aBHMainQuest == 10
   if getStage aBHQuest == 10
       setStage aBHMainQuest 20
       setStage aBHQuest 20
   endif
   endif


Line 521: Line 501:
When Player enters the trigger zone and if quest stage index is equal to 10,  and only then, we switch the stage to #20 – easy enough. Now assign this script to the aBHSpringvaleSchoolTrigger and we are done.
When Player enters the trigger zone and if quest stage index is equal to 10,  and only then, we switch the stage to #20 – easy enough. Now assign this script to the aBHSpringvaleSchoolTrigger and we are done.


{| {{table}}
{|border="1" cellspacing="0" cellpadding="3"
| 30||Go to the Clinic in Megaton and give to Amanda her teddy bear.
| 30||Go to the Clinic in Megaton and give to Amanda her teddy bear.
|-
|-
Line 530: Line 510:


These stages will be set in a dialogue. But before we can do it, we must add some dialogue topics.
These stages will be set in a dialogue. But before we can do it, we must add some dialogue topics.




Line 549: Line 528:
We also need to know about two main dialog elements:
We also need to know about two main dialog elements:
* '''Response''' – this is what NPC says. Text of a response can added to selected topic in Info fields, and edited in Info Details. If you want to have continuous speaking on one topic, for selected Info you should add some texts in Response Text fields. By default max length is 150 chars.  
* '''Response''' – this is what NPC says. Text of a response can added to selected topic in Info fields, and edited in Info Details. If you want to have continuous speaking on one topic, for selected Info you should add some texts in Response Text fields. By default max length is 150 chars.  
* '''Topic Text''' – this is what PC says, this a text displayed as a choice for Player in dialog menu, but only if the Prompt field is empty. If there is a text in the Prompt field, then it will be used instead of Topic Text.
* '''Topic Text''' – this is what PC says, this a text displayed as a choice for Player in dialog menu, but only if the '''Prompt''' field is empty. If there is a text in the Prompt field, then it will be used instead of Topic Text.




Let's start. If you wish, you can take a look at the top of this page to see the dialog design.
Let's start. If you wish, you can take a look at the top of this page to see the dialog design again.
 




=== Adding special topics ===
=== Adding special topics ===


Every dialogue starts with a NPC greeting, so we must add it in our quest.
Every dialogue starts with a NPC greeting, so we must add it in our quest. Actually it is not a must, but it is always better to have a custom greeting for a custom quest.




In the quest window go to the Topics tab, right click on the list to the left of the window and choose Add Topic option. The Select Topic window will open, with a list of all topics that were not used in selected quest. Search for the GREETING topic, left click on it and approve the selection by clicking on the OK button (or double-left click on the topic).
In the quest window go to the [[Topics Tab]], right click on the list to the left of the window and choose '''Add Topic''' option. The Select Topic window will open, with a list of all topics that were not used in selected quest. Search for the GREETING topic, left click on it and approve the selection by clicking on the OK button (or double-left click on the topic).




Now we have a GREETING in our quest, however we cannot leave it as is, we must add our unique text of the greeting. In game there are already many GREETING topics, but each of them use different texts, different Info entries. We only borrow the GREETING topic ID, which is the special one, used by NPC to greet Player.
Now we have a GREETING in our quest, however we cannot leave it as is, we must add our own text of the greeting. In game there are already many GREETING topics, but each of them use different texts, different Info entries. We only borrow the GREETING topic ID, which is the special one, used by NPC to greet Player.




Right click on the Info list and New, and the New Response window will open. In Response Text we enter the following text:
Right click on the '''Info''' list and '''New''', and the New Response window will open. In Response Text we enter the following text:
*''Can I ask you a question?''
*''Can I ask you a question?''




If you wish, in '''Script Notes''' and '''Edit''' fields you can add some notes. In '''Idle Animations''' you can set up some animations for a Speaker (NPC is speaking the greeting); Player is a Listener, so in this case we cannot use any animations. These fields refer only to NPC. In '''Audio settings''' it is possible to choose an '''Emotion Type''' for the response, as well as an '''Emotion Value'''; the greater value, the more emotions are on the Speaker. '''Voice filenames''' are generated automatically and we will handle them later.  
If you wish, in '''Script Notes''' and '''Edit''' fields you can add some notes. In '''Idle Animations''' you can set up some animations for a Speaker (NPC is speaking the greeting); Player is a Listener, so in this case we cannot use any animations. These fields refer only to NPC. In '''Audio settings''' it is possible to choose an '''Emotion Type''' for the response, as well as an '''Emotion Value'''; the greater value, the more emotions are on the Speaker. '''Voice filenames''' are handled automatically, we don't need them, unless you record your own voiceover for dialogues.




Close the New Response window. In the Quest window, in upper right corner there some useful options:
Close the New Response window. In the Quest window, in upper right corner there are some useful options:
* '''Top-level''' checkbox – tick it and the response will show up as first on the list of available topics in dialog menu in game.
* '''Top-level''' checkbox – tick it and the response will show up as first on the list of available topics in dialog menu in game.
* '''Rumors''' – not used.
* '''Rumors''' – not used.
Line 585: Line 563:
In my quest there is another greeting. Add it by right click on an empty line of the Info list. The response text is this:
In my quest there is another greeting. Add it by right click on an empty line of the Info list. The response text is this:


''Do you have a teddy bear for me?''
* ''Do you have a teddy bear for me?''




This text can be repeated many times, while doing the quest Player can always speak with Amanda, so I do not tick the Say Once checkbox.
This text can be repeated many times, while doing the quest Player can always speak with Amanda, so I do not tick the "Say Once" checkbox.


<blockquote><center>
<blockquote><center>
Line 594: Line 572:
</center></blockquote>
</center></blockquote>


Later we will came back to this topic and add some conditions and links, but now let's fill the list with other topics.
Later we will come back to this topic and add some conditions and links, but now let's fill the list with other topics.
 




=== Adding custom topics ===
=== Adding custom topics ===


In my scenario, after the greeting there is a choice for Player, topic aBHTopicWelcome with the following text:
In my scenario, after the greeting there is a choice for Player, a topic '''aBHTopicWelcome''' with the following text:
* ''Hello young lady. What can I do for you?''
* ''Hello young lady. What can I do for you?''




To add this topic, right click on the list to the left of the window and choose Add Topic option. The Select Topic window will open, with a list of all already existing topics. There is no aBHTopicWelcome, so we must add it – the steps are simple and we do as usual: right click on the list in the Select Topic window and New; enter '''aBHTopicWelcome''' as a topic ID.
To add this topic, right click on the list to the left of the window and choose '''Add Topic''' option. The Select Topic window will open, with a list of all already existing topics. There is no aBHTopicWelcome, so we must add it – the steps are simple and we do as usual: right click on the list in the Select Topic window and '''New'''; enter '''aBHTopicWelcome''' as a topic ID.
 


We have our custom topic on the list. As you can see in the upper side of the quest window, the Topic Text is the same as topic ID: aBHTopicWelcome. Let's leave it as is, and add Player's choice text in the Prompt field. Click in this field and enter:
* ''Hello young lady. What can I do for you?''


We have our custom topic on the list. As you can see in the upper side of the quest window, the Topic Text is the same as topic ID: aBHTopicWelcome. Let's leave it as is.


As '''Response Text''' add the following:
Now create another new Info with the response text:
* ''Could you find my teddy bear please?''
* ''Could you find my teddy bear please?''


and add Player's choice text in the '''Prompt''' field. Click in this field and enter:
* ''Hello young lady. What can I do for you?''


This is what Amanda will say, after she greets Player and when Player clicks on Hello young lady. What can I do for you? dialog choice in dialog menu. Easy, isn't it? Right click once again on an empty line in Response Texts list and add another entry:
Amanda will say this response after she greets Player and when Player clicks on Hello young lady. What can I do for you? dialog choice in dialog menu. Easy, isn't it? Right click once again on an empty line in Response Texts list and add another entry:
* ''I lost it in Springvale School while I was escaping with my mother.''
* ''I lost it in Springdale School while I was escaping with my mother.''




Line 660: Line 637:




'''Topic ID:''' aBHTopicHaveTeadyBear<br>
'''Topic ID:''' aBHTopicHaveTeddyBear<br>
'''Prompt:''' Yes, I have found a toy with your name on it. Here it is.<br>
'''Prompt:''' Yes, I have found a toy with your name on it. Here it is.<br>
'''Response:''' Thank you.<br>
'''Response:''' Thank you.<br>
Line 667: Line 644:




'''Topic ID:''' aBHTopicHaveTeadyBear<br>
'''Topic ID:''' aBHTopicHaveTeddyBear<br>
'''Prompt:''' Yes, I have this toy. Here it is.<br>
'''Prompt:''' Yes, I have this toy. Here it is.<br>
'''Response:''' Thank you.<br>
'''Response:''' Thank you.<br>
Line 674: Line 651:




There are two different Prompts for aBHTopicHaveTeadyBear topic, because there are also two different ways for Player to do the quest: finding the teddy bear and then speaking with Amanda or speaking with Amanda first, and finding the quest item.
There are two different Prompts for aBHTopicHaveTeddyBear topic, because there are also two different ways for Player to do the quest: finding the teddy bear and then speaking with Amanda or speaking with Amanda first, and finding the quest item.
 
 


=== Linking the topics ===
=== Linking the topics ===
Line 693: Line 668:




Let's go back to the point and link some topics. In my quest the dialogue is simple, so there will not be too many links. Click on the GREETING topic and Can I ask you a question? Info text. For this I have planned only one Player's choice, that is topic aBHTopicWelcome. Right click in the Choices field and add this topic.
Let's go back to the point and link some topics. In my quest the dialogue is simple, so there will not be too many links. Click on the GREETING topic and "''Can I ask you a question?''" Info text. For this I have planned only one Player's choice, that is topic '''aBHTopicWelcome'''. Right click in the Choices field and add this topic.




Line 703: Line 678:
*aBHTopicByeBye
*aBHTopicByeBye


Add each of this topics in Choices field of aBHTopicWelcome topic.
Add each of this topics in '''Choices''' field of aBHTopicWelcome topic.




Now go back to the GREETING and click on the second response with "Do you have a teddy bear for me?" Info text. This time there is a list full of possibilities. The Choices field should contain the following topics:
Now go back to the GREETING and click on the second response with "''Do you have a teddy bear for me?''" Info text. This time there is a list full of possibilities. The '''Choices''' field should contain the following topics:
*aBHTopicHaveTeddyBear
*aBHTopicHaveTeddyBear
*aBHTopicNotYet
*aBHTopicNotYet
Line 715: Line 690:


The first three choice topics are simple: Player has the teddy bear, doesn't have it yet or disagree to bring it. This second GREETING Info text doesn't have the Say Once flag, it can be used in game many times. At first talk with Amanda Player can refuse to help her, that is why it should be another possibility to start the quest with aBHTopicAgree topic. I have also added the ByeBye to prevent displaying a generic GOODBYE.
The first three choice topics are simple: Player has the teddy bear, doesn't have it yet or disagree to bring it. This second GREETING Info text doesn't have the Say Once flag, it can be used in game many times. At first talk with Amanda Player can refuse to help her, that is why it should be another possibility to start the quest with aBHTopicAgree topic. I have also added the ByeBye to prevent displaying a generic GOODBYE.




=== Linking the challenge topic ===
=== Linking the challenge topic ===
   
   
First we must add another special topic: SpeechChallengeFailure. You already know what it is for, don't you? This is only a response topic, it should have no Prompts. The response is the following:
First we must add another special topic: '''SpeechChallengeFailure'''. You already know what it is for, don't you? This is only a response topic, it should have no Prompts. The response is the following:
* ''No, he is my friend, a special one.''
* ''No, he is my friend, a special one.''




It should be linked from aBHTopicAgreeWithChallenge topic, so add it in the Link From field. Now, in game, if Player succeed with a speech challenge, the response will be taken from aBHTopicAgreeWithChallenge. In case of failure, there will be displayed SpeechChallengeFailure response.
It should be linked from aBHTopicAgreeWithChallenge topic, so add it in the '''Link From''' field. Now, in game, if Player succeed with a speech challenge, the response will be taken from aBHTopicAgreeWithChallenge. In case of failure, there will be displayed SpeechChallengeFailure response.


That's all about linking. Let's make some conditions.
That's all about linking. Let's make some conditions.




Line 734: Line 707:
These are very important for the quest. If there are no conditions for the topics, every one of them will be displayed almost always and every NPC could use them.
These are very important for the quest. If there are no conditions for the topics, every one of them will be displayed almost always and every NPC could use them.


The first condition is very simple and very common – the dialogue can take place only between Player and Amanda. Right click on an empty line of the Conditions and add New entry. You will get the Condition Item window with some fields to be filled in:
The first condition is very simple and very common – the dialogue can take place only between Player and Amanda. Right click on an empty line of the Conditions and add New entry. You will get the '''Condition Item''' window with some fields to be filled in:
*'''Condition Function''': by default it is GetIsID function. This is the most common function for dialogue topic conditions, that is why it is default, and this is exactly what we want now. Do not change it.
*'''Condition Function''': by default it is GetIsID function. This is the most common function for dialogue topic conditions, that is why it is default, and this is exactly what we want now. Do not change it.
*'''Function Parameters''': According to the function type, in this field it is possible to give some parameters. If the condition function has parameters, this field will be enabled, otherwise it will be not possible to choose any parameters. GetIsID has one parameter: an object. Click on it and set aBHAmandaFlower as a parameter.  
*'''Function Parameters''': According to the function type, in this field it is possible to give some parameters. If the condition function has parameters, this field will be enabled, otherwise it will be not possible to choose any parameters. GetIsID has one parameter: an object. Click on it and set aBHAmandaFlower as a parameter.  
Line 794: Line 767:


*'''aBHTopicNotYet''':<br>
*'''aBHTopicNotYet''':<br>
- quest stage index must be greaten than or equal to 10 (AND)<br>
- quest stage index must be greater than or equal to 10 (AND)<br>
- quest stage index must be less than 50 (AND)<br>
- quest stage index must be less than 50 (AND)<br>


=== Result scripts ===
=== Result scripts ===
Anonymous user