Stat not registered as variable

I’m trying to use a stat inside the game, particularly changing it in this attempt. The issue I’m having is it’s not being considered a variable.

Stat screen:
Talents
*stat_chart
text Birthtalent

First option (works):
*choice
#Fireborn
*set Birthtalent “Fireborn lvl 1”
*set Determination +2
*goto_scene YourStoryPt2

Second option (doesn’t work):

*choice
#Birthtalent
*if Birthtalent = Fireborn lvl 1
*set Birthtalent “Fireborn lvl 2”
*set Stamina +2
*goto_scene YourStoryPt4

I get the error:
YourStoryPt3 line 7: Non-existent variable ‘fireborn’

How do I get this stat to be read as a variable so I can use it? It’s a major part of this game.

*choice
	#Birthtalent
		*if (Birthtalent = "Fireborn lvl 1")
			*set Birthtalent "Fireborn lvl 2"
		*set Stamina +2

If you have an *if check like that (checking if variable x = “y”) you should put the check in brackets and also put what the variable is set to in quotation marks.

Then, if you look at how I’ve put the code, you’ll see different levels of indents. The way I set it up, Birthtalent will only be set to “Fireborn lvl 2” if the if check is positive, but Stamina will always be raised by +2 because it is on the same indent-level as the *if check.

If you want Stamina +2 only to happen when the *if check is true, then you have to put an additional indent there as well. Then it is “inside” the *if check and will only happen when it is true, skipped if it’s false.

*choice
	#Birthtalent
		*if (Birthtalent = "Fireborn lvl 1")
			*set Birthtalent "Fireborn lvl 2"
			*set Stamina +2

So important are:
Brackets
Quotation marks
Taking note of how far indented the code and text is.

That fixed the problem, thanks, I thought I already tried that but guess I didn’t. And thanks for the other tip, wasn’t really thinking about that but it will help.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.