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

Jump to navigation Jump to search
no edit summary
imported>AbundantGeekery
imported>Isom
Line 125: Line 125:
We want to display different messages depending on what combination of clues we have. There are four possibilities leading to four simple IF statements.
We want to display different messages depending on what combination of clues we have. There are four possibilities leading to four simple IF statements.


The values of the new variable MessageStage are just so we can clearly tell them apart.
The values of the new variable MessageState are just so we can clearly tell them apart.
   
   
I chose 100, 50, 25, and 10. It could be any number you like.  
I chose 100, 50, 25, and 10. It could be any number you like.  
You will need to declare the variable MessageStage first.  
You will need to declare the variable MessageState first.  
Do this and then type this script, once again inside the Begin End block.
Do this and then type this script, once again inside the Begin End block.


Line 150: Line 150:
The first message state can be ignored because we don’t need to prompt them again to search for clues.
The first message state can be ignored because we don’t need to prompt them again to search for clues.


  If (DoM2Once == 0) && (MessageStage == 50)
  If (DoM2Once == 0) && (MessageState == 50)
   MessageBox "I have found a strange amulet. I should continue to look for clues"
   MessageBox "I have found a strange amulet. I should continue to look for clues"
   Set DoM2Once to 1
   Set DoM2Once to 1
  EndIf
  EndIf
   
   
  If (DoM3Once == 0) && (MessageStage == 25)
  If (DoM3Once == 0) && (MessageState == 25)
   MessageBox "I have found a torn document. I should look for more clues"
   MessageBox "I have found a torn document. I should look for more clues"
   Set DoM3Once to 1
   Set DoM3Once to 1
Line 162: Line 162:
The final situation does not require a MessageBox. As the quest journal can convey the message. But we do need to bump the quest stage. Again create stage 50 first.
The final situation does not require a MessageBox. As the quest journal can convey the message. But we do need to bump the quest stage. Again create stage 50 first.


  If (DoM4Once == 0) && (MessageStage == 10)
  If (DoM4Once == 0) && (MessageState == 10)
   Set DoM4Once to 1
   Set DoM4Once to 1
   SetStage BGM001 50
   SetStage BGM001 50
Anonymous user

Navigation menu