Adventure Game Studio | Forums

AGS Development => Editor Development => Topic started by: Ibispi on Sun 15/04/2018 19:22:06

Title: [A bug?] game.dialog_options_highlight_color variable doesn't work
Post by: Ibispi on Sun 15/04/2018 19:22:06
I'm using AGS version 3.4.1.12 (which is the beta version I think), and I've tried to set this variable to a certain color number so as to change the color of the dialogue options highlight.
I've tried setting it at game start, whenever a room opens, at the beginning of a dialogue but to no avail.
Just in case I'm not doing it properly, I do this: game.dialog_options_highlight_color = 30004;
It just picks some default color based on the character's dialogue color instead. In my case:
(https://i.imgur.com/WfLhxWU.png)
Matt also tested it out himself on his computer and he found out that it worked in an older version but in this version I am using it made all his highlights grey even when he set it to another color.
So it's probably just a bug in this beta version.
Title: Re: [A bug?] game.dialog_options_highlight_color variable doesn't work
Post by: Crimson Wizard on Sun 15/04/2018 20:16:32
No, 3.4.1.12 is not a beta version, it is a normal release.

What kind of dialog rendering you are using? Is it custom rendering, or default one, and how do you set up its GUI? And if it is custom rendering, then could you show the code?

Also, what was the old version this worked in?
Title: Re: [A bug?] game.dialog_options_highlight_color variable doesn't work
Post by: Ibispi on Sun 15/04/2018 21:24:33
Hey Crimson Wizard, thanks for answering!

I am not sure if I'm using custom or default rendering, but I have a custom-made GUI for the dialogue options (I assume that makes the rendering custom? :=) and then I just selected the GUI in the general settings for the dialogue options gui.

The code in the global script .asc:

function game_start()
{
  game.max_dialogoption_width = 800;
  game.dialog_options_highlight_color = 30004;
}

Also, I was wrong about it working for Matt in the past, he just told me it didn't actually work for him (it's version 3.4.0.16). Sorry about that.
But I do remember using this variable for All pigs deserve to burn in hell and I think (not 100% certain) it worked back then.

EDIT: Here's more information about the dialogue rendering if it helps:
(https://i.imgur.com/I9tPUJR.png)
Title: Re: [A bug?] game.dialog_options_highlight_color variable doesn't work
Post by: Crimson Wizard on Mon 16/04/2018 22:06:29
Alright. Apparently, there is some faulty logic in AGS, which results in following: if you are using TextWindow type of GUI, it resets highlight color to TextWindow's own TextColor property, and if it matches player's speaking color, then to default magenta (color 13).

It's hard to make much sense in what is going on there (this was one of the strangest parts in AGS).
(Also, all this time I did not know that default dialog options use Character.SpeechColor as text color...)

So, I think you need to setup TextWindow's TextColor instead of the game.dialog_options_highlight_color.

But I agree, this should be fixed, because it makes no sense imo.


EDIT: just realized, this dialog_options_highlight_color was added by Gurok in earlier updates, but it seems it does not get used with TextWindow gui for some weird reason. Maybe we just forgot to test that.
Title: Re: [SOLVED][A bug?] game.dialog_options_highlight_color variable doesn't work
Post by: Ibispi on Mon 16/04/2018 22:35:10
It sounded simpler when you described it, as I was trying to implement your suggestion I realized how silly it is. So...
When I changed the font color of the gui to the one I wanted to be the highlight color it changed all the dialogue to be this color.
Which means that text gui font color equates to dialogue font color and dialogue option highlight.
Dialogue options are however based on player's speech color.
So what I did is I picked a somewhat grey color for the player's speech color and I kept the white color for the dialogue font color. It's not exactly what I wanted but it looks a lot better than the magenta alternative!

How it looks like now:
(https://i.imgur.com/sYXnQkb.png)

Thanks for the help Crimson Wizard.
Title: Re: [A bug?] game.dialog_options_highlight_color variable doesn't work
Post by: Crimson Wizard on Tue 17/04/2018 15:11:43
Quote from: Ibispi on Mon 16/04/2018 22:35:10
When I changed the font color of the gui to the one I wanted to be the highlight color it changed all the dialogue to be this color.
Which means that text gui font color equates to dialogue font color and dialogue option highlight.

Not sure if I understand you correctly, but you could create two separate TextWindow GUIs, one for speech and one for options.

As for fixing this... I am now in doubts. I think the whole system need to be revised, and proper strict rules be set: how is the options color is decided, and how is hilighted color is decided, etc. Right now it's a real mess.
Title: Re: [A bug?] game.dialog_options_highlight_color variable doesn't work
Post by: Ibispi on Tue 17/04/2018 15:37:15
I hadn't known that I can create 2 different text guis, I just did and it solves the problem I've been having. I had thought that the second text gui is for description, not dialogue >_>
but I was wrong.
But yeah it still seems a mess.