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 13:59, 4 December 2008
, 13:59, 4 December 2008GetQuestStage -> GetStage, use of UL's all over
imported>DragoonWraith m (Reverted edits by Anubis4545 (Talk); changed back to last version by DragoonWraith) |
imported>DragoonWraith (GetQuestStage -> GetStage, use of UL's all over) |
||
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 | 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 | |||
ADD TOPICS | ADD TOPICS | ||
BGRedRose | * BGRedRose | ||
RESULT SCRIPT | RESULT SCRIPT | ||
* (none) | |||
TOPIC | 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 | |||
ADD TOPICS | ADD TOPICS | ||
RESULT SCRIPT | * (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 | 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 | |||
ADD TOPICS | ADD TOPICS | ||
BGSmith | * BGSmith | ||
RESULT SCRIPT | RESULT SCRIPT | ||
* (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 227: | Line 230: | ||
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 | 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 | |||
ADD TOPICS | ADD TOPICS | ||
* (none) | |||
RESULT SCRIPT< | RESULT SCRIPT | ||
Player.Additem "PotionCyrodiilicBrandy" 1<br /> | <ul><li><pre>Player.Additem "PotionCyrodiilicBrandy" 1<br /> | ||
Player.RemoveItem "BGPartialLetter" 1<br /> | Player.RemoveItem "BGPartialLetter" 1<br /> | ||
Player.RemoveItem "BGCourierKey" 1<br /> | Player.RemoveItem "BGCourierKey" 1<br /> | ||
Player.RemoveItem "BGEmbossedAmulet" 1<br /> | Player.RemoveItem "BGEmbossedAmulet" 1<br /> | ||
SetStage BGM001 60 | SetStage BGM001 60</pre></ul> | ||
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 279: | Line 283: | ||
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 | 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 | |||
* (none) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (none) | |||
The next bit of the quest is a bit tricky. | The next bit of the quest is a bit tricky. | ||
Line 302: | Line 309: | ||
Let’s do that now. | Let’s do that now. | ||
TOPIC | 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) | |||
We then check the '''Info Refusal''' flag. | We then check the '''Info Refusal''' flag. | ||
Line 478: | Line 486: | ||
MessageBox "Some Message that appears in the Box”, Option A, OptionB, OptionC | MessageBox "Some Message that appears in the Box”, Option A, OptionB, OptionC | ||
''OptionA selected GetButtonPressed=0 | * ''OptionA selected GetButtonPressed=0'' | ||
OptionB selected GetButtonPressed=1 | * ''OptionB selected GetButtonPressed=1'' | ||
OptionC selected GetButtonPressed=2'' | * ''OptionC selected GetButtonPressed=2'' | ||
The value selected and assigned to the variable Button is then used in the third part of the script. | The value selected and assigned to the variable Button is then used in the third part of the script. | ||
Line 523: | Line 531: | ||
We adjust its value using topics called BGBrandy, BGBrandyChoice1, and BGBrandyChoice2 | We adjust its value using topics called BGBrandy, BGBrandyChoice1, and BGBrandyChoice2 | ||
TOPIC | 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 | * (in Choices) | ||
** BGBrandyChoice1 | |||
** BGBrandyChoice2 | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (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 550: | Line 561: | ||
Add another quest variable to the quest script called DoNextBrandy | Add another quest variable to the quest script called DoNextBrandy | ||
TOPIC | 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< | RESULT SCRIPT | ||
<ul><li><pre>Set BGM001.BrandyTalk to 1 | |||
Set BGM001. DoNextBrandy to 1</pre></ul> | |||
The second response info reads | The second response info reads | ||
TOPIC | 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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
<ul><li><pre>Set BrandyTalk to 1 | |||
Set DoNextBrandy to 2</pre></ul> | |||
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 590: | Line 602: | ||
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 | 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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (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 | 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. | ||
Watch out for Blair he is a nasty bit of work. | * Watch out for Blair he is a nasty bit of work. | ||
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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
<ul><li><pre>SetStage BGM001 70</pre></ul> | |||
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 637: | Line 652: | ||
''Smith has given me a key for the Red Rose Brigades hideout. I should go to the hideout and see if I can recover my uncle's Key and House Deed.'' | ''Smith has given me a key for the Red Rose Brigades hideout. I should go to the hideout and see if I can recover my uncle's Key and House Deed.'' | ||
RESULT SCRIPT | |||
<ul><li><pre>Player.Additem "BGHideoutKey" 1 | |||
ShowMap BGCaveMapMarker</pre></ul> | |||
==Red Rose Hideout Phase== | ==Red Rose Hideout Phase== | ||
Line 855: | Line 870: | ||
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 | CONVERSATION | ||
BGMBlairGreet | * BGMBlairGreet | ||
RESPONSE | 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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (none) | |||
When the PC kills Blair we can then update the journal | When the PC kills Blair we can then update the journal | ||
Line 878: | Line 895: | ||
Initially we set up a greeting. | Initially we set up a greeting. | ||
TOPIC | TOPIC | ||
Greeting | * Greeting | ||
RESPONSE | 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 | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (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 | 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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
<ul><li><pre>SetStage BGM001 100</pre></ul> | |||
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 921: | Line 941: | ||
SetQuestObject BGPartialLetter 0 | SetQuestObject BGPartialLetter 0 | ||
TOPIC | 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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (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,249: | Line 1,271: | ||
EndIf</pre> | EndIf</pre> | ||
TOPIC | TOPIC | ||
Greeting | * Greeting | ||
RESPONSE | 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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (none) | |||
and | and | ||
TOPIC | TOPIC | ||
Greeting | * Greeting | ||
RESPONSE | 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 | |||
RESULT SCRIPT< | RESULT SCRIPT | ||
<ul><li><pre>AddTopic BGTopView</pre></ul> | |||
(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,287: | Line 1,312: | ||
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 | 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 | |||
SetStage BGM001 110 | |||
Stage 110 Journal Update</pre></ul> | |||
''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,385: | Line 1,410: | ||
When the deed has not been completed ( DeedDone == 0) use | When the deed has not been completed ( DeedDone == 0) use | ||
TOPIC | 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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (none) | |||
Once the deed is done you produce this message | Once the deed is done you produce this message | ||
TOPIC | 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) | |||
RESULT SCRIPT< | RESULT SCRIPT | ||
<ul><li><pre>SetStage BGM001 120</pre></ul> | |||
and add a Journal Update for Stage 120 | and add a Journal Update for Stage 120 | ||
Line 1,445: | Line 1,473: | ||
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 | 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) | |||
RESULT SCRIPT | RESULT SCRIPT | ||
* (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 |