Difference between revisions of "Quest and Dialogue Tutorial"

895 bytes added ,  19:45, 4 January 2009
wip 2
imported>Entom
(wip)
 
imported>Entom
(wip 2)
Line 355: Line 355:




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




Line 407: Line 404:
|}
|}


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


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.
Line 417: Line 414:


<blockquote><center>
<blockquote><center>
If you want to save quest changes, never ever close the Quest Window by clicking on X, but click on the OK button in lower right corner of the window.
If you want to '''save quest changes''', never ever close the Quest Window by clicking on X, but click on the OK button in lower right corner of the window.
</center></blockquote>
</center></blockquote>


Line 503: Line 500:
|}
|}


This is next stage after #10: Player has met Amanda and went to Springvale School, following the quest target. This target was set by us on the SpringvaleSchoolDoor01toExteriorREF in Quest Objectives tab, for quest index #10. Now Player enters the school and we want to change the quest stage. Let's go '''SpringvaleSchool01''' interior, activate it in the Render window and double click on '''SpringvaleSchoolDoor01toExteriorREF''' on the list of cell objects. In front of the door we will create a primitive form, a trigger zone.
This is next stage after #10: Player has met Amanda and went to Springvale School, following the quest target. This target was set by us on the SpringvaleSchoolDoor01toExteriorREF in Quest Objectives tab, for quest index #10. Now Player enters the school and we want to change the quest stage. Let's go '''SpringvaleSchool01''' interior, activate it in the Render window and double click on '''SpringvaleSchoolDoor01toExteriorREF''' on the list of cell objects.  
 


Click on the icon with a cube and the T letter on the toolbar and draw a cubic object that will cover door's teleport marker. It will be a new base object, and I name it '''aBHSpringvaleSchoolTrigger'''.  
In front of the door we will create a [[Creating Primitives|primitive form]], a trigger zone. Click on the icon with a cube and the T letter on the toolbar and draw a cubic object that will cover door's teleport marker. It will be a new base object, and I name it '''aBHSpringvaleSchoolTrigger'''.  




Line 799: Line 797:
- quest stage index must be greaten than or equal to 10 (AND)<br>
- quest stage index must be greaten 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 ===
Finally, we need some result scripts to manage the quest. The first one will be used when Player agrees to help Amanda. Left click on the aBHTopicAgree and in the Result Script (End) enter the following code:
<pre>setstage aBHQuest 30
</pre>
Click on the Compile Scripts button to check if the code is correct and to compile it.
Second script is for aBHTopicHaveTeddyBear, when Player has aBHTeddyBear item and meets Amanda:
<pre>
player.removeitem aBHTeddyBear 1
if (GetStage aBHQuest == 30)
  SetObjectiveCompleted aBHQuest 30 1
else
  SetObjectiveCompleted aBHQuest 5 1
endif
SetObjectiveDisplayed aBHQuest 200 1
SetStage aBHQuest 200
</pre>
With this script we take the item from Player, according to the quest stage we mark proper quest objective as completed, and set the final stage.




Now click on the OK button and save the plugin. I think it is good time to test it in game.
Now click on the OK button and save the plugin. I think it is good time to test it in game.


I hope you enjoyed the tutorial and it will be useful for you.
I hope you enjoyed the tutorial and you found it useful.




  Images will be added and sample plugin file will be available for download soon.
  Images will be added and sample plugin file will be available for download soon.
Anonymous user