A Development Tutorial: Chapter 07: Difference between revisions

From FOnline: Reloaded Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
| authors = Slowhand
| authors = Slowhand
| chapter = 07: Tracking Quest Progress
| chapter = 07: Tracking Quest Progress
| chapters = [[A Development Tutorial|Title Page]]<br>[[A Development Tutorial: Chapter 01|Development Kit Setup]]<br>[[A Development Tutorial: Chapter 02|Making Maps]]<br>[[A Development Tutorial: Chapter 03|The World Map Editor]]<br>[[A Development Tutorial: Chapter 04|NPC Dialogues]]<br>[[A Development Tutorial: Chapter 05|Create a 2-Map Zone]]<br>[[A Development Tutorial: Chapter 06|Monsters, Loot, and Scripts]]<br>'''Tracking Quest Progress'''<br>[[A Development Tutorial: Chapter 08|Scenery Scripts]]<br>[[A Development Tutorial: Chapter 09|Dialogue-to-Quest Location]]<br>[[A Development Tutorial: Chapter 10|Locations: Public to Private]]<br>[[A Development Tutorial: Chapter 11|Setup of Scripting Environment]]<br>[[A Development Tutorial: Chapter 12|Understanding Quest Scripts]]<br>[[A Development Tutorial: Chapter 13|A Simple Quest]]<br>[[A Development Tutorial: Chapter 14|Dialogue: The "SAY" Menu]]<br>[[A Development Tutorial: Chapter 15|Modifying Some Basic Mechanics]]
| chapters = [[A Development Tutorial|Title Page]]<br>[[A Development Tutorial: Chapter 01|Development Kit Setup]]<br>[[A Development Tutorial: Chapter 02|Making Maps]]<br>[[A Development Tutorial: Chapter 03|The World Map Editor]]<br>[[A Development Tutorial: Chapter 04|NPC Dialogues]]<br>[[A Development Tutorial: Chapter 05|Create a 2-Map Zone]]<br>[[A Development Tutorial: Chapter 06|Monsters, Loot, and Scripts]]<br>'''Tracking Quest Progress'''<br>[[A Development Tutorial: Chapter 08|Scenery Scripts]]<br>[[A Development Tutorial: Chapter 09|Dialogue-to-Quest Location]]<br>[[A Development Tutorial: Chapter 10|Locations: Public to Private]]<br>[[A Development Tutorial: Chapter 11|Setup of Scripting Environment]]<br>[[A Development Tutorial: Chapter 12|Understanding Quest Scripts]]<br>[[A Development Tutorial: Chapter 13|A Simple Quest]]<br>[[A Development Tutorial: Chapter 14|Dialogue: The "SAY" Menu]]<br>[[A Development Tutorial: Chapter 15|Basic Mechanics]]
}}
}}



Revision as of 20:01, 20 January 2017

A Development Tutorial: Chapter 7
Get the developer tools and try building new content for this game!
Season {{{season}}}
Status wip
Completion 75%
Authors Slowhand
This Chapter 07: Tracking Quest Progress
More Chapters Title Page
Development Kit Setup
Making Maps
The World Map Editor
NPC Dialogues
Create a 2-Map Zone
Monsters, Loot, and Scripts
Tracking Quest Progress
Scenery Scripts
Dialogue-to-Quest Location
Locations: Public to Private
Setup of Scripting Environment
Understanding Quest Scripts
A Simple Quest
Dialogue: The "SAY" Menu
Basic Mechanics
Notes {{{notes}}}


The next important thing with dialogues is to track the progress of a given quests. For this, we will need to create a game variable, track it through the dialog and through other actions of the player as well.

Step by Step:

  • Make a quest variable:
    • Launch DialogEditor, use the Vars editor tabpage on the top.
    • Enter a fitting name, (like "q_tut1" - q for quest, tut1 for tutorial1)
    • Enter a unique number for Num, one that is not used, for easy access I used 3, but a number in higher range should be used.
    • Set the radio box to Local, leave the checkboxes unchecked.
    • Click Add.
  • If it fails, this is how you can make it the harder way:
    • Open for edit the variable text-file list in your server's script forlder: Server\scripts\_vars.fos
    • Add the following lines at their respective places (use your unique Num, not mine which was 3):
    • Add the header lines somewhere at the start of the text file, keeping the ordering by Num:
      • #define LVAR_q_turo (3)
    • Add the body lines somewhere where similar lines are, exact place depending on your Num:
      • $ 3 1 q_turo 0 0 1000 0
      • **********
      • TuRo progress.
      • **********
  • Create or modify your dialog to support the new quest variable:
    • Add a new Dialog with an Answer, which will end the dialog.
    • To the Answer add a Result, which will set the new quest variable to 10.
    • Add a new Answer to Predialogue Installations, which will lead to a dialog, that will be the progress of the quest.
    • Add a Demand to this answer, that requires the quest variable to be 10.


This is how it looks at my end:

(image soon)

On the above picture, the tutorial robot will check if the quest variable (q_turo_prog) is 10, which means that the player has reached a point in the conversation with the robot, where the robot will ask him, to gather some flint and use his Fix-Boy to make a primitive tool.

(image soon)

On the above picture, the tutorial robot will ask the player to make a primitive tool and to mark the progress so far, will set the quest variable to 10, and exit the dialog. Next time when the player talks to the robot, it will jump to dialog 9 where the robot asks if the task is done. Here the robot checks if the player has a primitive tool on him, and will progress further if so.

This was only a part of the Tutor Robot quest, but enough to point out the example, how to progress using a quest variable. Of course, other dialogues would lead to incrementing or setting back to quest variable to other values, and because of the Predialogue installation Answer Demands, the right dialog will be selected for the current progress of the quest.