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

SpeechCenter

I haven't seen any evidence of your stupidity, only the contrary.

Adding a dialog to the internal list should work, I think you need to take care of the ID and name, but it's not difficult. So it should at the very least save your data.

The tree is trickier, I believe each component updates this manually, so I don't think there is an official way to do this. You can try to force a refresh, maybe by creating an event that this component would respond to or hack the tree and add a node, but you'll need to do this exactly the same way the dialog component does and update your plugin if they change it. So for this part it's far from perfect.

Another possible problem may be if the dialog is being edited by the user, you can either tell the user to make sure dialogs are not opened or maybe the same refresh method for the tree can cover this one.

AJA

Yeah, sounds like a Dialog Designer plugin is not going to happen until the API supports this properly.

But thanks for the info! :)

Monsieur OUXX

#42
Hey I'm reviving this topic, because firstly this is a great tool that ought to be known by every AGS user.
And also because I have a question :
At the moment, the tool silently adds an "option-off" after each branch of dialog, to disable them as they're used.
Is there a way to disable that? At the moment this is a blocking issue for using the tool.
EDIT: I didn't notice that the settings were hidden under the "export" submenu. SOLVED.
 

Monsieur OUXX

#43
There's something I don't understand in the tool.

If I understand properly, in AGS, the way to make branched dialogs would be as follows:
- you create a "parent" dialog
- you create a "child" dialog
- Then when the wanted dialog option is chosen in the parent dialog, a call to "goto-dialog" calls the child dialog.
- When the child dialog is finished, you can call "goto-previous" to go back to the parent dialog.

That means, in regular AGS, you need two different dialogs (the parent and the child).

However in Dialog Editor there is this system of children nodes. Therefore I assumed that the children dialogs would be "embedded" in the parent dialog, and that the "goto-dialog" and "goto-previous" calls would be automated.

But it's not the case: When the player clicks on the dialog option that triggers the child dialog/node, then the child dialog options appear, but the parent's dialog options don't disappear: They are also still displayed in the available options. I see all the options from both the parent node and the child node.
What am I doing wrong?
 

AJA

Yes, that's how it currently works. The usefulness of child options comes from having them automatically appear when the parent option has been selected. In order to turn them into child dialogs the system would have to generate some kind of logic for remembering which parent level options were visible when the user moved into the child dialog. Or create multiple dialogs altogether and use AGS's built-in system like you described.

There is a way, sort of, to do what you want. If you put in the parent level option the command #siblings-off, it will show its child options but hide the rest. If there was a #parent-siblings-on command you could use that to return back to the parent level options provided that you hide already selected options with #off-forever. However, there's no such command currently.

Also, I may have lost the source code to this a couple of weeks ago when my hd crashed. :undecided:

Monsieur OUXX

Quote from: AJA on Tue 23/04/2013 17:48:29
I may have lost the source code to this a couple of weeks ago when my hd crashed. :undecided:

That's tragic  :( I was already dreaming of adding some labels for the dialog options, and managing the goto-previous automatically  :~(

Thanks for the help, though! The tool is really really useful for swapping the order of the dialog options. That aspect of regular AGS is archaic.
 

declerfayt

Wow! It's a very cool and handy tool! Thanks a lot AJA :)

That would be awesome to include it into AGS editor. The ability to move dialogs options at will within AGS itself would be a great feature!
Lancelot's Hangover : A whole life to find the Holy Grail. One alcohol night to lose it.

Play free beta // Video trailer // Website

AJA

Good news, everybody! ...Erm, anybody?

I found the source code for Dialog Designer 1.1.3 completely by accident, so I decided to take some time to save this turd in some version control system and try to recreate the fixes and features implemented in versions 1.1.4 and 1.2. So, here we go, the first update in almost four years...

Download v1.2.1

