Can I make an attribute all caps? [SOLVED]

Short Question: How do I make an attribute all caps when the attribute itself is lowercase?

Detailed Question: So in my gamebook, Player chooses their name. Let's say Player names themselves "Alex". Now, any time I need to use the player's name, I write {player.alias}. This works perfectly... except I have a character that speaks in all caps.
Currently, if I have that character say, "HELLO, {player.alias}." they say "HELLO, Alex." But I need them to say "HELLO, ALEX." in all caps.

Is there a way to do this? If not, I can just have this character nickname Alex, but I'd like to know if this is possible. Thanks in advance.

My Current Code (where player inputs name):

msg ("He looks up at you as you enter. \"What's your name?\" he asks.")
GetInput() {
	player.alias = result
	msg ("<br>Liam offers you a smile. \"Cool name, " + player.alias + ",\" he says.<br>")

My Current Code (where All Caps Dude speaks):

<object name="acivine join">
	<description><![CDATA["I WONDER HOW MANY POINTS {player.alias} HAS," Echolilya says.]]></description>

However, this reads as: >>"I WONDER HOW MANY POINTS Alex HAS," Echolilya says.<<

There are two potential ways you could handle this.

The first would be to set up another string attribute attached to the player object, player.aliasCAP="ALEX", and just reference that whenever you need someone to say their name in all caps.

The first method assumes that the player's alias is static and/or that you know beforehand what the name can possibly be. If the user gets to choose their name, as they do in your example, then you may wish to use the second method: the UCase(string) function.

I haven't used it myself to confirm, but from the documentation I would think it outputs the all-caps version of any string you give it, so putting the following directly after you get user input for the name:

player.alias = result
player.aliasCAP = UCase(player.alias)

should give you what you want.

It's worth noting that in your example where you have a character saying the name in all-caps in a description, you wouldn't be able to use the UCase(string) function directly in the text processor, you'd have to use that function to create an all-caps attribute to reference as shown above, or set the description to a script and use the function in that script.

It might be easier to use the text processor's eval function, depending how often you need this; depending how often it's needed. Just changing {player.alias} to {=UCase(player.alias)}.

Alternatively, because it's harder to spot typos in all-caps text, it might benefit you to have the text in sentence case and use CSS to change how it's displayed:

<object name="acivine join">
	<description><![CDATA["<span style="text-transform: uppercase;">I wonder how many points {player.alias} has,</span>" Echolilya says.]]></description>

(This is the same method you might use if you wanted to colour a character's speech, which a lot of people do)

Thank you both so much. It's really helpful to know about the color changing option too!

Log in to post a reply.