- Joined
- Oct 11, 2015
- Messages
- 427
- Reaction score
- 174
- First Language
- Dutch
- Primarily Uses
- RMMV
Why does it store 1 instead of 1.08? It put it on the topmost part of my script. No strict-mode or other 'nonsense'.
var Imported = Imported || {};Imported.SILV_Minimap = 1.08;console.log(Imported.SILV_Minimap); // prints 1Imported.SILV_Minimap = parseFloat(1.08);console.log(Imported.SILV_Minimap); // prints 1So I tried putting this exact same code in another script. Also on the top. Now it prints 2x: 1.08
... I do not understand? (Yes I saved my script before running it in MV)
After more tests I found out that this code worked for some scripts, and not for others, completely at random. Even empty scripts with nothing but those lines of code and the header, will sometimes print 1 and sometimes 1.08.
Solution:
After a lot of messing around I couldn't figure it out. I decided to restart RPG Maker MV. And what? It now prints 1.08 correctly?
This is the3rd case 4th already where restarting MV or using a different platform/PC produces different script-results.
Cases (for me) where restarting MV or using a different platform/PC changed the outcome of the exact same code:
- strict mode (no it's not the scope)
- assigning a float to a variable
- changes in code not applying to the game (yes I saved the scripts). Restarting the game does not fix it. Fixed by restarting MV entirely.
- Darn I forgot the 4th one now... There was another case.
Darn I should have recorded this on video... Nobody will believe me again I guess. But now I'm 100% sure it's not me. There are some rare bugs in MV.
var Imported = Imported || {};Imported.SILV_Minimap = 1.08;console.log(Imported.SILV_Minimap); // prints 1Imported.SILV_Minimap = parseFloat(1.08);console.log(Imported.SILV_Minimap); // prints 1So I tried putting this exact same code in another script. Also on the top. Now it prints 2x: 1.08
... I do not understand? (Yes I saved my script before running it in MV)
After more tests I found out that this code worked for some scripts, and not for others, completely at random. Even empty scripts with nothing but those lines of code and the header, will sometimes print 1 and sometimes 1.08.
Solution:
After a lot of messing around I couldn't figure it out. I decided to restart RPG Maker MV. And what? It now prints 1.08 correctly?
This is the
Cases (for me) where restarting MV or using a different platform/PC changed the outcome of the exact same code:
- strict mode (no it's not the scope)
- assigning a float to a variable
- changes in code not applying to the game (yes I saved the scripts). Restarting the game does not fix it. Fixed by restarting MV entirely.
- Darn I forgot the 4th one now... There was another case.
Darn I should have recorded this on video... Nobody will believe me again I guess. But now I'm 100% sure it's not me. There are some rare bugs in MV.
Last edited by a moderator: