It's difficult to give an answer to this question.
Because you can execute literally anything inside the script box.
Nevertheless, script field should ONLY be used for small chunks of simple code. For example for loops, function calls or small simple maths.
The reason for that is that script field uses eval, which is almost 10000x slower in terms of code execution than standard function definition.
So even though you can execute anything (and by anything I really mean anything) in the script field, it's better to leave more complex code for plugins.
It can be used to integrate your plugins into the events though, so you can define a function inside a plugin and then just call it inside an event via script command.
But to give you an example, this is an example of changing variable 1.
script: $gameVariables.setValue(1, 300);
Show message: \v[1]
script: $gameVariables.setValue(1, 500)
Show message: \v[1]
I can't show a print screen, because I don't have a working pc right now.
To be honest, the script call box really isn't all that useful unless you want to do some quick, short bit of manipulation to something directly within the game's object structure. Here's what I mean:
As mentioned already, the script box code is executed by eval, meaning it gets evaluated and executed on the fly and is thus significantly slower and less efficient. It's also a lot harder to debug because it isn't always obvious where exactly the error is coming from. The script box also has a character limit, which imo is a good thing because it discourages people from writing out complex functions and whatnot. Sure, you could write all the complex stuff in your own plugin, then reference it via the script box, however that leads me to my next point:
For calling your own plugin's functions, you're really better off setting up plugin commands to access them. They're simpler and less messy to use, even if you're the only one who's ever going to be using your plugin.
For example, I wrote a thing to streamline giving items to players, so that, with one simple line, I can a) give the player an item, weapon, armor, or gold in whatever quantities I wanted, b) play a sound that would be associated with acquiring an item, and c) display a message like, "Acquired Potion x3" with the intent that every item acquisition would appear uniform and easily recognizable. Certainly better than trying to make every single treasure box/etc present items to players in the same way. I had two possible ways to invoke this newly-created functionality:
1) The script approach would look something like this: Aesica.Utilities.obtainItem(2, 4, 1); With parameters being type (2=armor), itemId, and quantity in that order. Not bad, but still a bit messy.
2) The plugin command approach would look something like this: ObtainArmor 4 1 Which is a lot cleaner and easier to remember. In fact, i even set it up so that 1 was the default and thus, the quantity part could be left blank to imply a value of one, making the final command: ObtainArmor 4
Hey guys thanks for the replies. Really appreciate it. 😀
I think I get a much better understanding of the Script Calls.
So, we can do everything with it but limited compared to plugins. And I guess to actually invoke this " endless possibilities" depends on
how much I know Javascript and how RMMV works (the files inside js folder), right?
No other way around then, just need to learn further.
Precisely. In fact you're also not limited to just Javascript. MV uses NW.js as the executable and NW.js also allows for c++ stuff. And due to the fact that you can customize all of your in game code you can do pretty much anything, because you can even alter how MV event commands behave in that particular game.