fodev.net

FOnline Development => Questions and Answers => Topic started by: Ganado on July 07, 2014, 04:25:32 am

Title: Dialog Reading/Editor source
Post by: Ganado 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).
Title: Re: Dialog Reading/Editor source
Post by: Wipe on July 08, 2014, 10:30:40 am
For parsing example you may want to check FOCommon (https://github.com/rotators/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.
Title: Re: Dialog Reading/Editor source
Post by: Ganado on July 09, 2014, 02:56:45 am
Thanks a lot.