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 03:08, 31 July 2010
, 03:08, 31 July 2010→At the Cottage: Changing the responses
imported>Pyrocow2 (→At the Cottage: Changing the scripts) |
imported>Pyrocow2 (→At the Cottage: Changing the responses) |
||
Line 30: | Line 30: | ||
We have seen how to use a limited amount of scripting to progress our quest. While there is loads more dialogue to include in this part of the quest, we will focus far more on the use of scripting. | We have seen how to use a limited amount of scripting to progress our quest. While there is loads more dialogue to include in this part of the quest, we will focus far more on the use of scripting. | ||
==At the Cottage== | |||
We cannot rely on dialogue to progress our quest because the courier is dead. | We cannot rely on dialogue to progress our quest because the courier is dead. | ||
Line 106: | Line 106: | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
!colspan=2| '''BGCluesFound''' | |||
|- | |- | ||
! TOPIC | ! TOPIC TEXT | ||
| | | "Clues" | ||
|- | |- | ||
! RESPONSE | ! RESPONSE | ||
| | | "I recognize this amulet! It bears the mark of a gang of thieves that call themselves the Red Rose Brigade." | ||
|- | |- | ||
! CONDITIONS | ! CONDITIONS | ||
| | | | ||
* GetIsId BGCptHubart == 1 | * GetIsId 'BGCptHubart' == 1 | ||
* GetStage BGM001 == 50 | * GetStage 'BGM001' == 50 | ||
|- | |||
! OPTIONS | |||
| | |||
*Say Once | |||
|- | |- | ||
! ADD TOPICS | ! ADD TOPICS | ||
Line 125: | Line 128: | ||
|- | |- | ||
! RESULT SCRIPT | ! RESULT SCRIPT | ||
| | | | ||
<pre> | |||
Player.RemoveItem "BGPartialLetter" 1 | |||
Player.RemoveItem "BGEmbossedAmulet" 1 | |||
Player.RemoveItem "BGCourierKey" 1 | |||
</pre> | |||
|} | |} | ||
The script simulates Cpt. Hubart taking the clues and key from us. The "Say Once" option should be checked because we only want this dialogue and script to run once (obviously), but our condition checks won't ensure that as is. We haven't changed the stage or anything like that. | |||
If the player only has one of the clues, this response will be available: | |||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
!colspan=2| '''BGCluesFound''' | |||
|- | |- | ||
! TOPIC | ! TOPIC TEXT | ||
| | | "Clues" | ||
|- | |- | ||
! RESPONSE | ! RESPONSE | ||
| | | "I need more to work with." | ||
|- | |- | ||
! CONDITIONS | ! CONDITIONS | ||
| | | | ||
* GetIsId BGCptHubart == 1 | * GetIsId 'BGCptHubart' == 1 | ||
* GetStage BGM001 | * GetStage 'BGM001' == 40 | ||
* GetQuestVariable 'BGM001.HasAmulet' == 1 ''OR'' | |||
* GetQuestVariable 'BGM001.HasPaper' == 1 ''OR'' | |||
|- | |- | ||
! ADD TOPICS | ! ADD TOPICS | ||
| | | ''No add topic'' | ||
|- | |- | ||
! RESULT SCRIPT | ! RESULT SCRIPT | ||
| | | ''No script'' | ||
|} | |} | ||
This is the first time we've checked the ''OR'' flag on a condition. If any of the ''OR'' conditions are true, we basically get a TRUE for that entire set of ''OR'' conditions. So if the player has either the amulet or the paper, the stage is 40, and the actor is Cpt. Hubart, this response will show up. The ''OR'' statements by themselves would also work if we had BOTH of the objects (both would be true), but because we already would have changed the stage to 50 in that case, the stage condition here fails and eliminates the response. (50 != 40) | |||
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. | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
!colspan=2| '''BGRedRose''' | |||
|- | |- | ||
! TOPIC | ! TOPIC TEXT | ||
| | | "Red Rose Brigade" | ||
|- | |- | ||
! RESPONSE | ! RESPONSE | ||
| | | | ||
* They | * "They're a nasty bunch led by a couple of villains named Blair and Brown." | ||
* | * "They have a hideout in the mountains." | ||
* | * "If you want to find them, your best bet is to talk to an ex-member named Smith." | ||
* I | * "I'm surprised... I never took Brown for a killer." | ||
|- | |- | ||
! CONDITIONS | ! CONDITIONS | ||
Line 176: | Line 190: | ||
|- | |- | ||
! RESULT SCRIPT | ! RESULT SCRIPT | ||
| | | ''No script'' | ||
|} | |} | ||
Line 185: | Line 198: | ||
{| border="1" cellpadding="5" | {| border="1" cellpadding="5" | ||
!colspan=2| '''BGSmith''' | |||
|- | |- | ||
! TOPIC | ! TOPIC | ||
| | | "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 | * "He's partial to a drop of brandy. Here, this might help loosen his lips." | ||
|- | |- | ||
! CONDITIONS | ! CONDITIONS | ||
| | | | ||
* GetIsId | * GetIsId BGCptHubart == 1 | ||
* GetStage BGM001 == 50 | * GetStage BGM001 == 50 | ||
|- | |- | ||
! ADD TOPICS | ! ADD TOPICS | ||
| | | ''No add topic'' | ||
|- | |- | ||
! RESULT SCRIPT | ! RESULT SCRIPT | ||
| | | | ||
<pre>Player.Additem "PotionCyrodiilicBrandy | <pre> | ||
Player.Additem "PotionCyrodiilicBrandy" 1 | |||
SetStage BGM001 60 | |||
</pre> | |||
SetStage BGM001 60</pre> | |||
|} | |} | ||
Line 218: | Line 228: | ||
Add this to the Stage 60 journal entry. | Add this to the Stage 60 journal entry. | ||
''I should travel to Aleswell and talk to ex Red Rose Gang member Smith. He may be able to help me locate the gangs hide out'' | ''I should travel to Aleswell and talk to ex Red Rose Gang member Smith. He may be able to help me locate the gangs hide out'' | ||
==Aleswell Phase== | ==Aleswell Phase== |