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

Jump to navigation Jump to search
Put topic summaries into tables
imported>Mk pj
imported>Pyrocow
(Put topic summaries into tables)
Line 175: Line 175:
We use the topic BGCluesFound that was added earlier. We want one response if the player has not collected the clues yet, and another for when they have collected the clue. We can use the quest stage as a condition. Set up the responses so that a new topic called BGRedRose is added if we have the clues.
We use the topic BGCluesFound that was added earlier. We want one response if the player has not collected the clues yet, and another for when they have collected the clue. We can use the quest stage as a condition. Set up the responses so that a new topic called BGRedRose is added if we have the clues.


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGCluesFound
* BGCluesFound
 
|-
RESPONSE
RESPONSE
* I recognise this amulet. It belongs to a gang of thieves called the Red Rose Brigade
* I recognise this amulet. It belongs to a gang of thieves called the Red Rose Brigade
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGCptHubart == 1
* GetIsId  BGCptHubart == 1
* GetStage BGM001 == 50
* GetStage BGM001 == 50
 
|-
ADD TOPICS
ADD TOPICS
* BGRedRose
* BGRedRose
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
TOPIC
|}
{| border="1" cellpadding="5"
|-
TOPIC
* BGCluesFound
* BGCluesFound
 
|-
RESPONSE
RESPONSE
* I need more clues to work with.
* I need more clues to work with.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGCptHubart == 1
* GetIsId  BGCptHubart == 1
* GetStage BGM001 < 50
* GetStage BGM001 < 50
 
|-
ADD TOPICS
ADD TOPICS
* (none)
RESULT SCRIPT
* (none)
* (none)
|-
!  RESULT SCRIPT
|  * (none)
|}


For the Red Rose topic add this response and add a new topic called BGSmith.
For the Red Rose topic add this response and add a new topic called BGSmith.


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGRedRose (Red Rose Brigade)
* BGRedRose (Red Rose Brigade)
 
|-
RESPONSE
RESPONSE
* They are a nasty bunch led by a couple of villains called Blair and Brown.
* They are a nasty bunch led by a couple of villains called Blair and Brown.
* I know they have a secret hide out in the mountains.
* I know they have a secret hide out in the mountains.
* Your best bet is to talk to an ex gang member by the name of Smith.
* Your best bet is to talk to an ex gang member by the name of Smith.
* I am surprised. I never took Brown for a killer.
* I am surprised. I never took Brown for a killer.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGCptHubart == 1
* GetIsId  BGCptHubart == 1
* GetStage BGM001 == 50
* GetStage BGM001 == 50
 
|-
ADD TOPICS
ADD TOPICS
* BGSmith
* BGSmith
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


We can remove the quest clues as they are no longer needed.  
We can remove the quest clues as they are no longer needed.  
Line 230: Line 254:
Finally add the Brandy, if you wish. Alternatively we could omit this and allow the player to make his choices
Finally add the Brandy, if you wish. Alternatively we could omit this and allow the player to make his choices


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGSmith (Smith)
* BGSmith (Smith)
 
|-
RESPONSE
RESPONSE
* Yeah, he quit the gang a while back. you'll find him hanging out at the Aleswell Inn.
* Yeah, he quit the gang a while back. you'll find him hanging out at the Aleswell Inn.
* He's partial to a drop of Brandy. That might help loosen his lips.
* He's partial to a drop of Brandy. That might help loosen his lips.
* I take back the cottage key and hold on to this document.
* I take back the cottage key and hold on to this document.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGCptHubart  == 1
* GetIsId  BGCptHubart  == 1
* GetStage BGM001 == 50
* GetStage BGM001 == 50
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
<ul><li><pre>Player.Additem "PotionCyrodiilicBrandy" 1
<pre>Player.Additem "PotionCyrodiilicBrandy" 1
Player.RemoveItem "BGPartialLetter" 1
Player.RemoveItem "BGPartialLetter" 1
Player.RemoveItem "BGCourierKey" 1
Player.RemoveItem "BGCourierKey" 1
Player.RemoveItem "BGEmbossedAmulet" 1
Player.RemoveItem "BGEmbossedAmulet" 1
SetStage BGM001 60</pre></ul>
SetStage BGM001 60</pre>
|}


To complete this section we need to update the journal and move on to Aleswell.
To complete this section we need to update the journal and move on to Aleswell.
Line 283: Line 315:
We can set up a GREETING for Smith. Here we use the quest stage for the miscellaneous quest called MS47  Zero Visibility. This is the stage where the people of Aleswell become visible.  
We can set up a GREETING for Smith. Here we use the quest stage for the miscellaneous quest called MS47  Zero Visibility. This is the stage where the people of Aleswell become visible.  


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* GREETING
* GREETING
 