Changes since v1.2

  • Added drag & drop support for opening dialog files.
  • Fixed random crash on startup on Windows 8 (64-bit only?) platform.
  • Fixed ArgumentOutOfRangeException crash when loading MRU list on startup. (Pirate pm'd me about this issue way back in 2013.)
  • FIX REMOVED: The original v1.2 had the following fix which I haven't reimplemented since I have no idea what the problem originally was: Fixed errors in custom dialog line conversion (in both the settings window and the actual conversion).
Also updated the website stub to include the complete changelog: http://www.serpentpictures.net/dialogdesigner/

This release also means that if you guys encounter any issues or have feature requests, just let me know and I'll see if I have some time to work on them at some point. :)


Calin Leafshade

Is the source on github or anything? Maybe some of us could contribute.

AJA

Not sure if I messed with all the correct switches to make it public: https://bitbucket.org/AJA/dialogdesigner

If you feel brave, try out the 1.3-scripting branch that allows you to write simple Lua scripts to make converting dialog lines more flexible. (If you don't have or don't use git, go to https://bitbucket.org/AJA/dialogdesigner/downloads and download the zip; up-to-date binaries are included in the bin\Release directory.)

monkey0506

#51
Quote from: SpeechCenter on Sat 07/04/2012 16:44:06The tree is trickier, I believe each component updates this manually, so I don't think there is an official way to do this. You can try to force a refresh...

Since July 2013 there has been the IRePopulatableComponent interface which is implemented by editor components which can have their child nodes repopulated (e.g., the DialogsComponent). They are not currently exposed, but the IDs for the built-in components are constant and should not ever change, so it's safe to use them directly in your plugin. Together with the IAGSEditor.Components property, you could do something like this:

Code: csharp
public class DialogDesignerComponent : IEditorComponent
{
    private const string DialogsComponentID = "Dialogs"; // AGS.Editor.ComponentIDs.Dialogs
    private IAGSEditor _editor;
    private IRePopulatableComponent _dialogs;

    public DialogDesignerComponent(IAGSEditor editor)
    {
        _editor = editor;
        // ...
    }

    internal IRePopulatableComponent DialogsComponent
    {
        get
        {
            if (_dialogs == null)
            {
                foreach (IEditorComponent component in _editor.Components) // the editor stores these by the base interface, so the very first time we'll need to look up the component
                {
                    // NOTE: using
                    //     foreach (IRePopulatableComponent component in _editor.Components)
                    // will compile, but will throw an InvalidCastException, you have to do it this way instead
                    if (component.ComponentID != DialogsComponentID) continue; // make sure we have a matching component ID
                    _dialogs = (component as IRePopulatableComponent);
                    if (_dialogs != null) break; // and a matching interface, then we're done
                }
            }
            return _dialogs;
        }
    }

    internal void RefreshProjectTree()
    {
        DialogsComponent.RePopulateTreeView();
    }

    internal void RefreshProjectTree(string selectedNode)
    {
        DialogsComponent.RePopulateTreeView(selectedNode);
    }
}


This will force the Dialogs branch to update safely. Note that it will also collapse any folders, so you shouldn't call it unless you are actually adding/removing items. There might be some way to expand the folders from plugins, but I haven't looked into that (yet).




Quote from: AJA on Sun 04/01/2015 01:49:00Not sure if I messed with all the correct switches to make it public: https://bitbucket.org/AJA/dialogdesigner

Yes, I can see it. ;)

Quote from: AJA on Sun 04/01/2015 01:49:00...up-to-date binaries are included in the bin\Release directory.)

You shouldn't put the compiled binaries into the repository -- you should actually add the bin folder to your .gitignore file and upload the binaries separately. BitBucket actually has a "Downloads" page for each repo specifically for hosting these binaries. I had to learn all this the hard way, but if you put the binaries into source control then it keeps every build you commit, bloating the overall size of your repo when other people want to clone it. Instead, keep the source and compiled binaries separate so that cloning the repo is relatively small. Once cloned, anyone can revert their local copy and rebuild or choose to download your prebuilt binaries for older versions.

AJA

