Text Dialog System

Started by Atelier, Sat 25/06/2011 14:11:49

Previous topic - Next topic

Atelier

Hi, I began a custom dialog function but there are a few problems.

Here it is so far..

Code: ags

function BeginDialog(Dialog* d)
{
    int i = 1;
   
    d.Start();     //Begins dialog
    gDialog.Visible = false;    //I need the options to not be visible, ie, the options don't appear to the player. gDialog is a custom text window GUI


    //Add all the options in the dialog to my display box:

    while (i <= d.OptionCount)
    {
         if (d.GetOptionState(i) == eOptionOn) Add(String.Format("%d - %s", i, d.GetOptionText(i)), 3);
         i++;
    }

}


So it appears like this




1 When the dialog starts, how can I hide the options that appear automatically, but keep the parser box remaining? Because the options are labelled with their ID, you can choose them by typing 1, 2, 3, etc.

2 I notice there's no "d.ChooseOption(1)" command. How can I get it to simulate clicking on one of the options, except you choose the options through the parser?

I still want to be able to use

Code: ags

@1
...
return

@2
...
stop


this from the dialog editor, but have options chosen through the parser. I can use dialog_request, but does this mean I have to write out all the responses in the globalscript? Thanks!

monkey0506

Look up the custom dialog rendering options and DialogOptionsRenderingInfo functions and properties in the manual first of all. Also, any lines in your dialog script that are preceeded by a single whitespace character are treated as normal script commands.

I don't have the manual handy at the moment, but you can then use the parser result like you normally would for dialogs.

Atelier

I tried DialogOptionsRenderingInfo, and although doing it that way would have some benefits it defeated the object.
The benefit is that I can position and size the parser so it goes over my current text box (because it is disabled when the dialogue starts).

But, the dialog options need to be drawn to the screen anyway, and I couldn't work out how to hide them.

It appears I won't be able to do what I want... unless there's something I overlooked.

monkey0506

The DialogOptionsRenderingInfo's ParserWidth, ParserX, and ParserY options aren't sufficient for you to position and size your text parser?

Also if you upgrade to AGS 3.2.1 then there's the Dialog.ShowTextParser property so you can enable/disable it via the script.

Atelier

Quote from: monkE3y_05_06 on Sat 25/06/2011 17:25:46
The DialogOptionsRenderingInfo's ParserWidth, ParserX, and ParserY options aren't sufficient for you to position and size your text parser?

No that is the benefit ;D I'll do some more fiddling and see what comes up ;)

monkey0506

Oh, I see what you're trying to do now. ::)

What you're trying to accomplish is very tricky with no way to run an individual option's script without actually clicking on it. Simulating is technically feasible, but it's..wonky..at best, and doesn't work if you have a parser. You could manually script the parser too..but there's a lot of room for error in working around things that way.

Being able to use the parser to type in an option's number and then run that option script is not going to be easy right now. :-\

Atelier

Ok thanks. I'll just use a different method. Also just out of interest, is there a list of changes/improvement to be made in AGS 4.0? I know it's a community effort now.

SMF spam blocked by CleanTalk