|-
RESPONSE
RESPONSE
* This is so weird. Everyone is invisible. I came here to blend in with a crowd. Just my luck
* This is so weird. Everyone is invisible. I came here to blend in with a crowd. Just my luck
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGMSmith == 1
* GetIsId  BGMSmith == 1
* GetStage MS47 < 50
* GetStage MS47 < 50
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


The next bit of the quest is a bit tricky.  
The next bit of the quest is a bit tricky.  
Line 309: Line 349:
Let’s do that now.
Let’s do that now.


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGRedRoseBrigade
* BGRedRoseBrigade
 
|-
RESPONSE
RESPONSE
* I don't know you, and I don't think I want to talk to you about them
* I don't know you, and I don't think I want to talk to you about them
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGMSmith == 1
* GetIsId  BGMSmith == 1
* GetDisposition < 90
* GetDisposition < 90
 
|-
ADD TOPICS
ADD TOPICS
* BGBrandy
* BGBrandy
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


We then check the '''Info Refusal''' flag.
We then check the '''Info Refusal''' flag.
Line 531: Line 579:
We adjust its value using  topics called BGBrandy, BGBrandyChoice1, and BGBrandyChoice2
We adjust its value using  topics called BGBrandy, BGBrandyChoice1, and BGBrandyChoice2


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGBrandy
* BGBrandy
 
|-
RESPONSE
RESPONSE
* Yeah, I love the stuff. Have you  any to spare?
* Yeah, I love the stuff. Have you  any to spare?
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGMSmith == 1
* GetIsId  BGMSmith == 1
* GetStage BGM001 == 50
* GetStage BGM001 == 50
 
|-
ADD TOPICS
ADD TOPICS
* (in Choices)
** BGBrandyChoice1
* (none)
** BGBrandyChoice2
|-
 
!  CHOICES
RESULT SCRIPT
* BGBrandyChoice1
* BGBrandyChoice2
|-
RESULT SCRIPT
* (none)
* (none)
|}


We can then use the choices to set our control variable to 1.  
We can then use the choices to set our control variable to 1.  
Line 561: Line 620:
Add another quest variable to the quest script called DoNextBrandy
Add another quest variable to the quest script called DoNextBrandy


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGBrandyChoice1(Yes, I might have)
* BGBrandyChoice1(Yes, I might have)
 
|-
RESPONSE
RESPONSE
* I think I might warm to you.
* I think I might warm to you.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGMSmith == 1
* GetIsId  BGMSmith == 1
* GetStage BGM001 == 50
* GetStage BGM001 == 50
* GetQuestVariable BGM001.DoNextBrandy == 0
* GetQuestVariable BGM001.DoNextBrandy == 0
 
|-
ADD TOPICS
ADD TOPICS
 
RESULT SCRIPT
* (none)
<ul><li><pre>Set BGM001.BrandyTalk to 1
|-
Set BGM001. DoNextBrandy to 1</pre></ul>
RESULT SCRIPT
<pre>Set BGM001.BrandyTalk to 1
Set BGM001. DoNextBrandy to 1</pre>
|}


The second response info reads
The second response info reads


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGBrandyChoice1(Yes, I might have)
* BGBrandyChoice1(Yes, I might have)
 
|-
RESPONSE
RESPONSE
* I think I might warm to you.
* I think I might warm to you.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGMSmith == 1
* GetIsId  BGMSmith == 1
* GetStage BGM001 == 50
* GetStage BGM001 == 50
* GetQuestVariable BGM001.DoNextBrandy == 1
* GetQuestVariable BGM001.DoNextBrandy == 1
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
<ul><li><pre>Set BrandyTalk to 1
Set DoNextBrandy to 2</pre></ul>
<pre>Set BrandyTalk to 1
Set DoNextBrandy to 2</pre>
|}


Add another couple of responses, make all of them goodbyes using the Good bye flag. this ends the dialogue automatically, closes the topic menu and forces the now active script to run.
Add another couple of responses, make all of them goodbyes using the Good bye flag. this ends the dialogue automatically, closes the topic menu and forces the now active script to run.
Line 602: Line 678:
We also need to add a negative response. Note there is no result for this one, and you don’t need to make it a goodbye.
We also need to add a negative response. Note there is no result for this one, and you don’t need to make it a goodbye.


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGBrandyChoice2 (No sorry I’m out)
* BGBrandyChoice2 (No sorry I’m out)
 
|-
RESPONSE
RESPONSE
* Pity, I might have liked you more if you did.
* Pity, I might have liked you more if you did.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGMSmith == 1
* GetIsId  BGMSmith == 1
* GetStage BGM001 == 50
* GetStage BGM001 == 50
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