QuoteSince July 2013 there has been the IRePopulatableComponent interface which is implemented by editor components which can have their child nodes repopulated (e.g., the DialogsComponent). [...]
Cool. Might have to take a look at some point to see how much work integrating it with AGS will be.

[edit]Well, seems to be working fine with AGS 3.3.3! Just needs some ui for defining the name of the dialog and it's pretty much ready for testing. Pretty good for three hours' work.[/edit]


QuoteYou shouldn't put the compiled binaries into the repository [...]
Yeah, you really shouldn't. Imagine the fun times I had committing ~1GB (uncompressed) binaries of Barely Floating a couple of years back. :)

Anyway, I put them there for convenience reasons since it was a private repo. But since it's not anymore, I figured out some way to automatically upload the binaries to bitbucket whenever I push my changes to the server. Seems to be working ok, unfortunately it doesn't overwrite the old files and I gave up trying to get my script for deleting the old ones working (stupid bitbucket doesn't have a rest api for downloads :(). Anyway, 1.3 branch no longer contains the binaries.

AJA

If anyone's feeling adventurous, here is some sort of a plugin implementation, ready for testing. Documentation hasn't been updated. Requires AGS 3.3.
https://bitbucket.org/AJA/dialogdesigner/downloads/release-1.3-plugin.zip

Backup, backup, backup to be sure you don't break your valuable game. :)

And here's how you use it, roughly:
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.
5. Write your dialog.
6. File -> Export to AGS -> Settings -> Set the dialog name. (In this version, all these settings are dialog file specific!)
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, and hopefully it will work.
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.

Known issues:
- If you re-export a dialog that is already open in AGS (but is not the current active editor pane), the ui is not updated. Instead you need to close and reopen the dialog pane. I didn't find a way to fix this with the current editor plugin API since it has no way of accessing all the open editor panes. The active editor pane (if it's the dialog you're re-exporting) should be correctly updated.

monkey0506

Quote from: AJA on Tue 06/01/2015 13:56:25Known issues:
- If you re-export a dialog that is already open in AGS (but is not the current active editor pane), the ui is not updated. Instead you need to close and reopen the dialog pane. I didn't find a way to fix this with the current editor plugin API since it has no way of accessing all the open editor panes. The active editor pane (if it's the dialog you're re-exporting) should be correctly updated.

I submitted a fix to the plugin API for this. It was fixed after the AGS 3.4.0.3 alpha, but anything from AGS 3.4.0.4 (doesn't exist as of this writing, but that should be the next build number) or higher should allow you to access IGUIController.Panes, a read-only list of the currently open panes (as ContentDocuments).


daniel

hey there,

i realize this thread is very old...but i didn't find any newer threads about this tool and it seems very useful.
is this still being developed? or are there any alternatives?
the reason i'm asking is because i can't seem to import the dialogs created with this directly into my project file.

it says it exported successfully but the dialog doesn't appear in my project tree. did anybody get this to work with the latest AGS?

i realize i can import the dialog manually but it would be nice to be able to tweak the dialog inside this tool and then quickly update it in AGS.

AJA

Did you try the version with editor plugin support, a couple of posts above?

Anyway, I found a couple of crashes from the plugin export when I tried it now. Should be working now, and since no one has mentioned any issues with the earlier plugin version (or no one tried it), I'm bravely assuming this is good enough for a release. So, without further ado:

Download 1.3.0!

Changes:
* Added an AGS Editor plugin that simplifies editing and exporting changes to your project.

daniel

thanks aja i'll give it a shot:)

quick update:
works like a charm aja. such a great tool! :)
this is gonna save a lot of time! thank you very much!

p.s. what would be even more awesome is if you could make changes to the dialog in AGS and those changes would carry over to the dialog designer:)

Cassiebsg

Geez... 2009? How did I not saw this? I've been wanting something like this since I made my first dialogues and realized I can't re-order them without major work...

Or better yet, how come this isn't distributed with official AGS release? Maybe as a "essential tools pack" or something.  ???
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk