TOOL: Dialog Designer - Version 1.3.0 (2017-05-24) - Direct Editor Export

Started by AJA, Sun 13/12/2009 00:17:02

Previous topic - Next topic

AJA

Hello, everyone!

I'd like to present to all of you a very special Christmassy utility that I mostly made in August, then forgot about it, and now finally finished for release. It's called...

Dialog Designer

Dialog Designer is a utility to help design and write dialog scripts. It contains many useful features that make the process easier and faster. Also, since it's a separate utility, it allows you to collaborate between other writers without needing to use AGS and still being able to preview the dialogs and see if they even work like they're supposed to.





I can already write dialogs with AGS. Why should I use this?

Well, in addition to the points I made earlier, you've probably sometimes been frustrated when you've had to add new dialog options to your dialog, and you have to go through a big hassle if you want to place them somewhere else than the bottom of the list. Those days are over now! With Dialog Designer you can add options anywhere you want and you can organize them into a tree that clearly shows the structure of your dialog.

Even better, you can move and delete options, and Dialog Designer keeps track of all the references made to any options. Let's say you have two options and in the first one you turn on the second one (option-on 2). Now, if you move the second one above the first one, the reference is automatically changed (option-on 1). I bet you can already see the time saved flashing before your eyes. If, on the other hand, it's your life flashing, I really can't help you with that.

There's also a bunch of custom script commands that work as shortcuts to a bigger bunch of AGS script commands.


How exactly is this going to make collaboration on writing scripts easier?

By allowing you to preview the dialog directly in Dialog Designer! In order to support more complex stuff, you can also define variables and use them in your dialog with custom script commands. The dialogs are saved into basic XML files and can be shared easily.


XML files? How am I supposed to get them into AGS?

That's easy! To setup the included AGS Editor plugin, you need to do the following:

1. Copy AGS.Plugin.DialogDesigner.dll to your AGS directory.
2. Run AGS, open your project.
3. Double click Dialog Designer node in the project explorer tree.
4. Select Dialog Designer.exe.

Then you can start writing dialogs and exporting them directly to AGS:

5. Write your dialog.
6. File -> Export to AGS -> Settings -> Set the dialog name.
7. Make sure AGS is open and your project is loaded.
8. In Dialog Designer, select File -> Export to AGS -> AGS Plugin (or Ctrl+E)
9. Switch to AGS, there should be a pop-up saying the dialog was imported successfully. You should see the dialog in your tree view.
10. To edit a dialog that you've already imported, open the dialog in AGS and double click on Dialog Designer in the project explorer tree.

You can also export the dialog in two other ways, either only the script into a text file or the entire dialog directly into your AGS project. If you choose to export into a text file, you will have to manually create or modify the dialog options in AGS. This step can be eliminated by exporting directly into your AGS project file. You can choose to create a new dialog or replace an existing one if you're only doing an update.


I'm still not convinced.

Then I guess you can f*ck off. Seriously though, what more do you need? Oh, maybe the ability to convert normal dialog speech lines to some other format, like Character.Say calls, during export? That's very much possible with Dialog Designer.




Features
Okay, now that we're done with the marketing speech, let's recap the main features:

- Dialog options are organized in a treeview that clearly shows the structure of the dialog
- Syntax highlighted dialog script editor
- Dialog preview
- Basic AGS dialog script commands work in the preview: option-on, option-off, option-off-forever
- Additional script commands that make writing scripts even easier
- Automatic dialog option reference management
- Variables and showing dialog options automatically if a specified condition is true
- Exports AGS compatible dialog scripts. If conditions or other advanced functionality is used, the minimum required AGS version is 3.1.1.
- Dialog speech line conversion




Known issues

- File -> Export to AGS -> Project does NOT work with AGS 3.4 due to changes in the project file structure. Please use the editor plugin instead.





If you're ready to give it a go, make sure you have the required .NET Framework 2.0 installed.

>> Download Dialog Designer << New version 1.3.0!

Change log available here: http://www.serpentpictures.net/dialogdesigner/




Feel free to post if you have any problems, comments, suggestions or bug reports!
I wish you all a very productive Christmas or any other holiday that may or may not be happening in the near future!

monkey0506

My only question would be, why a separate tool and not an editor plugin?

AJA

So you don't need AGS. Plus I don't think it's possible to do this without changes to the plugin api. At least I wasn't able to find a way to update the project tree, and the dialogs seemed to be cached somewhere rather than read from the project structure every time.

hedgefield

This is amazing, thanks so much!

monkey0506

Quote from: AJA on Sun 13/12/2009 00:42:25So you don't need AGS.

I guess that's a fair reason to keep it available as standalone program. :P

