General > Features & Articles

Basic Development Tutorial for FOnline.

(1/7) > >>

Slowhand:
This is a brief development tutorial for developing FOnline. In the tutorial I use the FOnline: Reloaded version of the SDK, but it should be fully compatible with the original SDK.
(Note: As we found out, everything is not compatible, especially scripts. If you plan to follow this tutorial, make it easier on yourself and use the Reloaded version, see first step for install instructions)

Another copy of this tutorial can be found at FOnline: Reloaded but I belive you need to log into the forums to be able to see it.

Basic Development Tutorial for FOnline.

* This is a brief tutorial on how to get started developing FOnline.Contents:

* Downloading and setting up the Development Kit (FOnline: Reloaded).
* Modifying existing maps with the Mapper.
* Adding new locations to the world, using the World editor.
* Adding dialogues for NPC's.
* Creating a two map zone.
* Adding monsters, loot and using some basic scripts.
* More on dialogs: Tracking quest progress.
* Creating and using some basic scripts: Scenery scripts.
* Creating new quest location from dialog.
* Accessing a private location from a public location scenery. (Ladder)
* Setting up the scripting environment.
* Understanding a full quest script. (LA Boneyard dog quest)
* A simple kill target critter quest.
* Using the "Say" menu from dialogues. (Riddle mini quest.)
* Modifying base mechanics - Only the easy parts.

* Modifying lock pick cooldown mechanic.
To do list:

* Separate advanced stuff and add it to a new thread, advanced tutorials. Everything that is not step by step should be advanced, as most people get lost too easy. (Pepe)
* Add a small simple quest, step by step style, where the objectives is to kill a nearby critter for the quest giver. (no need to generate a new private map for it) (Pepe)
* Add a guessing game, step by step style, where the player has to guess riddles, using the "Say" menu to give the answer, instead of selecting from possible dialogue options. (Coro)

Slowhand:
1. Downloading and setting up the Development Kit.


* Download the SDK