By a combination of speech craft, factions, bribes disposition games and brandy gifts the Player should be able to raise the disposition to 90 eventually. This will trigger the next bit of dialogue and send us towards the quest climax. Return to the BGRedRoseBrigade topic and add this
By a combination of speech craft, factions, bribes disposition games and brandy gifts the Player should be able to raise the disposition to 90 eventually. This will trigger the next bit of dialogue and send us towards the quest climax. Return to the BGRedRoseBrigade topic and add this


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGRedRoseBrigade
* BGRedRoseBrigade
 
|-
RESPONSE
RESPONSE
* Ok, the truth is I've fallen out with the gang. They've threatened to kill me for leaving.
* Ok, the truth is I've fallen out with the gang. They've threatened to kill me for leaving.
* You look like you can take care of them.
* You look like you can take care of them.
Line 629: Line 717:
* Here's the hideout key, and I'll mark the hideouts location on your map.
* Here's the hideout key, and I'll mark the hideouts location on your map.
* Mind you I am surprised at Brown. He was a decent chap when I was in the gang.
* Mind you I am surprised at Brown. He was a decent chap when I was in the gang.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGMSmith == 1
* GetIsId  BGMSmith == 1
* GetDisposition >= 90
* GetDisposition >= 90
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
<ul><li><pre>SetStage BGM001 70</pre></ul>
<pre>SetStage BGM001 70</pre>
|}


We can then use the result script to bump the stage to 70
We can then use the result script to bump the stage to 70
Line 870: Line 962:
We now have to set up the conversation. We use the conversation tab rather than the topic tab. Also set this conversation up as a goodbye, to terminate any further discussion.
We now have to set up the conversation. We use the conversation tab rather than the topic tab. Also set this conversation up as a goodbye, to terminate any further discussion.


CONVERSATION
{| border="1" cellpadding="5"
* BGMBlairGreet
|-
 
CONVERSATION
RESPONSE
BGMBlairGreet
|-
RESPONSE
* You are a fool for coming here. Now prepare to die.
* You are a fool for coming here. Now prepare to die.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGBlair == 1
* GetIsId  BGBlair == 1
* GetStage BGM001 < 95
* GetStage BGM001 < 95
* GetStage BGM001 == 90
* GetStage BGM001 == 90
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


When the PC kills Blair we can then update the journal
When the PC kills Blair we can then update the journal
Line 895: Line 994:
Initially we set up a greeting.  
Initially we set up a greeting.  


TOPIC
{| border="1" cellpadding="5"
* Greeting
|-
 
TOPIC
RESPONSE
* GREETING
|-
RESPONSE
* Please, Please, don't kill me. I just want to get away from here. Please let me go
* Please, Please, don't kill me. I just want to get away from here. Please let me go
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGBrown == 1
* GetIsId  BGBrown == 1
* GetStage BGM001 == 90
* GetStage BGM001 == 90
 
|-
ADD TOPICS
ADD TOPICS
* BgBrownChoice1
* BgBrownChoice1
* BgBrownChoice2
* BgBrownChoice2
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
 
|}
The positive response info for BGBrownC1 gives a stage boost, the negative one does not.
The positive response info for BGBrownC1 gives a stage boost, the negative one does not.


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGBrownC1
* BGBrownC1
 
|-
RESPONSE
RESPONSE
* Thank You! Thank you! The code is 1 4 7
* Thank You! Thank you! The code is 1 4 7
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGBrown == 1
* GetIsId  BGBrown == 1
* GetStage BGM001 >= 90
* GetStage BGM001 >= 90
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
<ul><li><pre>SetStage BGM001 100</pre></ul>
<pre>SetStage BGM001 100</pre>
|}


We update the journal and run a bit of script as a result
We update the journal and run a bit of script as a result
Line 941: Line 1,055:
  SetQuestObject BGPartialLetter 0
  SetQuestObject BGPartialLetter 0


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGBrownC2
* BGBrownC2
 
|-
RESPONSE
RESPONSE
* Then you'll never learn the entry code.
* Then you'll never learn the entry code.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGBrown == 1
* GetIsId  BGBrown == 1
* GetStage BGM001 >= 90
* GetStage BGM001 >= 90
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


We will need to look at altering Browns behaviour for the final release. We will need to add some Ai in the next lesson to get him to run away.
We will need to look at altering Browns behaviour for the final release. We will need to add some Ai in the next lesson to get him to run away.
Line 1,271: Line 1,393:
   EndIf</pre>
   EndIf</pre>