Quote from: AJA on Sun 13/12/2009 00:42:25Plus I don't think it's possible to do this without changes to the plugin api. At least I wasn't able to find a way to update the project tree, and the dialogs seemed to be cached somewhere rather than read from the project structure every time.

I don't know what you mean by "update the project tree" exactly. You mean that once dialogs have been added/removed AGS doesn't reflect that? Coz I know you can create both parent and child nodes using the existing API functions. As for the dialogs being cached, I don't know about that, but I'm sure if you asked CJ he could probably implement a way to read them from the project instead of the cache.

In any case, nice tool. How does it work with, for example, the new ability to do normal scripting in dialogs? Does it allow that? Obviously I wouldn't expect it to try and compile it or anything, but just curious whether it detects it as AGS script or gets confused what you're doing.

Also regarding the conditions, how does that work? Does it allow the condition to be based on AGS script such as player.HasInventory(iKey) or does it create variables for its own conditions? Again I wouldn't expect it to verify the authenticity of AGS script, just wondering on that....

AJA

Quote from: monkey_05_06 on Sun 13/12/2009 15:12:52
I don't know what you mean by "update the project tree" exactly. You mean that once dialogs have been added/removed AGS doesn't reflect that?

Yes, that's the problem.

QuoteAs for the dialogs being cached, I don't know about that, but I'm sure if you asked CJ he could probably implement a way to read them from the project instead of the cache.

Well, maybe he'll read this thread. :P I don't really want to bother him with this. Not yet anyway.


QuoteIn any case, nice tool. How does it work with, for example, the new ability to do normal scripting in dialogs? Does it allow that? Obviously I wouldn't expect it to try and compile it or anything, but just curious whether it detects it as AGS script or gets confused what you're doing.

Normal scripting is highlighted in the script editor in italics and won't be run during preview. So no problem using normal scripting.


QuoteAlso regarding the conditions, how does that work? Does it allow the condition to be based on AGS script such as player.HasInventory(iKey) or does it create variables for its own conditions? Again I wouldn't expect it to verify the authenticity of AGS script, just wondering on that....

If you want to use them in the preview, you can create a variable named "player.HasInventory(iKey)" and assign a value to it in the variables window. For now variables can only be integers, at least for the preview to work. Then you can modify its value with custom script commands and use it in dialogs. If you don't create the variable, then... the preview will apparently crash. Heh. I'll get that fixed. Anyway, those custom script commands will be converted to AGS if-statements (etc.) when you export the script.

For example, you have dialog option A and it has a child option B. B is set to be shown if a condition is true: "player.HasInventory(iKey)". This won't actually work in the preview, since it's a boolean value and not an integer, but it should be converted just fine during export. When that dialog is exported the condition is converted to these lines of script for dialog option A:
Code: ags

  if (player.HasInventory(iKey)) {
option-on 2
  }



I hope this clarifies some things. I'll get those "undefined variables" bugs fixed asap.

monkey0506

#6
Cool, though I'm still a bit confused regarding the conditions. You say the variables can only be integers, how do the conditions work? I would assume you would have implementations of the standard conditional operators (==, !=, >, >=, <, and <=) but then all of those evaluate as boolean and you said that "player.HasInventory(iKey)" wouldn't work in the preview "since it's a boolean and not an integer". How then are the conditions evaluated?

I actually would expect "player.HasInventory" to be ignored for the preview (unless as you say a variable as such was defined and given a value) and just treated as false (or 0 to be an integer). I'm not expecting your tool to implement full AGS scripting of course. :P So if it helps, I would expect it to just be ignored by the preview, but still implemented in AGS.

AJA

#7
Okay, the undefined variables bug should now be fixed. I've uploaded a new version, see first post.


Quote from: monkey_05_06 on Sun 13/12/2009 18:04:41
Cool, though I'm still a bit confused regarding the conditions. You say the variables can only be integers, how do the conditions work? I would assume you would have implementations of the standard conditional operators (==, !=, >, >=, <, and <=) but then all of those evaluate as boolean and you said that "player.HasInventory(iKey)" wouldn't work in the preview "since it's a boolean and not an integer". How then are the conditions evaluated?

Sorry, I should have been a bit more specific: the current condition parser doesn't recognize boolean literals, only integers. Every variable name is replaced with its value, resulting in something like: "1 == 0 || 2 < 3", which the parser can handle. "0 || 2 < 3" or "false || 2 < 3" doesn't work. Of course an easy way to include boolean literal support is to actually replace those variables with "1==1" for true and "1==0" for false. This might be implemented in a later version.

