Variables Not Working

The engine is not working as expected? Documentation is wrong or out of date? Let us know here!
Forum rules
We are not providing support via this forum; it's community-driven. For official support see https://naninovel.com/support/#naninovel-support
Post Reply
gradstein
Posts: 22
Joined: 09 Sep 2020 19:03

Variables Not Working

Post 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!

Elringus
admin
Posts: 538
Joined: 11 May 2020 18:03

Re: Variables Not Working

Post 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.

gradstein
Posts: 22
Joined: 09 Sep 2020 19:03

Re: Variables Not Working

Post 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.

Elringus
admin
Posts: 538
Joined: 11 May 2020 18:03

Re: Variables Not Working

Post 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.

Post Reply