Difference between revisions of "A beginner's guide, lesson 7 - Using Scripts in Quests"

Jump to navigation Jump to search
→‎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==


Objective: ''In this phase the player will again meet Vilanus, who will set about transferring the deeds of the property over to you. After 24 hours you can revisit and he will have the documents ready.''
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 will need
We need:


* A second complete deed document
* A completed version of the deed
* The Prize House
* The prize house
* A map marker
* A map marker for the house


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 BGDummyPlayer. Set the interior cell ownership to BGDummyPlayer as well.
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.  
 
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> If (Player.GetItemCount "BGM001HouseDeedUC">=1) && (Player.GetItemCount "BGTopViewKey">=1)
<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"
* GREETING
|-
|-
!  RESPONSE
!  RESPONSE
|   
"I can't help you until you find the key and deed to the house."
* I can't help you until you find the key and deed.
* You have to go back and get the deed and key. Check if Blair has it.
|-
|-
!  CONDITIONS
!  CONDITIONS
|   
|   
* GetIsId  BGVilanusVilla == 1
* GetIsID 'BGVilanusVilla' == 1
* GetStage BGM001 >= 80
* GetStage BGM001 >= 20
* GetQuestVariable BGM001.QuestWon == 0
* GetQuestVariable BGM001.QuestWon == 0
|-
|-
!  ADD TOPICS
!  ADD TOPICS
|   
''No add topics''
* (none)
|-
|-
!  RESULT SCRIPT
!  RESULT SCRIPT
|   
''No add topics''
* (none)
|}
|}


Line 944: Line 940:


{| border="1" cellpadding="5"
{| border="1" cellpadding="5"
!colspan=2| '''GREETING'''
|-
|-
!  TOPIC
!  TOPIC TEXT
|   
"GREETING"
* GREETING
|-
|-
!  RESPONSE
!  RESPONSE
|   
"Hello, have you managed to recover the key and deed?"
* Hello, Have you managed to recover the deed and key?
|-
|-
!  CONDITIONS
!  CONDITIONS
|   
|   
* GetIsId BGVilanusVilla == 1
* GetIsID BGVilanusVilla == 1
* GetStage BGM001 >= 80
* GetStage BGM001 >= 95
* GetQuestVariable BGM001.QuestWon == 1
* GetQuestVariable BGM001.QuestWon == 1
|-
|-
!  ADD TOPICS
!  ADD TOPICS
|   
''No add topics''
* none
|-
|-
!  RESULT SCRIPT
!  RESULT SCRIPT
Line 968: Line 962:
|}
|}


(add topic via script to avoid issue with GREETINGS add topic's not appearing in the game)
''(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?"
* BGTopView (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."
* 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
* 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
Stage 110 Journal Update</pre>
</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===


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

Navigation menu