TOPIC
{| border="1" cellpadding="5"
* Greeting
|-
 
TOPIC
RESPONSE
* GREETING
|-
RESPONSE
* I can't help you until you find the key and deed.
* 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.
* 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 >= 80
* GetQuestVariable BGM001.QuestWon == 0
* GetQuestVariable BGM001.QuestWon == 0
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


and
and


TOPIC
{| border="1" cellpadding="5"
* Greeting
|-
 
TOPIC
RESPONSE
* GREETING
|-
RESPONSE
* Hello, Have you managed to recover the deed and key?
* Hello, Have you managed to recover the deed and key?
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGVilanusVilla == 1
* GetIsId  BGVilanusVilla == 1
* GetStage BGM001 >= 80
* GetStage BGM001 >= 80
* GetQuestVariable BGM001.QuestWon == 1
* GetQuestVariable BGM001.QuestWon == 1
 
|-
ADD TOPICS
ADD TOPICS
* none
* none
 
|-
RESULT SCRIPT
RESULT SCRIPT
<ul><li><pre>AddTopic BGTopView</pre></ul>
<pre>AddTopic BGTopView</pre>
|}


(add topic via script to avoid issue with GREETINGS add topic's not appearing in the game)
(add topic via script to avoid issue with GREETINGS add topic's not appearing in the game)
Line 1,312: Line 1,450:
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


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGTopView (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
* BGTopView
* BGTopView
 
|-
RESULT SCRIPT
RESULT SCRIPT
<ul><li><pre>Player.RemoveItem "BGM001HouseDeeduc" 1
<pre>Player.RemoveItem "BGM001HouseDeeduc" 1
SetStage BGM001 110
SetStage BGM001 110
Stage 110 Journal Update</pre></ul>
Stage 110 Journal Update</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.''
''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.''
Line 1,410: Line 1,556:
When the deed has not been completed ( DeedDone == 0) use
When the deed has not been completed ( DeedDone == 0) use


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGTopView (Top View Cottage?)
* BGTopView (Top View Cottage?)
 
|-
RESPONSE
RESPONSE
* I haven't quite finished the paperwork check with me later.
 
* I haven't quite finished the paperwork check with me later.
CONDITIONS
|-
CONDITIONS
* GetIsId  BGVilanusVilla == 1
* GetIsId  BGVilanusVilla == 1
* GetQuestVariable BGM001.QuestWon == 1
* GetQuestVariable BGM001.QuestWon == 1
* GetQuestVariable BGM001.DeedDone == 0
* GetQuestVariable BGM001.DeedDone == 0
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


Once the deed is done you produce this message
Once the deed is done you produce this message


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGTopView (Top View Cottage?)
* BGTopView (Top View Cottage?)
 
|-
RESPONSE
RESPONSE
* Congratulations, you are new the proud Owner of Top View.
* Congratulations, you are new the proud Owner of Top View.
* Here is the paperwork. I'll mark it's location on the map for you.
* Here is the paperwork. I'll mark it's location on the map for you.
* May the gods be with you.
* May the gods be with you.
 
|-
CONDITIONS
CONDITIONS
* GetIsId  BGVilanusVilla == 1
* GetIsId  BGVilanusVilla == 1
* GetQuestVariable BGM001.QuestWon == 1
* GetQuestVariable BGM001.QuestWon == 1
* GetQuestVariable BGM001.DeedDone == 0
* GetQuestVariable BGM001.DeedDone == 0
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
<ul><li><pre>SetStage BGM001 120</pre></ul>
<pre>SetStage BGM001 120</pre>
|}


and add a Journal Update for Stage 120
and add a Journal Update for Stage 120
Line 1,473: Line 1,635:
We can also add the following as an end of quest reply from Vilanus.
We can also add the following as an end of quest reply from Vilanus.


TOPIC
{| border="1" cellpadding="5"
|-
TOPIC
* BGTopView (Top View Cottage?)
* BGTopView (Top View Cottage?)
 
|-
RESPONSE
RESPONSE
* I hope you enjoy the house.
* I hope you enjoy the house.
 
|-
CONDITIONS*  
CONDITIONS*
* GetIsId  BGVilanusVilla == 1
* GetIsId  BGVilanusVilla == 1
* GetQuestVariable BGM001.QuestWon == 1
* GetQuestVariable BGM001.QuestWon == 1
* GetQuestVariable BGM001.DeedDone == 1
* GetQuestVariable BGM001.DeedDone == 1
* GetStage BGM001 >= 120
* GetStage BGM001 >= 120
 
|-
ADD TOPICS
ADD TOPICS
* (none)
* (none)
 
|-
RESULT SCRIPT
RESULT SCRIPT
* (none)
* (none)
|}


We then complete the quest script with a final block to check when the PC arrives at the house. Of course we will need  
We then complete the quest script with a final block to check when the PC arrives at the house. Of course we will need  
Anonymous user

Navigation menu