Author Topic: Dialog Reading/Editor source  (Read 2217 times)

Offline Ganado

  • Moderator
  • Dishonest Abe
Dialog Reading/Editor source
« on: July 07, 2014, 04:25:32 am »
I'll admit I didn't search that hard, but I couldn't find any info about it, so...

Is the source code the Dialog Editor (any version) available? I kinda just want to see in code how it parses and navigates through the files, was trying to make my own little "dialog menu" just for fun.

I already had an idea of how it would load a chain, just save each number as a separate string when it reads through the dialog file the first time, and then calls a function to load the string at the given number etc etc, but just thought I'd ask. Also wondering when it actually loads the dialog file for the player, as in does it load it once when dialog is initialized, or does it need to reload the file after each choice (although the latter seems quite inefficient than loading the whole file into memory beforehand).

Edit: I've been saying "Editor" but this would also just apply to the actual code the engine uses to parse the dialog file, not just how the editor itself reads it (though I really doubt that would be available).
« Last Edit: July 07, 2014, 06:11:35 am by Ganado »
Error while opening cfg file: spawnnpc.cfg
Shit! Damn admins! Always ruining my fun! I guess I'll talk to them. WITH MY FISTS!!!! No seriously, I will write them a nice email or make a thread on the forums or something. Thanks!

Offline Wipe

  • Rotator
  • Random is god
Re: Dialog Reading/Editor source
« Reply #1 on: July 08, 2014, 10:30:40 am »
For parsing example you may want to check FOCommon - Dialog/*, Parsers/Dialog*

As for loading, it's done once at server start - there are hardcoded ~functions to (re)load them, but dunno if they're fixed - and texts from them sent to client in cache; server need to send just dialog/node/answers IDs, plus lexems, not the whole thing. Not 100% sure about cache thingy, but i remember it being that way in at least one place.
Games are meant to be created, not played...

Offline Ganado

  • Moderator
  • Dishonest Abe
Re: Dialog Reading/Editor source
« Reply #2 on: July 09, 2014, 02:56:45 am »
Thanks a lot.
Error while opening cfg file: spawnnpc.cfg
Shit! Damn admins! Always ruining my fun! I guess I'll talk to them. WITH MY FISTS!!!! No seriously, I will write them a nice email or make a thread on the forums or something. Thanks!