What is the issue with this code?

Jackboo1

Member
Aug 26, 2017
277
1,387
default variablevalue1 = 2
default variablevalue2 = 4
default variablevalue3 = 6
default variablevalue4 = 8
default variablevalue5 = 10
default variablevalue6 = 12
$ variablevalue1= 0
$ variablevalue2 = 0
$ variablevalue3 = 0
$ variablevalue4= 0
$ variablevalue5 = 0
$ variablevalue6 = 0

Is the default statement already declaring the variable?

Because from nowhere I get an error showing: Exception: store.variablevalue1 is being given a default second time........second time? how tf? I didn't get this error before lol
 

GAB

Salty Montrealer
Donor
May 10, 2017
2,405
18,187
there's a typo on $ variable 1 and 4 with a missing space
otherwise is it only for value 1. if you remove it and check if variable 2 gives an error, it may be an incorrect code all-together
 
  • Like
Reactions: Papa Ernie

Jackboo1

Member
Aug 26, 2017
277
1,387
there's a typo on $ variable 1 and 4 with a missing space
otherwise is it only for value 1. if you remove it and check if variable 2 gives an error, it may be an incorrect code all-together
I typed wrong only here in the thread, in the code is right, my bad.... BUT...

.... I just found the fix.

I just edited the var.rpy file to vars.rpy and the var.rpyc file was kepted in the directory. I had no idea that it has impact during the compilation lol



I almost lost my mind. Well, living and learning I guess :pokerFace:
 

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,841
yeah well, if you ever change .rpy file names again, just search for all .rpyc files in the folder and delete them ;)
 
  • Like
Reactions: Jackboo1

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,566
7,382
...or use the "Force Recompile" option in the main Ren'py screen, which will rename any "orphaned" .rpyc files so they won't bother you.