Disabling italics?


#1

I’m using italics for some of the writing in my game. It’s been brought to my attention that this will make the text hard to follow for readers with some forms of dyslexia.

Is there an easy way to give the reader the option of disabling italics? I’d obviously like to keep things as accessible as possible, but going through the game code line by line is already going to be at least an hour’s work.


#2

Well, since the only way to use italicized text on ChoiceScript is through the [i] [/i] tag, the only way I can think of to not include them is to not use the tag :thinking:

I mean, going through the code line by line is probably inevitable. Italicization on choicescript is not applied universally through the whole game.


#3

Thanks. I was really hoping for the option to give readers the option to disable italics when they start a new game. For example, by adding a few lines of code to tell the programme to ignore the italics tag if the reader has selected that option.

Is anything like that possible in Choicescript?


#4

Offhand, I can’t think of any quick or easy way to go through a game’s code and edit it to allow a new function you want, even though the function itself should be quite easy on an individual instance level.

Here’s how I would do it:

I’d start with a boolean variable (something like *create italics true .) I’d then offer a *choice or *fake_choice at the beginning of the game so players could allow the variable to remain true, or switch it to false.

Then I’d use the Find function of whatever text editor I was using to write the game to jump to each use of italics without spending the time scrolling through and re-reading it all.

Finally, at each instance of italics use, I’d replace the [i]italic text[/i] with the following structure:
@{variable_name [i]this_displays_if_true[/i] | this_displays_if_false}

In practice it may look something like this: "She said @{italics [i]what?![/i]|what!?}" Jamie shrieked as she jumped out of her chair.


#5

It’s actually possible. But then, it’ll be a line-by-line work, like I said before :frowning_face:
Just like @Minnow said, using the multi-replace operator @{ }

The update note about the operator is at here, if you’re interested on it.


#6

I was trying to remember what we were calling that! I’m sure I’ll forget again at some point, but thanks for reminding me.


#7

Well, there’s currently no other better name than “multireplace” just like what @dfabulich mentioned.
So, yeah.

:"


#8

I feel like this would be something that could quite easily be implemented though. Perhaps worth a feature request?

For multireplace, I’d be tempted to say use variables, as if you ever made a mistake, it would error, rather than silently italicise half your page.

*create is "[i]"
*create ie "[/i]"

...
*temp italic_text "what!?"
@{italics ((is&italic_text)&ie)|italic_text}
*comment I *think* this syntax will work, haven't ran it though

This wouldn’t be practical within a paragraph with lots of different words, but where it is practical, it provides some extra safety (in exchange for verbosity).


#9

@CJW Thanks! How would I go about putting in a feature request?


#10
I still had my test code for this discussion up (I wanted to get the right order of true-false results when using multireplace) so I added your sample to my test code like so:
*title Code Test 3
*author @Minnow
*create italics true
*create is "[i]"
*create ie "[/i]"
*temp italic_text "what?!"
Should the game display mixed [i]italic text[/i] and standard text, or display all text as standard?
*fake_choice
	#Use mixed [i]italics[/i] and standard.
	#Use standard text only.
		*set italics false
Your choice regarding @{italics [i]italics[/i]|italics} has been recorded.

Test line:
@{italics ((is&italic_text)&ie)|italic_text}
*finish
Your sample didn't work as written. It produced the following:

Fixed it!
You need two things: First, an extra *set before the multi-replace operator. (Specifically, *set italic_text ((is&italic_text)&ie) . Second, you need to use ${italic_text} in the content of the multi-replace.

Like so:
*title Code Test 3
*author @Minnow
*create italics true
*create is "[i]"
*create ie "[/i]"
*temp italic_text "what?!"
Should the game display mixed [i]italic text[/i] and standard text, or display all text as standard?
*fake_choice
	#Use mixed [i]italics[/i] and standard.
	#Use standard text only.
		*set italics false
Your choice regarding @{italics [i]italics[/i]|italics} has been recorded.

Test line:
*set italic_text ((is&italic_text)&ie)
@{italics ${italic_text}|italic_text}
*finish


#11

I don’t think you need the is and ie stuff. This seems to work fine:

*temp italics true
*temp italics_text "what?!"

@{italics [i]${italics_text}[/i]|${italics_text}}

#12

It was more for if you were writing out the i tags by hand, but copy and pasting your statement would also provide a good measure of safety.

@Minnow thanks for correcting!


#13

Another related technique you could use would be the new parameters for *gosub.

*temp italics true

*gosub italicize "what?!"

*gosub italicize "how?!?!"

*ending
*label italicize
*params text
@{italics [i]${text}[/i]|${text}}
*return

#14

… Alternatively, you could always just use bold text instead of italics. :yum:


#15

Any chance we’ll ever be able to do…

This paragraph is a really nice and long paragraph and oh look here are some {*gosub italics “italics!”} isn’t that {*gosub bold “bold”}.

Less ugly ofc, just trying to get the message across!


#16

Today you can do that like this:

This paragraph is a really nice and long paragraph and oh look here are some
*gosub italics "italics!"
isn’t that
*gosub bold "bold"

ChoiceScript will glue that together into one paragraph as long as there are no blank lines.


#17

Thank you all for your replies.

I’m still learning the basics of coding, and this is all looking a bit advanced. Good to know that the option exists though, for future projects.