Difference between revisions of "A beginner's guide, lesson 7 - Using Scripts in Quests"
Jump to navigation
Jump to search
A beginner's guide, lesson 7 - Using Scripts in Quests (edit)
Revision as of 01:26, 15 August 2010
, 01:26, 15 August 2010→Imperial City Phase Two: Editing some English
imported>Pyrocow2 (→Setting up Brown: adding another possible outcome) |
imported>Pyrocow2 (→Imperial City Phase Two: Editing some English) |
||
Line 890: | Line 890: | ||
==Imperial City Phase Two== | ==Imperial City Phase Two== | ||
In this phase the player will return to Vilanus, who will set about transferring the ownership of the property to you. We will add a delay so that the player has to wait 24 game hours before the process is finished. | |||
We | We need: | ||
* A | * A completed version of the deed | ||
* The | * The prize house | ||
* A map marker | * A map marker for the house | ||
To set up the | To set up the prize house, go to the interior cell ''BGmodtut4'', which is the interior of the house. It has three doors. One leads to the basement. The other two are linked to the exterior. Lock the exterior doors and set the ownership to our old buddy ''BGDummyOwner''. Set the interior cell ownership to ''BGDummyOwner'' as well. | ||
We begin with another dialogue pair involving Vilanus Villa. | We begin with another dialogue pair involving Vilanus Villa. | ||
One for before you have the key and deed | One for before you have the key and deed, the second for when you are successful. | ||
Again we need to add a small bit of script to the Quest Script to check for this. | Again we need to add a small bit of script to the Quest Script to check for this. | ||
<pre> | <pre> | ||
If (Player.GetItemCount "BGM001HouseDeedUC">=1) && (Player.GetItemCount "BGTopViewKey">=1) | |||
If DoOnce3 ==0 | If DoOnce3 ==0 | ||
Set QuestWon to 1 | Set QuestWon to 1 | ||
Set DoOnce3 to 1 | Set DoOnce3 to 1 | ||
EndIf | EndIf | ||
EndIf</pre> | EndIf | ||
</pre> | |||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
!colspan=2| '''GREETING''' | |||
|- | |- | ||
! TOPIC | ! TOPIC TEXT | ||
| | | "GREETING" | ||
|- | |- | ||
! RESPONSE | ! RESPONSE | ||
| | | "I can't help you until you find the key and deed to the house." | ||
|- | |- | ||
! CONDITIONS | ! CONDITIONS | ||
| | | | ||
* | * GetIsID 'BGVilanusVilla' == 1 | ||
* GetStage BGM001 >= | * GetStage BGM001 >= 20 | ||
* GetQuestVariable BGM001.QuestWon == 0 | * GetQuestVariable BGM001.QuestWon == 0 | ||
|- | |- | ||
! ADD TOPICS | ! ADD TOPICS | ||
| | | ''No add topics'' | ||
|- | |- | ||
! RESULT SCRIPT | ! RESULT SCRIPT | ||
| | | ''No add topics'' | ||
|} | |} | ||
Line 944: | Line 940: | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
!colspan=2| '''GREETING''' | |||
|- | |- | ||
! TOPIC | ! TOPIC TEXT | ||
| | | "GREETING" | ||
|- | |- | ||
! RESPONSE | ! RESPONSE | ||
| | | "Hello, have you managed to recover the key and deed?" | ||
|- | |- | ||
! CONDITIONS | ! CONDITIONS | ||
| | | | ||
* | * GetIsID BGVilanusVilla == 1 | ||
* GetStage BGM001 >= | * GetStage BGM001 >= 95 | ||
* GetQuestVariable BGM001.QuestWon == 1 | * GetQuestVariable BGM001.QuestWon == 1 | ||
|- | |- | ||
! ADD TOPICS | ! ADD TOPICS | ||
| | | ''No add topics'' | ||
|- | |- | ||
! RESULT SCRIPT | ! RESULT SCRIPT | ||
Line 968: | Line 962: | ||
|} | |} | ||
( | ''(Add the topic via script to avoid issue with GREETING Add Topics not always working.)'' | ||
For the new topic we add several responses. This first info tell the player to come back later | For the new topic we add several responses. This first info tell the player to come back later | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
!colspan=2| '''BGTopView''' | |||
|- | |- | ||
! TOPIC | ! TOPIC TEXT | ||
| | | "Top View Cottage?" | ||
|- | |- | ||
! RESPONSE | ! RESPONSE | ||
| | | "Excellent, I will take the deed to the Property Registrar today. Come back tomorrow and I'll complete the transfer." | ||
|- | |- | ||
! CONDITIONS | ! CONDITIONS | ||
| | | | ||
* | * GetIsID 'BGVilanusVilla' == 1 | ||
* GetQuestVariable BGM001.QuestWon == 1 | * GetQuestVariable 'BGM001.QuestWon' == 1 | ||
|- | |- | ||
! ADD TOPICS | ! ADD TOPICS | ||
Line 993: | Line 986: | ||
! RESULT SCRIPT | ! RESULT SCRIPT | ||
| | | | ||
<pre>Player.RemoveItem "BGM001HouseDeeduc" 1 | <pre> | ||
Player.RemoveItem "BGM001HouseDeeduc" 1 | |||
SetStage BGM001 110 | SetStage BGM001 110 | ||
</pre> | |||
|} | |} | ||
''I have met with Vilanus Villa again. He has taken the deed to Top View and will complete the registration. I should come back in 24 hours to complete the transfer.'' | Stage 110 Journal Update | ||
''I have met with Vilanus Villa again. He has taken the deed to Top View and will complete the registration. I should come back in 24 hours to complete the transfer.'' | |||
We want to set up a delay of one day before we can collect the finished documents. This gives us an excellent opportunity to look at and practice timers | We want to set up a delay of one day before we can collect the finished documents. This gives us an excellent opportunity to look at and practice timers | ||
===Timers=== | |||
Timers are another bit of scripting that gets used again and again. The game uses a number of global variables to report the progress of time. | Timers are another bit of scripting that gets used again and again. The game uses a number of global variables to report the progress of time. |