Suggestion: SetOptionText(int option, String text)

Started by Dusk, Mon 22/09/2008 15:15:57

Previous topic - Next topic

Dusk

I'm very happy to see the dialog-system related improvements in the recent versions.
I found particularly useful Dialog.DisplayOptions(), and I think I'll try soon the custom rendering functions added in the last beta.

While scripting the logic for a dialog using DisplayOptions, I thought that it would have been nice being able to specify the dialog options in the script too, and not to be forced to use the "Dialog" tab of the editor and its textboxes. If I'm not forgetting anything, it's the last dialog-related thing that you can't do by scripting...

So I was wondering if would it be easy to add a
Code: ags

SetOptionText(int option, String text, optional bool show = true, optional bool say = true)

function, that could solve the issue and help who wants to implements his custom dialog system on top of AGS.
For example, using a single dummy dialog and this function, combined with arrays/structs/Strings, I think that we could implement some nice stuff related to complex dialogues.

Pumaman

Hmm, well if you want to set the dialog text up manually in the script, and have all your own custom script for doing all the dialog stuff, then you could argue that you should just ignore the built-in stuff completely and write your own dialog system.

Would anyone else find it useful to be able to change the dialog option text at run-time? Currently the save games don't include this information, and so to implement this would involve having to persist more data in memory.

Dusk

Quote from: Pumaman on Mon 22/09/2008 21:28:41
Hmm, well if you want to set the dialog text up manually in the script, and have all your own custom script for doing all the dialog stuff, then you could argue that you should just ignore the built-in stuff completely and write your own dialog system.

Mmm I thought about it but in that way you're forced to write the code to render the options screen too. And that part is now also customizable by the new functions, so it's a pity to not to take advantage of it.

IMHO it's a bit the complement of the new custom rendering functions. Now if you're satisfied by the text data/logic part, you can alter just the rendering part.
But if you're ok with the rendering, you can just partially take control of the logic with scripting using DisplayOptions: you can't setup the text of the options to display.

Quote
Would anyone else find it useful to be able to change the dialog option text at run-time? Currently the save games don't include this information, and so to implement this would involve having to persist more data in memory.

Uhm I can see the problem... similar to the custom properties alteration at runtime thing.
And what about approaching differently the problem? I mean, having an alternate version of DisplayOptions that takes as argument the options to display (a case where being able to pass an array of string would be useful).
Or you could add a CustomDialog object that extends the normal Dialog one offering SetOptionText. So that only who needs the feature would instance a CustomDialog in the script, and you'd just save those in the savegames, avoiding general savegames-bloating. Too messy?

Feel free to ignore me following your AGS-priorities :)

D.

Pumaman

It could certainly be done, the question is, is it something that anybody else needs? :)

Khris

This'd be perfect for the MI-style fencing module I've been working on.
Currently, one has to put the insults and answers into a string array, then put them once more in the two dialogs.

Thinking a bit further, if it was possible to create new dialogs/dialog options in-game, there could be a dialog_request_advanced(Dialog*d, int option) to handle them.

TheJBurger

Sorry for the bump -- but you can add 1 more to the list of people who want to see this implemented. Otherwise, I'd have to create a kind of semi-complicated 'checking' script to use multiple dialog options when I could have just renamed one and saved all the trouble.

SMF spam blocked by CleanTalk