If I have a choice, and one, or more of the outcomes of that choice depends on a *if command, can I do that?
So, something like this:
*choice
#Option 1
*set X
*set X
*set X
Option 1 text.
*if X> 60
Option 1.1 text
*if Y=70
Option 1.2 flaver text.
*goto next
Something like that… I have run into a few choices, that I realized needed a *if tag, depending on the personalaty of at least the MC, if not another char. There are 2 characters in this one who have maluable variables. The rest have fixed variables.
Also. When doing something like:
``` Do you put the operator with a space, or directly beside the number/string/ETC?
Yes, you can use as many *if statements as you want to add customized content. Not sure if your code actually looks like what you’ve pasted above, but be sure that you indent correctly. It should look like:
*fake_choice
#Option 1
Option 1 Standard Text
*if (stat1 >= 50)
Customized text
*if (stat2 < 20)
Customized text
#Option 2
Etc
Keep in mind that the extra text will ONLY appear under those conditions, and it’s possible that players could see both customized texts if they pass both checks. If you want players to see either one text or the other but not both or if you want players who don’t pass either stat check to see something else, then you need to use *elseif and *else statements.
One more quick note–I opted to use *fake_choice here. I prefer to use fake_choice and/or enable implicit control flow because it allows you to skip the *goto at the end of every #option in a *choice. It makes coding much neater (and more intuitive imo) and eliminates the need for most (but not all) *labels.
To answer your other question, both formats are fine. I prefer to use spaces, but it doesn’t matter. Be sure to use parentheses though.
PS: you should change the topic of this thread to choicescript help rather than writing and content
A, NP.
Seems that when I try to do this on my computer, the catagory switcher thingy is a bit messed.
Thanks for change it for me.
Also, is it sad that I had an instinct to indent that last sentence with tabs?
*If
label text, indent of course.
*elsif, indent of course.
```What's the indent like after? Is there one? Or, does the Elseif act like a label, and reset indent to 0 till you do another *if?
First, you don’t need a *label under your *if statement unless you’re planning to send players to that spot from a different part of the game with a *goto. When you use *if, *elseif, and *else you either need to 1.) enable implicit control flow or 2.) include a *goto after every option
*if (x <= 20)
Text
*goto next
*elseif (y >= 50)
Text
*goto next
*else
Text
*goto next
*label next
Text
This is where the text converges.
_Alternately you can send the player to different *labels depending on which conditions they meet above_
Thanks. That makes sence. I will have to go back into the wiki and run through the *if, and *Elceif stuff some more.
Speaking of the wiki, sort of… Stat charts.
I know what the stat_chart command does, but what’s the format to put in stats below? From what I can gather, I got that you would do something like:
Short answer, no. For one you’re missing the command, and you also aren’t indenting correctly or using the correct terms (% won’t do anything).
I’m just going to post example code from one of my projects. You can find more info about stats directly from COG here.
[b]Profile[/b]
*if ((hair = true) and (headscarf = false))
*stat_chart
text Name
text hair_color Hair Color
text eye_color Eye Color
text skin_tone Skin Tone
text height_d Height
*elseif ((hair = false) or (headscarf = true))
*stat_chart
text Name
text eye_color Eyes
text skin_tone Skin Tone
*else
*bug
Note here that the stat screen is customized for the player, but that’s obviously not necessary. “Text” will display number stats as numerals, or you can use “percent” instead.
…
[b]Personality[/b]
*stat_chart
opposed_pair awk
Awkward
Smooth
opposed_pair cha
Charming
Intimidating
opposed_pair dir
Direct
Subtle
opposed_pair gen
Genuine
Sarcastic
opposed_pair hum
Humble
Confident
opposed_pair org
Organized
Spontaneous
opposed_pair per
Perceptive
Oblivious
opposed_pair yie
Yielding
Stubborn
Opposed pairs, pretty self explanatory
…
Here is what the first page of this stat screen looks like:
Thanks. It makes a bunch more sence now… I didn’t know about the [B] command till now. I don’t think it shows in the Wiki? Might have missed it though.
Also, when doing _relationship >, is it: _relationship %>, or >%? Or does it matter? I assume it’s like the +%, but not totally sure.