${} display bug in edge cases


#1

Hello! :smile:

I don’t have a problem, but I found a bug where ${} doesn’t display variables correctly. These are only edge cases I’ve found while playing around, so I don’t think many people have experienced this at all. I’ve tested this on CSIDE and Dashingdon.

Opposed Stats:

*temp xp_percent round(xp/100)
*temp lvl 9
*temp blank ""
*temp name "name"
*stat_chart
	percent hp $!!{name} (LvL ${level} $!{class})
	opposed_pair xp_percent
		EXP
		Until LvL ${lvl+1}
${blank}
*stat_chart
	percent xp_percent Until LvL ${lvl+1}
It will display like this:

bug

This only appears on the right side of the opposed stat.

I found a workaround just by doing an *if/else. (Luckily I don’t need many *ifs since you can only level up once in my game.)

Multiple Choices:

*temp him "her"
*choice reaction answer
	#"I like ${him} very much...
		#...we have to go save ${him}!"
			*finish
		#...we have to stay here."
			*finish
	#"I don't like ${him} very much...
		#...we have to go save ${him}!"
			*finish
		#...we have to stay here."
			*finish
It will display like this:

bug2

It displays correctly on the first set of options, but not on the second (and succeeding?) set of options.

Again, there’s a workaround with *if/else, but that’s a little trickier to code with multiple options.

Also, is there a way to change the text after “Select a”? I’ve tried using strings and variables, but it doesn’t work. If not, I can live with it. It’s just annoying and it only limits the use of multiple choices.

Side Note:

I know it’s not necessary to include how much remaining % EXP you need exactly, but the blue bar looks much better than another red bar.

Also, a neat little trick I’ve discovered: that “${blank}” there adds a slightly bigger space between the stat bars.

Another thing about the opposed stats: I also wanted to show a symbol that appears beside the stat if it’s being buffed/modified, but that doesn’t work. The *if workaround also works here but I figured it was clutter anyway.

You know, just spitballing why you’d ever want to put variables on opposed stats. It’s fun playing around with the stats screen (Am I the only one? :sweat_smile: :thinking:)


#2

The +1 wont work i think.

Easiest way there should be to make a second variable and have it be (i think)

*set lvl 1
*set lvlnext (lvl + 1)

I think. Cant currently remember how to add variable values together.

The second has something to do with the multiple choicebodies on the same page i think.


#3

Nah, if you look at

*stat_chart
	percent xp_percent Until LvL ${lvl+1}

Level 10 displays correctly instead of 9.

And yeah, it’s something to do with it. It’s just minor though.


#4

I am not sure about the intended stats screen behaviour, but the multiple choice variant certainly looks like a bug. I’m not sure how popular that pattern is though. Might not be one they’ll rush to fix.

Pretty sure you can’t change the text of multi choice selection. At least not by any conventional means.


#5

Yeah, it’s pretty minor. I’m just reporting it, I guess. I haven’t seen any threads about it.

And if it gets fixed, is giving an option to change the text of the multiple choice selection too much to ask? :stuck_out_tongue: I know it’s not used much, but still.


#6

I happened to notice this thread and had a few minutes to spare. Both of these bugs are now fixed in the latest version of ChoiceScript.


#7

Latest version is up?


#8

Yes. https://github.com/dfabulich/choicescript Has the latest code.


#9

Thanks. Gonna update tomorrow.
Oh if i may: any plans for making multireplace nestable?


#10

I’m late to the party. Aaaah!

Ooh, nice trick! Never know that CS can be “tricked” like that.


#11

That seems like a disaster waiting to happen.


#12

True though. Dx
Well, it is an interesting challenge to writers to arrange their sentences so that they flow well interspliced. :smiley:


#13

A Tip

*set hah "@{var hey|yo|ayy}"

@{var2 You call out to your pal, "${hah}|Your pal calls out to you, "${hah}"}.