I just realised that there is a way to implement this with the existing AGS. It relies on the fact that if there is only one enabled dialog option, then that one only will be played automatically.
However, I haven't tested this! It may not work, depending on what happens if you try and access non-existent dialog options with the GetDialogOption and SetDialogOption functions... maybe CJ could provide a GetTotalOptions(int dialog) or a global variable/array...?
function RunDialogOption(int topic, int option)
{
char saveopt[30];
int i=0;
// Keep record of current dialog option state
while (i<30) {
saveopt=GetDialogOption(topic, i);
SetDialogOption(topic, i, 0);
i++;
}
SetDialogOption(topic, option, 1);
RunDialog(topic);
// Now restore saved dialog options
while (i>=0) {
SetDialogOption(topic, i, saveopt);
i--;
}
}
However, I haven't tested this! It may not work, depending on what happens if you try and access non-existent dialog options with the GetDialogOption and SetDialogOption functions... maybe CJ could provide a GetTotalOptions(int dialog) or a global variable/array...?
function RunDialogOption(int topic, int option)
{
char saveopt[30];
int i=0;
// Keep record of current dialog option state
while (i<30) {
saveopt=GetDialogOption(topic, i);
SetDialogOption(topic, i, 0);
i++;
}
SetDialogOption(topic, option, 1);
RunDialog(topic);
// Now restore saved dialog options
while (i>=0) {
SetDialogOption(topic, i, saveopt);
i--;
}
}