Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Carles on Tue 09/01/2024 08:21:21

Title: Refresh dialog options - Tumbleweed template [SOLVED]
Post by: Carles on Tue 09/01/2024 08:21:21
Hi!

Let's see if you can help me with a small problem with the dialog options. It turns out that if the player must choose between many options, and therefore must use the down arrow of the dialog guide a lot, the next time the dialog options are displayed it remains anchored in that position, for example in the option of 5 or 6. And it is possible that they are empty and that the player does not see anything and must use the up arrow several times to see the new dialog options.

Is there any way to force the dialog options to refresh and thus avoid this little problem?

Thanks in advance.
Title: Re: Refresh dialog options
Post by: Khris on Tue 09/01/2024 08:55:35
Are you using custom dialog code or a module?
Title: Re: Refresh dialog options
Post by: Carles on Tue 09/01/2024 09:02:32
I'm just using the Tumbleweed template.
Title: Re: Refresh dialog options
Post by: Crimson Wizard on Wed 10/01/2024 09:50:36
Quotethe next time the dialog options are displayed it remains anchored in that position, for example in the option of 5 or 6. And it is possible that they are empty and that the player does not see anything and must use the up arrow several times to see the new dialog options.

This is not an expected behavior at all.
This sounds like a serious bug either in template or the engine (I do not know how Tumbleweed's dialog options are made).

I might also suggest to put the template's name into the topic title, because this may be relevant.

Please also tell, which version of AGS are you using, in case that matters? (also will help to know the version of Tumbleweed template)
Title: Re: Refresh dialog options
Post by: Carles on Wed 10/01/2024 10:05:00
I am using version 3.5.1.

I don't know where the version of the template is indicated, but it is the one that came by default with that version of the engine.
Title: Re: Refresh dialog options - Tumbleweed template
Post by: Khris on Wed 10/01/2024 10:14:10
The Tumbleweed template uses a "simplified fork of CDG" (CustomDialogGui). I looked at the code and tried for a few minutes to come up with a quick fix but gave up because the relevant variables aren't that well documented / named.
It uses CDG_options.scroll_from and CDG_options.scroll_to for instance, and I suspect the fix needs to reset those, but I wasn't in the mood for shotgun debugging.
Title: Re: Refresh dialog options - Tumbleweed template
Post by: Crimson Wizard on Wed 10/01/2024 10:38:46
Tumbleweed template is maintained by @abstauber , perhaps it's worth messaging him,
or report either in the dedicated forum thread:
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/template-tumbleweed-verbs-1-4/
or in its repository here:
https://github.com/dkrey/ags_tumbleweed/issues
Title: Re: Refresh dialog options - Tumbleweed template
Post by: Carles on Wed 10/01/2024 11:18:00
I'll send him a message to see if he can help us.
Title: Re: Refresh dialog options - Tumbleweed template
Post by: abstauber on Wed 10/01/2024 11:32:40
Hi,
before I start digging deeper into this issue: Is this option present in your version of the template and set to true?

TemplateSettings.asc
  // Always begins the dialog with the first option available
  CustomDialogGui.DialogGuiOptions[eDialogGui_reset_scrollstate] = true;
Title: Re: Refresh dialog options - Tumbleweed template
Post by: Carles on Wed 10/01/2024 11:36:33
Hi!

Yes, it is present and set to true.
Title: Re: Refresh dialog options - Tumbleweed template
Post by: abstauber on Wed 10/01/2024 11:50:23
Hmm.. I'm having trouble replicating the issue with the current version of the template. But in the revision history I see that a bug has been fixed two years ago.

I'm pretty sure that the code is backwards compatible. In case you didn't change the module, could you please try to update it with these most recent files?
https://raw.githubusercontent.com/dkrey/ags_tumbleweed/master/CustomDialogGui.asc
https://raw.githubusercontent.com/dkrey/ags_tumbleweed/master/CustomDialogGui.ash

(and of course make a backup of the old files)
Title: Re: Refresh dialog options - Tumbleweed template
Post by: Carles on Wed 10/01/2024 12:12:26
It gives me this error:

CustomDialogGui.asc(396): Unknown preprocessor directive 'else'

It's here:

// Get viewpoint
#ifdef SCRIPT_API_v3507
  vp_width = Screen.Width;
  vp_height = Screen.Height;
#else
vp_width = System.ViewportWidth;
vp_height = System.ViewportHeight;
#endif
Title: Re: Refresh dialog options - Tumbleweed template
Post by: eri0o on Wed 10/01/2024 12:23:19
Get viewpoint
#ifdef SCRIPT_API_v3507
  vp_width = Screen.Width;
  vp_height = Screen.Height;
#endif
#ifndef SCRIPT_API_v3507
vp_width = System.ViewportWidth;
vp_height = System.ViewportHeight;
#endif

Else clause in the preprocessor is added only in 3.6.1.

Also why are you using 3.5.1 ?
Title: Re: Refresh dialog options - Tumbleweed template
Post by: Carles on Wed 10/01/2024 13:08:34
Thank you! I've been testing and it seems to have been solved.

What happens is that now another problem has appeared. In this new version of CustomDialogGui it seems that the texts used change color and by default they are painted black. The background that I use is black and they cannot be seen, only when you move the cursor over it because they change color.

I have been looking in the TemplateSettings, but the option to change the color for the texts already used does not appear, only these two options appear:

 
  CustomDialogGui.DialogGuiOptions[eDialogGui_text_color] = 23420;
  CustomDialogGui.DialogGuiOptions[eDialogGui_text_color_active] = 24188;
 

How could I fix this?

Thank you!

I'm using this version simply because it's the one I started this project on, and I haven't updated it.
Title: Re: Refresh dialog options - Tumbleweed template
Post by: Carles on Wed 10/01/2024 13:23:26
Well, I think that's it. I have added this line:

CustomDialogGui.DialogGuiOptions[eDialogGui_text_color_chosen] = -----;

Now it seems to work fine. Thank you!
Title: Re: Refresh dialog options - Tumbleweed template [SOLVED]
Post by: Khris on Wed 10/01/2024 13:52:29
Those numbers are colors, you can pick a color and copy its number in the Palette node of the project tree.
Alternatively you can use Game.GetColorFromRGB(r, g, b).
Title: Re: Refresh dialog options - Tumbleweed template [SOLVED]
Post by: Carles on Wed 10/01/2024 14:20:34
Yes I know. I have already modified them. :)
Title: Re: Refresh dialog options - Tumbleweed template [SOLVED]
Post by: abstauber on Wed 10/01/2024 15:05:57
My bad, I forgot that this settings was introduced - sorry.
Great to know that you managed to solve this  (nod)
Title: Re: Refresh dialog options - Tumbleweed template [SOLVED]
Post by: eri0o on Wed 10/01/2024 16:37:02
Quote from: Carles on Wed 10/01/2024 13:23:26Well, I think that's it. I have added this line:

CustomDialogGui.DialogGuiOptions[eDialogGui_text_color_chosen] = -----;

Now it seems to work fine. Thank you!


This should not even compile. This sequence of hyphens doesn't make sense. It should be an integer number between 0 and 65535 afaict.
Title: Re: Refresh dialog options - Tumbleweed template [SOLVED]
Post by: Carles on Wed 10/01/2024 17:39:02
Of course. I have put the hyphens so as not to put any specific number.