April 27, 2024, 12:20:15 am
Username:

Password:

Topic: Re: 3. Adding new locations to the world, using the World editor.  (Read 956 times)

zekromo

  • Posts: 213
  • 𝓲𝓽'𝓼 𝓪𝓵𝓵 𝓲𝓷 𝔂𝓸𝓾𝓻 𝓱𝓮𝓪𝓭
    • View Profile
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.
👑 👑 👑 👑 👑 👑 👑 👑 👑
👑 👑 👑 Moloch 👑 👑 👑
👑 👑 👑 👑 👑 👑 👑 👑 👑



Represent Discord Crew:

cthulchu

  • Supporter
  • Posts: 212
    • View Profile
Re: Basic Development Tutorial for FOnline. (Reloaded)
« Reply #1 on: August 09, 2017, 01:41:23 am »
about the 8th thing - scenery scripts.

Here's what I get:

Code: [Select]
[01:58:161] ProtoMap::BindSceneryScript - Map<pid<131>, name<se_oasis_cave_cth>>, Can't bind scenery function<s_Disassemble> in module<se_oasis.fos>. Scenery hexX<209>, hexY<101>.Do I have to register my .foses in some scripts.cfg? I think you missed it.

Here's my script:

Code: [Select]
//  Includes some definitions
#include "_macros.fos"
#include "_dialogs.fos"
//  Function signature for player interactions with Scenery objects
bool s_Disassemble(Critter& player, Scenery& robot)
{
return RunDialog(player, 31338,false);
}

I'm trying to run a dialog on use of the robot. I figured it would be too tedious to write all the logics for the repair and science functions, so why not a dialog for starters.

Here's what the compile.bat gives me:
Code: [Select]
Compiling:
'ascompiler.exe' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .
« Last Edit: August 09, 2017, 01:43:53 am by cthulchu »

cthulchu

  • Supporter
  • Posts: 212
    • View Profile
Re: Basic Development Tutorial for FOnline. (Reloaded)
« Reply #2 on: August 14, 2017, 07:41:47 pm »
I was creating some tricky scripted dialogues and found a nice manual on them. Slowhand, you could improve your dialogue manual with this info: http://docs.fonline.ru/page_dialogvars.html (russian)

//upd

The DialogEditor is bugged. Not only it's incapable of trivial editing/saving of the variables, it can't delete the strings and, which is a lot more important, it can easily corrupt more complex dialogues. You will spend hours debugging.
« Last Edit: August 15, 2017, 05:42:45 am by cthulchu »