FOnline Development > Questions and Answers

Teleporting through dialog

(1/5) > >>

Marten Broadcloak:
Hello everyone,

I'm making this FOnline solo project, and I'm a total noob when it comes to programming. Therefore, my project only requires one bit of script, something that would allow for the player to be teleported to another map/location when he chooses the right dialog line while talking to a NPC. Anyone knows if it is possible and how to do it? (Please keep in mind I'm very, very, very nooby!)

Edit: and a bonus question while I'm at it: I remember there was a file where you basically were able to disable FOV line of sight, turn your mod into singleplayer, etc, anyone remembers which file it is?

Ghosthack:
Hi,

Take a look at this dialog: https://github.com/rotators/fo2238/blob/master/Server/dialogs/event_teleporter.fodlg

There are a few functions in this https://github.com/rotators/fo2238/blob/master/Server/scripts/event_utils.fos#L135 script that can do teleporting via dialog.

About singleplayer, take a look at this http://fodev.net/forum/index.php?topic=29612.0
Another file you probably want to take a look at is config.fos: https://github.com/rotators/fo2238/blob/master/Server/scripts/config.fos

There's no good scripting tutorial in english that doesn't assume knowledge in programming, so you'll at least need some knowledge of C-like languages to be comfortable with AngelScript.
Hope that helps a little.

Marten Broadcloak:
Thank you very much Ghosthack. I will take a thorough look at this.

I agree with your warning, it is obvious that developing a FOnline project without C# or Angelscript knowledge will be tough, but I hope I will encounter few problems and that they will be easy to solve if I ask the community the right questions.

Marten Broadcloak:
I feel I'm going to have a lot of questions in the coming weeks, but I'm keeping them all in this topic to avoid spamming new threads.

Hey Ghosthack, I made some progresses on some issues and finally got to look at the files. For now I've been trying to cleanup the SDK a bit to suit my simple needs, and I didn't get to the dialogs yet.

Config.fos sure raised a lot of questions. The most pressing matter, though, is that of the FOV. Basically, config.fos reads this:


--- Quote ---    // Look modifiers
    __LookChecks = 0;                                 // See Look checks in _defines.fos
    SETFLAG(__LookChecks, LOOK_CHECK_DIR);            // Nerfe look by directions of look
    __LookDir0 = 0;                                   // Nerf 0% of look radius with direct look
    __LookDir1 = 20;                                  // Nerf 20% of look radius with front side look
    __LookDir2 = 40;                                  // Nerf 40% of look radius with back side look
    __LookDir3 = 60;                                  // Nerf 60% of look radius with back look
    __LookDir4 = 60;                                  // UNUSED. Nerfe 60% of look radius with back look (Square geometry)
    SETFLAG(__LookChecks, LOOK_CHECK_SNEAK_DIR);      // Nerfe opponent sneak by directions of look
    __LookSneakDir0 = 72;                             // Nerf %dp% of opponent sneak with direct look
    __LookSneakDir1 = 36;                             // Nerf %dp% of opponent sneak with front side look
    __LookSneakDir2 = 12;                             // Nerf %dp% of opponent sneak with back side look
    __LookSneakDir3 = 0;                              // Nerf %d% of opponent sneak with back look
    __LookSneakDir4 = 0;                              // UNUSED. Nerf 0% of opponent sneak with back look (Square geometry)
--- End quote ---

From there, of course, I took a look at _defines.fos:


--- Quote ---// Look checks
#define LOOK_CHECK_DIR                           (0x01) // Nerfe look by directions of look
#define LOOK_CHECK_SNEAK_DIR                     (0x02) // Nerfe opponent sneak by directions of look
#define LOOK_CHECK_SNEAK_WEIGHT                  (0x04) // Nerfe sneak by current weight
#define LOOK_CHECK_TRACE                         (0x08) // Tracing for wall aviablility
#define LOOK_CHECK_SCRIPT                        (0x10) // Allow bool check_look(...) in main.fos, all other defines ignored
#define LOOK_CHECK_ITEM_SCRIPT                   (0x20) // Allow bool check_trap_look(...) in main.fos, for items with ITEM_TRAP flag
--- End quote ---

It got me really confused. Like, what is _defines.fos doing? Is it taking action prior to config.fos, or after that? And why is it not just a part of main.fos then? Many questions. Not really important ones. Because, of course, there's the dreaded client_fov.fos. By the content of this file, I reckon you rotators have coded an entire new FOV system from scratch. The problem is, I see no switch to turn it off and I'm starting to wonder: did you erase the old no-FOV way in the process, and should it be coded from scratch again if one decided to disable FOV, or is it the engine's default view? If so, how to turn it back on? Removing the whole Look code from the three files just prevents the server from booting.

P.S. If I die while I'm still young, please tell my family this forum's captcha got me. Seriously, this is suicide material.
P.P.S. Almost forgot. Proof that the development is going smoothly! Or, well, starting smoothly. Right?

fonliner:
If I can ask... what do you do? ;) Is it Oil Rig Enclave base from Fallout 2, isn't it?

Navigation

[0] Message Index

[#] Next page

Go to full version