Hi! Can someone advise how I add stat checks during choices or fake choices?
Below is some of my code for rough idea:
edited*
*if (insight > 60)
Confusion continues to dance across her features."You were not accounted for in this cycle… In my books…"
*fake_choice
#"Early? What do you mean?""
*set genuine +2
"Early?" Your voice is steady but the question lands. "What do you mean?" Nyrelle does not answer you.
#"You make it sound like [i]I've[/i] done something wrong."
*set guarded +2
*set calculated +1
The faintest tilts of Nyrelle's tight curls gives you the impression that is not what she meant.
#Stay silent and observe her carefully.
*set observant +2
*set calculated +4
Sometimes silence says a lot more than questions can.
#"Well maybe your books need updated."
the choice would be in response to the first insight check you see at the top of the choice block.
The last choice is the one I would like to appear (or appear greyed out?) if stat not reached whereas all the other previous choices will show no matter what.
1 Like
I’m not sure I got your request fully, but try this?
*if (insight > 60)
Confusion continues to dance across her features."You were not accounted for in this cycle… In my books…"
*fake_choice
#"Early? What do you mean?""
*set genuine +2
"Early?" Your voice is steady but the question lands. "What do you mean?" Nyrelle does not answer you.
#"You make it sound like [i]I've[/i] done something wrong."
*set guarded +2
*set calculated +1
The faintest tilts of Nyrelle's tight curls gives you the impression that is not what she meant.
#Stay silent and observe her carefully.
*set observant +2
*set calculated +4
Sometimes silence says a lot more than questions can.
*selectable_if (books > 0) #"Well maybe your books need updated."
Blah blah
This ensures that:
- the choices are available only if your insight is over 60
- The option about your books need updating is grayed out unless your books variable is over 0. (Or whatever variable you want to test for it.)
- The first 3 options can be selected no matter what.
3 Likes
You can make conditional choices by using *if.
In the code example, the choice would not appear to the player if temp_num is not 2.
2 Likes
I am so sorry I am honestly terrible at explaining what I mean by something, which is also why I struggle to find it exactly in the forums lol.
I think this is what I was looking for, I just wasn’t sure if the hashtag technically moving place would hurt my code but I think this confirms it should work.
Some simple questions have me stumped the most but everything is a learning curve
thank you
1 Like
Hihi.
I have another quick question is there a smart coding way I can fix this issue bc I like how the stats currently look but it won’t let me do it the way Ive done it bc of this error:
choicescript_stats line 42: It is illegal to fall in to an *else statement; you must *goto or *finish before the end of the indented block.
I put *finish at the end of the *else command it wouldn’t work like that either
1 Like
When you use *else along with *if, each branch needs to end with *goto or *finish. You can add a label after the entire thing and then have each branch goto that label. The reputation section is going to have problems too, because you’re not using else or elseif. When reputation is higher, it will display multiple lines, all that apply. Using elseif (again, with goto and a label), with else for the final branch, will fix that problem. Also, as it’s currently written, nothing at all will display when reputation is from 1 to 19.
2 Likes
Jonathan_Bagelman’s comment is correct. Just for some additional context, though…
The *finish command will move to the next scene listed in the *scene_list, which isn’t applicable in this case.
You could do something like this
*if (alignment >= 67)
[b]Angel:[/b] There is a quiet restraint in the way that you move, as though you hold yourself to a standard no one else can see.
*goto stat_reputation
*elseif (alignment <= 33)
[b]Demon:[/b] Your presence hums with contained intensity, something coiled beneath the surface, waiting for the right moment to unfurl.
*goto stat_reputation
*else
[b]Balanced:[/b] You exist between definitions, refusing to settle neatly into one role.
*goto stat_reputation
*label stat_reputation
Blah blah that block of *if statements for reputation goes here.
3 Likes
Thank you Jonathan that’s incredibly helpful – and also good catch on the low end rep scale you’re absolutely right. 
@Writing_Fever Thank you for this yeah, it kept essentially ending after the alignment, which I like how it all looks. I just want it to do the thing and work correctly. 
Going to try mess around with it again and see if it works.
2 Likes