Multireplace Issues


#1

Woo, me again, fuuun…coding is great!
Anyways, so, thanks to the lovely people who helped me out with my last question, I now have an idea on how to fix my stats, yadda yadda.
So, I work to implement the code, and bam. When I use multireplace in my choice, not all of the options show up. Here’s my code, as well as a screenshot.

    #@{choosewit Outstanding; though not everything quite met that bar... | Average; but they were moderately happy with another particular thing they saw in me... | Poor; though they were ecstatic about something else when we met face-to-face for the physical examinations...}
        *if (choosewit = 1)
            *set wit %+20
            *goto outstandingwit
        *elseif (choosewit = 2)
            *goto averagewit
        *else
            *set wit %-20
            *goto poorwit ```
![43%20PM|325x480](upload://huuStetoBmOz9aGRdM9eM3LCjyJ.png)
Aaaaand, as seen here, only the "outstanding" option is seen.
Help???
Also, great.  Now not even the forum posts listen to me :, )

#2

Multireplace will only show the bit that matches the value of the variable.
what exactly are you trying to achieve here, and where is the variable set?


#3

Trying to display a different series of scenes of the same kind when selecting one of the options, in short…confusing but necessary.

And I attempted to create the variable “choosewit” in startup as “*create choosewit 1 3” But an error came up, saying I can only have one number, a true/false, or a quote string, or something of the like.
Maybe I need to create three separate “choosewit” variables, each labeled 1, 2, and 3???


#4

if you want choosewit to be random it’d be

*create choosewit 0

and then after all the creates and achievements

*rand choosewit 1 3

also, have at least one choice or pagebreak before the option, as there’s still a small bug with the *rand command:
If someone’s on the page that contains the command and goes into the stats screen or closes the game, the command will re-roll upon the game being continued.


#5

I’d like the choosewit variable to be set depending on what option the player chooses within the multireplace (@{}) command.
Example: If player chooses “outstanding” wit, choosewit is set to 1, if player chooses “average” wit, choosewit is set to 2, etc


#6

Then you need to split it into three options:

*choice
 #outstanding
  *set choosewit 1
  *goto next
 #average
  *set chooswit 2
  *goto next

etc

multireplace can not be used to display different choices in one choice.

Edit: also, did you want to be multiple stats to be average/outstandng etc or only one per category?


#7

My situation:
In my story, to shake things up and make it more personal, you are asked to select how you did on your written exams, thus allowing you to choose your “wit” stat prematurely BEFORE choosing your other stats. Upon selecting “outstanding”, your wit would be raised, boosting it in the beginning of the game, and you would be prompted to choose a “poor” stat to balance it out–a negative quality that the teachers noticed during your physical examinations. Upon selecting “average”, you’ll be prompted to choose different stats that you’d like boosted as well as subtracted. And selecting “poor” just inverts the explanation used for “outstanding.”
I want to use multireplace to prompt these different scenarios. I was told if I made it as such: #@{wow, you have outstanding wit | nope, I don't really have outstanding wit}
The “|” (bar-shaped character?) would separate these two and make them into different choices, thus setting the variable “choosewit” to the number corresponding to the choice and THUS making the different scenarios happen.
deep breath Sooo this is all very confusing to me and I have no idea what I’m doing, lol. Sorry for the ridiculously long reply…


#8

Unfortunately, no. It is not.
Multireplace is basically a compact form of *if/*elseif/*else for text only, without the ability to modify variables.

Technically, a single # is a single option. If you want to give players different options, add more #.

#@{wit A poor wit|A great wit}
   *if wit = 1
      Your wit is gud.
   *else
      Git gud.

This code doesn’t give you 2 different choices. It does, however, give you a choice that can change its content depending on the [wit] variable if defined.


It seems you’re trying to go with a bit convoluted way of coding, especially since you need no multireplace in this case.

May I recommend you this flowchart?

Flowchart

this
And sorry, but comic sans is the default font :"


#9

You’re seeing the first option in the multireplace construct listed and acted upon by your if statements every time because you have ‘choosewit’ set to 1. Multireplace displays text only, it doesn’t return anything.

Your scenario sounds complicated. If I were in your shoes, I’d create a flowchart of what you’re trying to achieve and then just use a series of completely separate choice statements to put it all together. Don’t try to over-complicate the coding, you’ll get yourself tied in knots… Choicescript is great for telling stories and creating text based games but a flexible programming language it ain’t.


#10

Right, I guess I wasn’t that direct or understandable enough with my problem in my last post, haha. Maybe a few uniquely named labels, a lot of “*gotos”, and some ctrl+c ctrl+vs will fix my problem…whoops?
Thanks for all your help, sorry about all this! Lmao coding is a journey


#11

Thanks for your help, I guess my problem was a bit specific and I didn’t explain it too well, aha.
I really do appreciate all your time, I’ll definitely be reorganizing everything now lol.
Have a good one !