I7/Glulx: more than two different custom text colors

I’ve done some googling to see what’s going on here, and obviously Glulx needs to be more complex than Z-machine for setting this sort of thing up.

But I wanted to be able to add colors to the cluing for a post-comp version of Shuffling Around. Below represents my first try. Apparently you only get two custom styles as things stand, and I wasn’t able to add a third that would register. What am I doing wrong as a total Glulx text effects noob? The below prints the text ‘special-style-3’ instead of changing text.

Thanks again!

[code]“colors” by Andrew Schultz

include Glulx Text Effects by Emily Short.

Table of Common Color Values (continued)
glulx color value assigned number
g-pure-blue 255 [== $0000FF]
g-pure-green 65280 [== $00FF00]
g-pure-red 16711680 [== $FF0000]

Table of User Styles (continued)
style name justification obliquity indentation first-line indentation boldness fixed width relative size glulx color
special-style-1 – -- – -- – -- – g-pure-red
special-style-2 – -- – -- – -- – g-pure-green
special-style-3 – -- – -- – -- – g-pure-blue

special-style-3 is a special-style.

when play begins:
initialize user styles;

room 1 is a room. “This is a colorless room that contains nothing [first custom style]red[roman type] or [second custom style]green[roman type] or [special-style-3]blue[roman type].”

every turn:
say “[blue]”;

section blues (for Glulx only)

to say blue:
say “[special-style-3]blue[roman type]”

section blues (for Z-Machine only)

[provided only to show what I’d do with z-machine]

to say blue:
say “[blue letters]blue[roman type]”;[/code]

Glulx doesn’t have a special style 3. It only has two custom styles. This is rare case where zcode outperforms glulx.

Hm, yes, I tried some weird hacks, too to make sure, and I mangled the extension itself, but no dice.

It might be easier just to allow graphics all of one color if the interpreter can provide it.

And for this example I only really need red and green and the blue can be assumed.

It’s limited to 2 custom text colours at low level so you won’t be able to add a third style just like that. I’m not sure why Andrew Plotkin limited it to 2 custom colours. However, this is Andrew Plotkin we are talking about so they must have a good reason.

Yooooou keep believing that. :slight_smile:

(I would say I did have a good reason, but that argument is way in the past. And I have done a crap job of getting the replacement plan implemented. Sigh.)

It may be possible to repurpose one of the existing styles (not otherwise used in your game) to be your blue style.

1 Like

Oh, thanks! That would be more than enough. I noticed a few extra styles in the extension. They’ll be fun to poke around with. Thanks for giving this update–I know you have lots of other cooler bigger stuff to do. And like I said, I’ll find a workaround somehow.

For now I can change blue to black and work from there.

Also, I see where the comment on only 2 styles is, in the extension. I searched it but missed it before. Oops.

1 Like

Well, I’m sure creating glulx in the first place makes up for that! :wink:

1 Like