Coding Nooblet Needs Help


Ok, so… I’ve figured out how to work stats and whatnot… but for some reason enabling players to create their own name and appear in the stat screen is becoming a massive headache.

Whether it be opening the stat screen or after the section when entering one’s name, I continually get the same thing over and over again: Non-existent variable ‘name’

And I have no idea why it’s doing that. Whether I have: *set name “$!{name}” within “variables” or in the “choicescripts_stats” or both or additionally in “startup” or some combination therein or all of the above, it doesn’t matter–I get the same thing over and over again. If I add: *create name to the “startup” I get an error of entirely different kind, so I’m basically stuck here and I have no idea what I’m doing.


Are you specifying a value: *create name “”?

It’s blank, but that’s technically still a value.


Like @Caddmuss said, you have to place a pre-set/default value for the name, methinks.

Also, what’s "*set name "!{name}" for? You can just use !{name} if you want it displayed.


@Slyde I assume when you look in your stat panel some people may want the first letter capped.


Yeah, Caddmuss nailed it on the head. The times I left it blank, I didn’t have the quotes there. But at least that’s one small hurdle done with. Thanks, guys! XD

But! The other thing I’m struggling with is setting up various classes to select from, and then that too showing up on the stats page. Would that be done in a similar way as with names, or a little differently?


Just seems…redundant? Eh, what the hey.

With regard to the class thing, I think it’s roughly the same.

You could do it in a couple of ways. One way I could think of is to assign each class to a true or false variable, and then just making various *if statements for displaying text or other tasks, although it might get cumbersome if you have many classes.

Another way I can think of is to create a “class” variable, then just assign string values to it. IE *set class “knight” if the class is a knight, bla bla bla. You can utilize ${class} this way; makes it easier to write stuff.

Granted, I’ve only had a week of experience with choicescript, so my propositions may not be the best ones.


No worries! I’ll take whatever advice I can get, I’ve always been slow when it comes to coding. XD

But I’ll try your suggests out, see what works best with what I’m aiming to do here. Thanks again!


D-Double post!

Ok, new question!

How can I set up for certain choices to be available for like a specific class. Like after selecting one class, it will have various choices/options to select from that cannot be selected by those of other classes.

With the story I’m doing now, there’s various classes to choose from, but for each the storyline ranges from superficially different to dramatically different do to each class from time to time within the narrative having their own unique choices amongst others that the player has available to choose from. But again, the problem I’m having is setting it up so that only if you’re of such and such a class can you select a certain option that others cannot.

Help! D:


*create class ""

*selectable_if (class = "Mage") #Go Super Saiyan to defeat this giant!
  You killed the giant with a Kamehame
*selectable_if (class = "Badass") #Beat this giant's ass!
  You knock out the giant and steal his woman!
#Run away!
  You run like a coward!

I think I got it?


Awesome! Thank yoooou! That did the trick. What I was trying before was embarrassingly way off. <.<


If there were classes in RL I would be a Badass! :3


You can also use *if statements for those.

*selectable_if just grays out the choice if it doesn’t fulfill the required variable/class.

*if removes the choice from the list completely, meaning you won’t see the choice at all unless you’re of a certain class.

It can help in scenes where you have a lot of choices in place, but only a few can be picked. Also ups the Ooooh, this is new reaction when playing a new game.


I have a certain dislike of selectable_ifs. I hate choices being there which I can’t pick. They are interesting sometimes, in select circumstances just to show the player that a path branches at that point, but generally I dislike them. They taunt me, going neenerneener you can’t pick me. :slight_smile: However sometimes it’s good to have them there so I know I can take a different direction when replaying.


@FairyGodfeather That’s why I like them they are such teases, they make you wanna come back to see what they are about.


What 2Ton is mentioning there is exactly why I’m using them. While the overall plot is shared between the classes. Each class will have a unique experience via at times possessing their own unique choices none of the other classes will have access to. Like I said before, some of those choices will be superficial, while others will create a far more unique situation and circumstance within the plot, diverging into something the other classes simply won’t have. Each class has something like this, and each class will even have their own unique endings, too. So that’s why I wanted the *selectable_if, so then while greyed out–they could still be seen and give incentive to replay and check them out should folks like the game enough to do so. XD

But that’s even on top of the choices that require nothing in order to select, and the various choices that are stat dependent… And then of course the romance-able characters will have their own thing going on, which too can impact choices and also creates a unique experience within the plot as well.

Sigh… I just hope I’m not biting off more than I can chew. :frowning:

Hence why I have a generalized title for this thread, because I know I’m going to have more issues with coding. My days spent modding games has forced me to acknowledge that about myself. >.>