So I try a quicktest, and I keep getting this error in CSIDE of: Non-existent variable 'he’, for the text below.
Dad mustered an understanding smile when we broke apart. "$!{he}'s always like this."
I know this has been asked a thousand times, and it’s very likely I missed my answer somewhere on the forum. I’m sure the answer is so simple it’s stupid, but I can’t figure it out to save my life. Can anyone explain to me, a frustrated noob, why it says it’s non-existent? I looked in the forum, I looked through the CS tutorial someone made, and I’m just as confused. I’m awful at this, send help.
Thank you! I knew it had to be something as simple as that, and yet I couldn’t figure it out. How would it work with NPCs you could change genders of? I assume like:
Shoot 'em up. Even though I’m not answering, there’re others who will. Besides, we don’t have much time writing/reading only permission without the actual thing asked – as ironic as I say this since I haven’t slept my entire night; hurray friday!
So how should I write the stats? I don’t have the script for it, but when trying to create it, I couldn’t simply write “text name”, even when I included a choice to choose a name and set it. Instead, no matter how I wrote it in the stat file, it said name was a nonexistent variable. Does that make sense? I can probably type it out and paste it here if need be.
On top of that, I couldn’t hide character selections in the stats; they would be hidden until they’re met in the story. I tried to include options for each character where, upon selecting them, you’d go to a screen giving out more details. Yet the text for each character all loaded under one option, despite all of them being labeled.
I’m horrible at explaining, so I have no issue giving screenshots and such if needed.
This creates a string (text) variable called name, which currently empty. Do this on your 'startup.txt' file (which would be your "master" file where you declare all variables, all cheevos, etc etc.---as such, it's recommended to use the file exclusively for those; no story in it).
Hiding stats is a matter of doing conditional checks `*if`, not `*label`. There're ways of doing it, but for the sake of learning, do this:
For all characters you want to hide, do this (with X is the name of said characters)
*create char_x_unlock false
In your stats screen, continuing from step 1, do this
*if char_x_unlock
Text for char X.
*if char_x2_unlock
Text for char X2.
etc.
This will hide the text for char X as long as its unlock variable remains false. As such--
In your normal text passage, whenever you want to "unlock" a character, add this code
I’ve created a name already, which is why I was annoyed that it wasn’t working. I have it like this:
*comment MCs Name
*create firstname ""
*create surname ""
Summary
I made a little test choice to see if choosing a name would make a difference like this:
*Choice
#Jennie
*set firstname "Jennie"
*goto this
#Carly
*set firstname "Carly"
*goto this
I did the same for surnames:
*Choice
#Smith
*set surname "Smith"
*goto this
#Apple
*set surname "Apple"
*goto this
Yet, when I try to test it, I get this: Non-existent variable ‘name’.
And below is all I have in the stats right now as I deleted everything in it, thinking somehow, maybe, it was causing issue:
[b]Stats[/b]
*stat_chart
text name
text haircolor
text eyecolor
First, my bad- if you do it as a *stat_chart, then you don’t need the ${} bit.
So
*stat_chart
text firstname
The other issue is I don’t know if you can do both firstname and surname on the same line underneath a stat_chart.
One thing you can do is nix the *stat_chart for the name all together (or use the example I posted above, with the & bits to combine the firstname and surname.
So it would end up just as-
Name: ${firstname} ${surname}
OR- if you decided to do the thing I mentioned above, with the & bits, it would be-
I took out the *stat_chart entirely and just did your second option with {firstname} {surname}. After a quick test, I didn’t get an error, so I assume it works! Thank the heavens, thank y o u.
Now I just gotta figure out how to set up the mini character bios properly.
Actually, yeah! One thing, Szaal gave an answer for hiding stats, but I’m not too certain how to implement the *if statements. I assume, following their example, it’s something like this?:
*if char_John_unlock
percent John
#John's bio
*goto John_bio
*if char_Lisa_unlock
percent Lisa
#Lisa's bio
*goto Lisa_Bio
etc etc
I think I may have tried that once, I just remember all the bios, for some reason, showing up as one long thing, instead of properly divided up to each character.
*if char_John_unlock
*stat_chart
percent John John (It's written twice on purpose, assuming "John" is a
numerical relationship variable. The first "John" is the variable, the
second "John" is to show who it is you're talking about. Another way to
show it is-
percent john_relationship John
to keep things from being confusing.)
John's bio paragraph stuff
*if char_Lisa_unlock
*stat_chart
percent Lisa Lisa
Lisa's bio paragraph stuff
Unless! You want each bio to have it own’s page all together (to go to by choice. Otherwise, the above should work fine and help keep things from getting cluttered.
For a bit of extra info-
You can’t use text or percent without a *stat_chart (it’d likely end up literally writing out ‘percent John’ or ‘text name’. You can’t use a # without a *choice, and it won’t go anywhere.
Edits are fine, don’t worry! Although I don’t understand how to fix yet another issue, starting to think I’m cursed. I tried plugging stuff back in but I get another error of: choicescript_stats line 10: invalid indent, expected at least one row
I tried indenting (with tab), and didn’t make a difference, which is why I tried testing it that way it’s displayed below, mostly out of curiosity, not because I thought it’d work. I had it the very first time, and now I can’t get it work at all?:
I think I did, and it still didn’t work? Or something? I’m honestly not even sure anymore. I plugged your stuff in, and this is what it all looks like:
Except now, strangely, I have this error: choicescript_stats line 24: invalid line; this line should start with ‘percent’, ‘text’, or 'opposed_pair’
Line 24 is #Cassius’s bio. I’m???