[Hugor font color thing] Condidential to RealNC, Empire of Greece

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Ice Cream Jonsey
Posts: 25294
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

[Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by Ice Cream Jonsey »

So, this is not a request for action, this is just two people talking. We're just talking here!

Hugor has the ability to change the text color, the inputting-of-commands color and the background color. Which is cool, and the interpreter doing that makes sense.

However, you can still have Hugo the programming language do it as well. The game I am entering into the 2019 competition has a routine that lets the player pick the colors between the 15 colors that Hugor supports. It SEEMS that Hugor allows for a full circular palette that you can pick from.

One thing I noticed is that Hugor will override the inputting-of-commands color. So if I issue this command in the .hex file:

color BLACK, BRIGHT_WHITE, BLACK (which is supposed to be black for the foreground (or game text) color, bright white for the background and then black again for the inputting of commands color, then Hugor will override the inputting of commands color, and I think it defaults to bright white.

So that means that in the above case, the input commands color and background will both be white and you can't see what you are typing in.

There's a dozen ways this could all go and this close to the comp I wouldn't want any changes to Hugor but maybe I should just direct people to use Hugor to change the colors? I dunno.

We're just talking here!!
the dark and gritty...Ice Cream Jonsey!

User avatar
Ice Cream Jonsey
Posts: 25294
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by Ice Cream Jonsey »

Also, a video would probably be a million times easier for me to communicate all this.
the dark and gritty...Ice Cream Jonsey!

User avatar
RealNC
Posts: 1885
Joined: Wed Mar 07, 2012 4:32 am

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by RealNC »

Is this happening with the latest Hugor version? (2.2) I can't reproduce the bug with:

Code: Select all

#include "hugolib.h"

routine Main
{
    color BLACK, BRIGHT_WHITE, BLACK
}
This produces the correct result for me, black input text on white input background on window background. And this:

Code: Select all

#include "hugolib.h"

routine Main
{
    color BLACK, DEF_BACKGROUND, BLACK
}
produces black input text with the input background matching whatever the window background currently is.

User avatar
RealNC
Posts: 1885
Joined: Wed Mar 07, 2012 4:32 am

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by RealNC »

Any update on this?

User avatar
Ice Cream Jonsey
Posts: 25294
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by Ice Cream Jonsey »

You know what, since you didn't see it I was going to let it go - I'll try to create a small test file for this and do what you say today.
the dark and gritty...Ice Cream Jonsey!

Roody_Yogurt
Posts: 2080
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by Roody_Yogurt »

I was just playing around with this in Hugor version 2.2.0 and I think I need some clarification from Nikos. I'm trying to change colors using the opcode system. So if I wanted to change RED to green, I would writeval RED (4) then writeval 0, writeval 255, writeval 0, and finally writeval 255 for the alpha value.

I'm trying this but all I'm getting is actual red. What am I doing wrong?

User avatar
RealNC
Posts: 1885
Joined: Wed Mar 07, 2012 4:32 am

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by RealNC »

Roody_Yogurt wrote: Tue Mar 31, 2020 1:02 am So if I wanted to change RED to green, I would writeval RED (4) then writeval 0, writeval 255, writeval 0, and finally writeval 255 for the alpha value.
You can only set colors 100 to 254. I'm not sure what the use case would be of having RED mean GREEN :P

User avatar
RealNC
Posts: 1885
Joined: Wed Mar 07, 2012 4:32 am

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by RealNC »

I changed the description of the opcode in the online spreadsheet to reflect this.

Roody_Yogurt
Posts: 2080
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by Roody_Yogurt »

I think you've explained this to me in the past (although I couldn't remember where so I couldn't look it up), but in my mind's eye, the new colors were still restricted to the original 16 slots, so you might choose one color combination that would look okay under the old restrictions but could re-program those colors so they looked even better in Hugor (I only chose GREEN because I was too lazy to look up actually interesting colors; I was just testing functionality).

Having all of these additional slots for colors is great, though. Games can just check for the availability of the opcode trick and set their colors accordingly.

User avatar
RealNC
Posts: 1885
Joined: Wed Mar 07, 2012 4:32 am

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by RealNC »

Roody_Yogurt wrote: Tue Mar 31, 2020 6:34 amthe new colors were still restricted to the original 16 slots
I'm not sure I understand what you mean.

Roody_Yogurt
Posts: 2080
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by Roody_Yogurt »

Code: Select all

enumerate                               ! colors 0 to 17
{
	BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, WHITE,
	DARK_GRAY, LIGHT_BLUE, LIGHT_GREEN, LIGHT_CYAN,
	LIGHT_RED, LIGHT_MAGENTA, YELLOW, BRIGHT_WHITE,
	DEF_FOREGROUND, DEF_BACKGROUND,
	DEF_SL_FOREGROUND, DEF_SL_BACKGROUND,
	MATCH_FOREGROUND
}
Basically, I assumed we were limited to the values between BLACK and BRIGHT_WHITE, redefining what color would be shown in color-opcode-capable interpreters.

User avatar
RealNC
Posts: 1885
Joined: Wed Mar 07, 2012 4:32 am

Re: [Hugor font color thing] Condidential to RealNC, Empire of Greece

Post by RealNC »

Yeah, that's not the case. The Hugo compiler's "color" instruction accepts any value, so this works:

color 100, 101
print "Hey"

You can set colors 100 and 101 to anything you want using the opcode.

Post Reply