QuoteI actually would expect "player.HasInventory" to be ignored for the preview (unless as you say a variable as such was defined and given a value) and just treated as false (or 0 to be an integer). I'm not expecting your tool to implement full AGS scripting of course. :P So if it helps, I would expect it to just be ignored by the preview, but still implemented in AGS.

If the preview is allowed to ignore it, you can just write it as normal AGS script (obviously, this doesn't work with "show on condition" but the whole point of that is to affect the preview):
Code: ags

  if ( player.HasInventory(iKey) )
    doSomethingNasty();

instead of the custom command for defined variables:
Code: ags

#if ( player.InventoryQuantity[iKey.ID] > 0 ) { blah; }

Plus this one works only with dialog script commands. It's there for the ability to control the flow of the dialog based on variables and nothing else.

-edit-
On second thought, I'll probably make it so that if any invalid conditions or undefined variables are found during preview, errors will be shown for the user only after the preview has ended. I think that's the easiest way to let you ignore them and still give the necessary feedback in case they were actual mistakes.

hedgefield

Hey AJA, I've been using your DiDes for a bit now, and I quite like it indeed! Just a few qualms I've found while using it:

- Clicking directly on the dialog option in the tree does not let me edit it, only double-clicking in the text field does? And that only works if the text field is empty?

- There's nowhere to set if a dialog option should be spoken or not. I use that distinction quite a lot for my dialogs.

- A minor thing, but, I use the hack of adding a blank dialog option at the end to force dialogs to always show the option selection GUI always, even if there is only one option. But in AGS this option would not be visible if you leave it blank, but here it is (and selectable).

AJA

Thanks, I'm glad you find it useful! :)

Quote
- Clicking directly on the dialog option in the tree does not let me edit it, only double-clicking in the text field does? And that only works if the text field is empty?

Huh? Works fine for me. When a dialog option is selected in the tree and you click on it and wait a bit it goes into edit mode. F2 does the same.


Quote
- There's nowhere to set if a dialog option should be spoken or not. I use that distinction quite a lot for my dialogs.

I never use that feature so that's why I didn't include it. But yeah, I can add it if you need it. I figured it would be used mostly out of laziness to type the line twice, so that's why you can right click on the script and automatically copy the first line of dialog to the option text to keep it easily up to date. I don't think that's even mentioned in the help file... lousy documentation, I admit.


Quote
- A minor thing, but, I use the hack of adding a blank dialog option at the end to force dialogs to always show the option selection GUI always, even if there is only one option. But in AGS this option would not be visible if you leave it blank, but here it is (and selectable).

Oh, I wasn't aware of this hack. I'll change this behavior to match AGS in the next version. Also, I think I probably should have a "game.show_single_dialog_option" checkbox somewhere.


I'm not promising anything but I'll probably have enough free time early next week to get a new version released.

hedgefield

Oh cool, thanks for the info :)

I was gonna try out your suggestions, but I can't seem to be able to open the editor anymore. It throws some System.AccessViolationException error about trying to read or write protected memory?

AJA

Yay, that's the same error my friend got on Windows 7. I guess I'll have to investigate this further.

hedgefield

#12
Allright, I'll PM you the error report. I'm on Vista btw.

AJA

Thanks for the report! As I'd thought, it's apparently a problem with WinAPI calls, so I guess I'm going to have to do some extra work to eliminate the need for those.

AJA

Okay, I've uploaded a new version that might fix the crash (check the first post). I haven't been able to test it myself since it's always worked for me. Try it out and see if it works now.

hedgefield

Cheers, works fine now!

And yeah so does:
QuoteWhen a dialog option is selected in the tree and you click on it and wait a bit it goes into edit mode. F2 does the same.

AJA

Yay, I'm glad it works!

New version is up with some of the suggestions implemented: "say" checkbox if you want the option title spoken automatically, condition/variable errors during preview are now only warnings, boolean variables are now supported. Also, script editor undo/redo functionality has been added, it may or may not work as expected. :P I've encountered some very minor glitches only.

Thanks for all your enthusiasm, largopredator! Especially since you're currently the only user I'm aware of. Actually, I'm secretly happy this hasn't got any more attention than it has, since that usually means less bug reports and less work for me. :) On the other hand, it's a bit puzzling since the internal dialog editor drives me nuts. Anyway, the point of this rant is, if you haven't tried it yet, give it a go and see for yourself how much easier it'll make your life*.

*) Doesn't make your actual life easier, just the dialog writing aspect of it.

Ketskari

largopredator isn't the only one; I love the Dialog Designer. :) And I definitely appreciate the undo/redo function. Thanks for the great tool!

Kweepa

Yes, thanks, this is very cool.
I haven't used it in earnest yet but when I need to write some dialogs I'll be booting this up!
Still waiting for Purity of the Surf II


SMF spam blocked by CleanTalk