MV Simplifying Scripts Plugin

I am working on a simple plugin for myself to create easy to call scripts in my game.

So far, I got Event X & Y to work. I was working doing the same for Variables. However, I am having some issue so I thought I would reach out to the experts.

1641214486039.png
As far as I know $gameVariables doesn't have a property _value. Where did you find that?
Try instead accessing:
JavaScript:
return $gameVariables._data[id];
you can just use the regualar one if you want it's value.

$gameVariable.value(id) unless you want to set the value ofcourse.

the one you use is probably more globally if you want to set something
or check multiple values?
That worked thanks!

I just went with the RPG Maker script $gameVariables.value(id). So, I assumed it was "value".
As far as I know $gameVariables doesn't have a property _value. Where did you find that?
Try instead accessing:
JavaScript:
return $gameVariables._data[id];
Such assumptions can be verified either by looking at the code of the engine or the documentation. No need to blindly guess.
@Ruth Studio
are the exaamples in your first post just badly selected or are you indeed adding an entire API-Layer just so that you have to type less letters when accessing data?

Never forget that the computer has to interpret that code (because javascript is an interpreted language, not a compiled one), and even if one such function is not much, it does add up when using those functions thousands of times.
Probably for fewer letters to type. I do it from time to time as well.

Never forget that the computer has to interpret that code (because javascript is an interpreted language, not a compiled one), and even if one such function is not much, it does add up when using those functions thousands of times.
I would like to correct this assumption. Yes, it is interpreted language. But the program only gets even worse if (and is likely to be) used in the script call box, which in itself is an eval function (an expensive one). However, if you only do it once, shouldn't be a problem (damage formula also uses eval). It only becomes problematic if you're using the script call within the game loop. But if you're using it as a "native code" (not using eval), shouldn't be worry that much.

Original thread: https://forums.rpgmakerweb.com/threads/simplifying-scripts-plugin.143567/