Hey, I’m still kind of a noob, so any advice would be appreciated! I’m trying to work out something like a novice to master leveling for skills, but when testing it says that “Non-existing variable cha_text”. My code looks like this (only the relevant parts, lol):
*temp cha_text
*if charisma <= 20
*set cha_text "Novice"
*goto chart
*if (charisma > 20) and (charisma <= 40)
*set cha_text "Apprentice"
*goto chart
*if (charisma > 40) and (charisma <= 60)
*set cha_text "Adept"
*goto chart
*if (charisma > 60) and (charisma <= 80)
*set cha_text "Expert"
*goto chart
*if (charisma > 80) and (charisma <=100)
*set cha_text "Master"
*label chart
*stat_chart
text Name
text gender_text Gender
Skills
*stat_chart
text cha_text Charisma
Huh, that actually kind of worked? It passed the quick test, though I’m facing another problem— when I make choices that increase the charisma value, the stats screen still displays it as blank. Everything else has been left basically untouched, except I removed the *temp command in the stats file and added the *create command for cha_text.
As for the choices that increase “charisma”, I did make sure they actually do have the *set charisma +(insert number) command! Just to clarify since that’s the first thing I checked I actually did.
*gosub_scene stat_text
*stat_chart
text Name
text gender_text Gender
Skills
*stat_chart
text cha_text Charisma
I have the stat text divided in another file and last time I checked it worked fine, I remember having an issue where the text string wasn’t updated as I intended it to do, so I experiment and came up with this. If you try it remember to add the “stat_text” to the startup file. Let me know if it works like that.
This one should work too, less words, same output. You can start from the top also, if charisma >=80, elseif charisma >=60, elseif charisma >=40, and so on…
A bit of tip when it comes to case-listing issues such as this one: instead of using a series of *if followed by specific brackets of value, instead use *if *elseif *else with “singular” but descending value.
*if char > 80
*set text "master"
*elseif char > 60
*set text "expert"
*elseif char > 35
*set text "novice"
*else
*set text "noob"