A Development Tutorial: Chapter 09

From FOnline: Reloaded Wiki
Revision as of 19:55, 20 January 2017 by Henry (talk | contribs)
Jump to navigation Jump to search
A Development Tutorial: Chapter 9
Get the developer tools and try building new content for this game!
Season {{{season}}}
Status wip
Completion 75%
Authors Slowhand
This Chapter 09: Dialogue-to-Quest Location
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
Modifying Some Basic Mechanics
Notes {{{notes}}}


Creating new quest location from dialog.

After receiving a quest from an NPC, the NPC might in some cases mark a location on the player's map. This location will be known only to the player, and a red dot on the world map will appear. Once the player finished the quest (talks with the quest-giver and succeeds), the location will disappear.

Step by Step:

  • Create map data and location:
    • Open World Editor
    • Press Ctrl+M (Tools->Mapdata Editor) and Add New Map:
      • Set a name for the map data (I used: q_generated)
      • Set a unique ID (130)
      • Set the filename of the map you want to use. You probably need to make a new map with Mapper for this purpose, but for demonstration existing ones can be used.(q_tut1_out)
      • Save.
    • Press Ctrl+L (Tools->Location Editor) and Add New Location:
      • Set a name for the location. (q_tut1_loc)
      • Set a unique Id. (91)
      • Add the previously made mapdata to it. (q_generated)
      • Save
    • Save the World and exit
  • Create the script:
    • Create a file with the contents given below in the source tags and save it.(Server\scripts\quest_generateMap.fos)
    • Open "Server\scripts\scripts.cfg" with notepad, find the "quest-specific" area, and add an extra line to include the new script in the build/bind process. ("@ server module quest_generateMap")
    • Try out if the script compiles: Server\scripts\compile.bat quest_generateMap.fos
  • Create the dialog:
    • First you need to create a local variable (local if you set it on player, unique if u set it on NPC) to store the location ID which will be generated, so you can delete after it's not needed.(Recycling is important if you want to keep your server up for more than a few hours.)
      • Edit "Server\scripts\_vars.fos".
      • Add the header line to it's respective place (use unique number, I used 4):
        • #define LVAR_q_gen_loc (4)
      • Add the body lines to their respective places:
        • $ 4 1 q_gen_loc 0 0 1000 0
        • **********
        • Generated location progress.
        • **********
    • Create the dialog to look like on the below picture. (this is for demonstration purposes only)
    • On one of the answer you will have to add a Result, which will call the script function to create the map location.
    • When completing the quest, don't forget to call the script function which will delete the map location.
  • Do a clean on scripts as well, delete world save and launch server, client to try it out.


Here is the basic dialog, it's crude but only for demonstration of usage:

(image soon)

Here is the script that will spawn a location on the map and will delete it afterwards when triggered:

(image soon)