Variables Not Working

Posted: 16 Nov 2020 19:53
by gradstein

Hi there,

I am having a heck of a time with simple variables not behaving according to the documentation.

My understanding is I should be able to set a variable in a naninscript using @set command. So I do so based on a user choice of picking between two characters.

I use @set PICKDANI=true (if they picked Dani). Doing so results in an error that the custom variable doesn't exist, but i should be able to create variables without predefining them in custom variables config menu according to documenation. Even the error says "make sure to initialize with @set command or via custom variables menu."

Regardless, even if i do predefine the variable, and I set its default value to false, when I encounter the @set command in script to change the variable to true, it doesn't stick, as confirmed by variables debug menu at runtime. So two problems: 1, i can't create variables at script level without error message saying the variable doesn't exist, and 2: if I do predefine the variable, I can't seem to then change the value in the script. Any help would be much appreciated, Elringus or anyone else!


Re: Variables Not Working

Posted: 16 Nov 2020 20:15
by Elringus

Hi, I've checked, but wasn't able to reproduce any of the issues you've described. Make sure you're using the latest available Naninovel version.

If the issues still persist after updating, please register via https://naninovel.com/register and share a repro project (https://naninovel.com/support/#reproduction-project) via private message to Elringus on the Discord for investigation.


Re: Variables Not Working

Posted: 16 Nov 2020 22:06
by gradstein

On further inspection, it actually just seems like the @set command is busted. So its not changing existing variables, nor is it creating new ones, resulting in an error when i run a check on a variable.


Re: Variables Not Working

Posted: 17 Nov 2020 00:56
by Elringus

You're probably using an outdated version. It's working fine in the latest one.

On a side note, please remember that the forum is not the best place to ask for support; see my previous answer on how to receive developer support.