A Development Tutorial: Chapter 07

From FOnline: Reloaded Wiki
Jump to: navigation, search
A Development Tutorial: Chapter 7
Get the developer tools and try building new content for this game!
Season All Seasons
Status Progress Stopped
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
Chapter 10
Setup of Scripting Environment
Understanding Quest Scripts
Chapter 13
Dialogue: The "SAY" Menu
Chapter 15
Lockpick Cooldown
Repeatable Locations
Floating FA Text
Roulette Game
Dialogues vs Scripts
Simple Kill Quest
Chapter 21
Mysterious Stranger Perk
Perk Installation
Black Jack Game
Black Jack Installation
Sound Effects
Pro Tips
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.