* Download the Server and Mapper and the full Client.
* Keep these 2 zip files for later use, because if you mess things up very badly while experimenting (I did), u can just start over from here.
* Copy the Client, Mapper, Server, Tools folders from the zip files to your development folder.
* Setting up the Mapper: (don't use yet)

* If you start the Mapper for the first time, it will use the default video resolution, which is set in the client. Unfortunately, this will trim down the Mappers interface, so the first thing you should do, is launch the FOConfig.exe in the Client folder and set the resolution to at least 1024*768.
* I also advise you to disable Full Screen.
* Save and Exit.
* Try out if it works

* Start the Server and wait for the scripts/everything to load, when it's done, you will see something like this: ***   Starting game loop   ***
* Start the Client, create new char, log in. If no errors, then you are done with the setup.
* If you got problems with this part, you might try to set up your environment again, if it fails, search Questions and Answers at fodev.net.

Slowhand:
2. Modifying existing maps with the Mapper.

Another easy step, is to modify and existing map and check the effects.

* Load the map and get around

* Launch Mapper and load the map of The Hub
* Press enter after mapper started to get the console.
* Type: "~hub" - to load the map.
* Press F8 to disable mouse scrolling. (This can be very annoying, since even if the Mapper does not have focus, it will try to scroll while you are working with other apps.
* Press Enter again, when the command line is empty, so the command line disappears, now you can use the arrow keys to scroll around.
* Modify and save the map.

* After you find the northen entrance of the hub, try to delete some NPC's and some vagons. Also try to add a car and an NPC.
* To select something, just click on it. To delete the selected item, press del.
* To place NPC's, go to Humanoids and there click on the tab again, to filter them. Find one that suits you and place it on the map. To place it on the map, make sure u don't have anything else selected, click on it, then move your mouse over the map you want to place it, right click, then left click. You can use middle mouse button to rotate the element.
* Type: "^hub" - to save(overwrite) the map.
* Delete the old map's cache

* Go to the Server/Maps folder and find the two map files: hub.fomapb and hub.fomap.
* Delete hub.fomapb. (Make sure u keep the hub.fomap file. Alternatively you can use the clean.bat before starting the server, which will delete all binary? map files so when the server starts it will generate them.)
* In order for changes to take effect, you will need clear the world saves.

* These are some files in the Server/Save folder, usually named like "world0001.fo".
* If you do not delete these files, then only some changes will take effect, like map design, but not NPCs, items, or anything that is not static.
* Check your work.

* Start the server, start the client, and check the effects.
* You should see your modified Hub map, with the missing NPC's and vagons, and the extra NPC's, cars u added.

Slowhand:
3. Adding new locations to the world, using the World editor.

This isn't hard as well, but here u can mess things up pretty easy if you click around while experimenting.

* First things first, before you forget, delete the world save files. I always forget this and launch the server two times bc of this.
* Launch Mapper and open a map to copy from, I used: tent_mountain (Type in console: "~tent_mountain")
* Add a new robot NPC (critters->others->Robobrain)
* Save the map: "^tut_map1"
* Go to the Server\Maps forlder, you should have a new map file here named: tut_map1.fomap
Now, time to place this map on the world.

* Launch the World editor located in the Tools folder. (You might need to get .NET framework v4, this is a freely downloadable framework for Windows, don't be affraid of it, programs written in C# use it. Most Windows Service  Packs have it, so you probably won't have to dl it.)
* Add the new map:
* Press Ctrl+M (or in the menu Tools->Mapdata Editor) and Add New Map
* Name your nap: Tutorial1
* Press Assign Free PID (but the default 128 should be free as well)
* Browse the map file recently made (..\Server\Maps\tut_map1.fomap)
* Save.
* Add the new location:
* Press Ctrl+L (or in the menu Tools->Location Editor) and Add New Location
* Name the location: Tut_Loc1
* Assign a free PID. (Default 90 should work fine as well)
* Set size to 6. (24 is a town size green cirle, 6 or 8 should be small enough)
* Set max players to 0. (In case you leave it at 1, and you test it later with multiple chars, they won't be able to enter until the one inside leaves.)
* Set description ("A strange robot in the middle of the wastes")
* Set visibilty: Check Visible.
* Add Map: Sort by PID, scroll to 128 and select the recently made map, Tutorial1.
* Save and exit Location Editor.
* Set the location on world map:
* Press Ctrl+A (menu Worldmap->Add Location)
* Sort by PID, scroll to 90 and find your recently added location named Tut_Loc1
* Add this location. Now you can place your location on the map, place it near the spawning point for easier testing.
* Check what you done, by searching the map in World Editor near Hub, your new location should appear.
* Save the world map, press Ctrl+S (menu: File -> Save) and exit World Editor.Test what you have done. Make sure you delete the World saves, start server, launch client and with a new char you should see the new tutorial location nearby.

Slowhand:
4. Adding dialogues for NPC's

Okay, let's continue, developing our newbie tutorial. This robot shall give usefull information for newbies who never played any FOnline games and are used to the original Fallout1/2/3/New Vegas etc games. So, our robot shall teach the newbies how to be self sufficient, how to gather resources, harvest, make tents etc. Ofc if they want to. It should introduce the old quality of questing/talking to NPC's where the NPC reacted to the Players stats, actions etc.

Step by step:

* Launch the Dialog Editor (Tools\DialogEditor)
* Create a new dialog by pressing the Add Tree. Name your dialog engl. (This isn't actually it's name, but it's language type, it should be "engl" always, unless you want the dialog in a different language, but don't ask me about it)
* You will get a node named Predialogue Installations. This node is responsible for the initial reaction of the NPC to the player.
* For now let's make a new dialog. On the botton, select Dialog tabpage. For text enter the text the NPC will say, for example: "The robot scans you briefly then greets you. Hi. I'm TuRo MKI.". Edit the dialog number to a unique number, this time 200, and Add Dialog.
* This dialog will need answers as well, from which the player can choose from. Select the newly added dialog, on the botton select answer tabpage, and add two answers:

* First answer with text: "Hi yourself Robot.", set the radio button to Other->Close dialog. This will make your robot interactive, but NPC's only have one option, to leave the conversation at first answer.
* Second answer with text: "Hi. I'm lost.", set the radio button to On dialog and leave the number at default value or set it to 200. This answer might generate an infinite loop, bc it will always get the player back to where the Robot says Hi. In order to advance the dialog we need more dialoges, but for presentation purposes this should do.
* Now set the predialogue installations. Add an aswer to it: "I dont know you" and link it so, that the answer takes the player to the first dialog (200). This will make the Robot react to the players by always saying Hi.
* To give a meaning to the "I dont know you" answer, we can introduce a demand constraint. Go to Demands,select Var: "name_mem_npc_player", set the equation sign to "==" and enter the value "0".
* Add a Result to this answer as well: Var "name_mem_npc_player", set the equation sign to "=" and enter "1" for value. Also select NPC from the radio box and add the Result.
* This way we made our Robot to interract with each NPC only once.
* Other contrains can be made as well, like required strenght, or intellect, or simply make the robot talk at a different level of language if the player has low intellect. The example below shows this.
* Save the dialog with a name you remember, for example: tut_dialog1.fodlg
* For next step, we need to link the dialog with the Robot.

* First, you need to edit the file named dialogs.lst in Server\Dialogs to include the new dialog. Just copy a line and give a unique ID for the dialog file, I used 2100. Try to keep the order and structure of this dialogs list file.
* Use the Mapper to add this dialog to the Robot. Simply select the robot, and at dialogs enter this number.
* Save the map, delete world save files, launch server, try.
I made a little bit more complex dialog for my robot, feel free to understand it and try it. Basically the robot detect the players Intellect and greets him accordingly. The player can gather some extra information if he has high perception. The successfull scenario ends in the robot giving the player a task to gather him flint, so the robot can teach him how to craft a tool.

Here is how it looks. (click on images for normal size)


Navigation

[0] Message Index

[#] Next page

Go to full version