New features in ChoiceScript: change text size/color, hyphen spacing, @{} variable replacement

That’s the line where I have a |} at the end, with the idea that it would just be blank if it reaches that number. Like in the dragon examples in the OP. Maybe that doesn’t work here? I’ll try snipping that.

Aaaand snipped. Does it work now?

Rereading, I… also missed most of the *set name& that was supposed to be there. But I don’t want to add them all in by phone, so this will have to wait. :disappointed:

Edit: On second thought, that was easy copy paste. So that part is fixed… is the error message still there?

1 Like

Yep, it looks like the line in question needs a variable inside the { } before the long list.
Same error.

1 Like

Oh, pah, that was a ridiculously simple error which I was overthinking. I blame the late hour. Of course it needed to actually reference “number.” :rolling_eyes: Okay, fixing everything now.

Thanks, added the actual variable everywhere now. Because the code can’t just tell what number to count by magic :stuck_out_tongue:

1 Like

startup line 24: Non-existent variable ‘s’

Edit: also this:
line 44: Invalid string, open quote with no close quote: "@{number p|t|c|k|ch|j|f|th|sh|h|v|z}

And now this:
startup line 52: Non-existent variable ‘squeeyv’
(the non existent variable changes every time I reload)

1 Like

This sounds great :slight_smile: …but now I’m super confused :confused: haven’t tried out any of the features yet, but if you can change text and colour to a few different options whilst playing the game, will these features just let you change the default, but still give the player the option to change colour and size on a game made using these features? As in assuming you have colour and size options different than the options currently say in choice of the dragon(have checked that out since the update) or can create different colours using hex or what not(that confuses me too :stuck_out_tongue: ) would that then be the the default when someone purchases the game, but the player would then have the option to choose text and colour options currently seen in choice of the dragon? Hope that was clear :stuck_out_tongue: .

1 Like

We can conclude from this that & requires quotation marks when followed by text rather than a variable. Good to know.

The last thing is because I got overzealous with unneeded brackets. The nonexistent variable is the randomly generated name… I accidentally referenced that as if it were a variable, when I really just wanted to set the name variable to the capitalized version. Lots of moving parts, here.
(Now hopefully fixed.)

We can also conclude from this that I should not post code from my phone without being able to test it, which would’ve saved a lot of back and forth :stuck_out_tongue: I thank you for your patience, anyway. Between us, I think we’ve rooted out the issues.

1 Like

startup line 44: invalid @{} at letter 1; ‘number’ is equal to 13 but there are only 12 options

1 Like

I’d removed qu as an option without reducing the if check. If check is now reduced accordingly.

(2 syllables)

My randomized name is: Sshoowhoangk Do you want to keep this name, or pick another?

(3 syllables)

My randomized name is: Veenhnungchqueez Do you want to keep this name, or pick another?

(4 syllables)

My randomized name is: Shlawthyeeychskreenvchurhs Do you want to keep this name, or pick another?

(the questions are all on the same line)

Hitting enter between the lines on the forum is not separating them, so it must have to do with the board display within the code tags. The line breaks were there when I typed it.

I’d better get to sleep, though.

1 Like

A lot of research here. Do y’all have a specific question at this point?

1 Like

The new code doesn’t give the author any additional control over text color/size; it only lets the player have that control. The default is unchanged.

3 Likes

No more questions from me right now… just a lot of experimentation.

I’m now thinking about if there’d be ways to get it to reference more than one variable… the simplest would be something like @{(jack > jill) Jack likes me better.|Jill likes me better.} Which isn’t quite accurate if they’re equal, but good enough.

The division trick could allow for more possibilities here, but that might be more trouble than it’s worth :thinking: *if is still a perfectly good command.

That’d look like this, I think:

@{(round(((jack-jill)+150)/50)) Jill likes me way more than Jack does.|Jill likes me a little more than Jack does.|Jack and Jill feel about the same about me.|Jack likes me a little more than Jill does.|Jack likes me way more than Jill does.}

4 Likes

I think most people would love it if they could change the font size or font ( I think if there will be a folder from which font will be loaded is made with a default font in it and you can change that font with any other font )

1 Like

Thought about it… now I have a question or two.

Is there a limit to the number of things we can store in @{}
Also, instead of “multireplace” how would you feel about calling @{} an array? (or an “at array” if that’s catchier)

*Gaaassspp :scream_cat:
Finally, I found a proper use for @{} “multireplace” instead of a simple -s suffix!

Oh, yes ppl. It’s handy for your inventory stats page.

[b]Items[/b]
@{(item_matches = 0) |a match,|two matches,|some matches,}
@{(item_cigar = 0} |a cigar,|some cigars,}
@{(item_hp = 0) |a healing potion,|2 healing potions,|3 healing potions,}

Still, need to decide when will you go into “some” instead of actual numbers, but I think it can be improved considering you can nest {} inside an @{{}}

2 Likes

This actually won’t do what you expect. The parentheses are binary tests, and true/false converts to 1/2, so you will only have the blanks or “a match,” “a cigar,” or “a healing potion” displayed, never “two” or “some”.

Maybe try:

*if (item_hp >= 1) @{(item_hp = 1) a healing potion,|${item_hp} healing potions,}

Anyway, I’m really happy to see the @{} feature added. Enums, plus compact text substitution, all in the same concise syntax, is great.

@dfabulich I think the @{} syntax merits description on the Advanced Choicescript page.

4 Likes

Well, you’ve improved my theory, then!

[Achievement acquired]

Besides, I don’t think creating @{} for inventory where the number count of that certain item can go beyond 999 is plausible :sweat_smile:

@dfabulich Just out of curiosity, is nestable multireplace a potential future addition or just a flat-out impossibility? Multireplace alone is already spectacular, but I’ve oh so longed to nest them on several occasions.

Do you mean by nested multireplace is something like this?

*if nest
  @{hablah true|false}

If that’s the case, I believe it’s already doable.

1 Like