This information mostly applies to Co8 scripters (and the technically inclined): A lot of the "legacy" scripts are already converted to a fresher format or the engine recreation project (JavaScript Object Notation -> JSON). After running the converter, you'll find a file called scripts.zip in the data directory. If you want to look at the converted scripts, extract that file and look at the corresponding ".js" files inside it. Since the JSON notation is heavily "cramped" and outright unreadable (you can open it with a text editor, but it really is ugly), I cobbled together a small program that formats the JSON files into human readable text. Here it is: http://www.hartte.de/JSONFormat.exe (Required .NET 2.0) Just drag a JSON .js file onto it to convert it. Example of a converted dialog script (00010farmer old faith.dlg): http://pastebin.com/1CEuArRL (Before formatting) http://pastebin.com/HT28zp0h (After formatting) If you have any questions/comments/suggestions regarding the conversion of old data, please post here. Regards, Storm
Comments: 1. While the formatted text is certainly more readable than the "machine generated" text, it's hard to get an overview of the dialogue and its flow since it's very spaced out. E.g. the first 7 lines of the ToEE formatted dialogue, which encompass a fairly simple "greetings" exchange, now stretch out to almost 50 lines. 2. One thing I really hated about the dialogue system, is that if you had a voiced NPC, inserting new dialogue responses was next to impossible. If you could insert a "play sound file X" property for NPC responses, or something like that, it would be great. That way if I wanted to "shift" the dialogue nodes, I wouldn't have to alter all the sound files. 3. Alternately, one idea I toyed with in the past is a graphic dialogue tree editor that abstracted all of that away (ultimately including most of the dialogue scripting / state machine work). It'd be quite a complex project, though, at least for an amateur like me. (wink, wink, nudge, nudge)
Hi Sitra, thanks for the feedback. Yes, normally you shouldn't need to edit JSON files directly, since the engine can parse the "compressed" ones quicker. Although it's possible to do so for a quick fix or similar things. I also plan to actually modify the dialog format, now that I have figured it out: Code: { '1': { text: 'Hello I am the NPC!', femaleText: 'And you are female...', voiceOver: 'filename of voiceover mp3', femaleVoiceOver: 'filename of female voiceover mp3', action: 'some javascript code', answers: [ { text: 'Hello', intelligence: 8, // Why isn't this in the guard anyway? guard: '...', action: '...', nextId: '....' }, ....... ] } } The voiceover filenames would also be unproblematic since answers don't have an ID anymore, so they can't conflict with the NPC line ids. And yes, the JSON files have one gigantic advantage: You can parse and write them from within web-pages with zero effort, so creating editors would now be easily possible as web-pages which should make this even easier... I'll get on it as soon as I have more of the gameplay working ;-) Regards, Storm