DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
Weird, I tried strict-mode again and now it works properly (same pc). Maybe one of the RPG Maker patches fixed it. I now get errors when undefined variables are used.
I have never had this issue, maybe you did it wrong?
 

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
427
Reaction score
174
First Language
Dutch
Primarily Uses
RMMV
<deleted>. I can't make a serious response to it other than that maybe this PC changed somehow something somewhere in the meantime. Same code, different results... SAME CODE...... Different results...
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
867
First Language
German
Primarily Uses
I'm with DarknessFalls on this one and i strongly suspect that strict mode didn't work for you, because you are not wrapping your code in an anonymous function. Strict mode is enabled or disabled per function and since the base scripts don't use it, your plugin is inheriting their "strict mode disabled" state.


The fact that it works in some browsers is probably implementation specific, since you aren't intended to use strict mode outside a function, anyway. So, if you follow the best practice, wrapping your code in an anonymous function and placing "use strict"; as the (important) first statement inside that function, it will work.
 
Last edited by a moderator:

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
427
Reaction score
174
First Language
Dutch
Primarily Uses
RMMV
yes I made a mistake declaring it outside of the anonymous function at the start. Once I learned that strict-mode had a scope, I changed it. But when I create an empty project, clean plugin. With or without an anonymous function, and I put code like this in it (strict-mode also within the anonymous function):

"use strict";myFunction();function myFunction() { y = 3.14; // This does or does not cause an error depending on platform(=Firefox, Chrome, Windows)/client...}And it gave me different results depending on what platform/pc I was using for the exact same code.

Now if I would have done it wrong, it should ALWAYS 'bug' OR never bug. But it depends on platform/client. And wrapping or not wrapping the plugin with an anonymous function (which I both tried) should not make a difference. And if it does, either JS or RM is bugged.
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

This one is less showing off and more 'I really don't know how I feel about this one.' The 'child' sprite template I made either works great or doesn't at times. (She is a fairy, so I made her small).
Morgan.png
I am new to RPG maker MV, please be harsh with me :D
Shaz wrote on Tohtori_Jamba's profile.
Hi, you can post a thread for your game in the Completed Games forum. Please check the pinned thread there and make sure you provide all the requested information.
and_remember_tomorrow_more_redesigns_4.jpg

edit: The complete redesign of my player HUD, Time rewind message, mini map and puzzle map.... I'll toss up an animated version later. :LZSexcite:

Forum statistics

Threads
110,632
Messages
1,054,837
Members
143,758
Latest member
piruhawas
Top