Hello everyone!
I just bought MV during the sale this week end and tried some eventing. However, it turns out I had been spoiled by RPGMaker Extender in VXACE, especially by the ease of calling variables during script calls: \V[] instead of $gameVariables[]. I searched for something similar for MV but found nothing... So, I decided to write my very own plugin for this, aiming to provide an easier to use syntax during script calls.
And I succeded! So instead of using:
$gameVariables.setValue(id,value), I can now use: SV(id,value).
Because $gameVariables.setValue(6, $gameVariables.value(5)+$gameVariables.value(4)) is ridiculously long for something so simple... SV(6, RV(5)+RV(4)) is much more appealing to me.
I did this by modifying event command 355 (which is script call) and defining a new function inside.
I did the same for a bunch of functions, approx 50 now and I already am finding it a huge help.
You will find attached to this message the plugin I wrote, and the word help file (it contains a reference of every function I created, the syntax, and any comments I thought of).
Or find the plugin here:
http://pastebin.com/ZngETvEy v0.1
http://pastebin.com/K37wAqhT v0.2
What I need help with is:
- Is my code adequate? So far, it works, but I learned a tiny bit of javascript litteraly yesterday, so maybe I'm missing something obvious that will kill me down the line should I decide to expand upon it. (All functions created are the same, they just call the regular expression, so look at the first couple, don't bother reading all 50 of them.)
- Do I risk anything doing this? I don't know the intricacies of MV functionment, maybe it will bug out somewhere...
- I'm guessing no compatibilites issues will arise unless another script modifies the script call command. Am i right?
- Right now, am I replacing or adding features to the call script event comment? If I'm replacing, how would I make it so that I only add my funcctions, not replace the command?
I plan to release it on the forum if everything is good, on the chance someone else would use it, and before that, I want to be sure I don't risk blowing up everyone's projects.
Bonus questions: I needed a way to access the value at [index] from a game variable that I defined as an array, i found no way to do that both in editor and with script command.
I ended up creating a function based on gameVariables.value. It's at the end of the plugin. Same for setting a value.
-First: Are my functions well written? Do you see something glaringly obvious that any experimented programmer will scream at?
-Second: Was there an easy solution all along and I didn't need to create two functions? setValue(6[0],3) didn't work..., V[6] was set to 3, not V[6][0]. value(6[0]) didn't work either.
Thanks in advance for the help!
Edit: 02/06/2016, for version 0.2
I just bought MV during the sale this week end and tried some eventing. However, it turns out I had been spoiled by RPGMaker Extender in VXACE, especially by the ease of calling variables during script calls: \V[] instead of $gameVariables[]. I searched for something similar for MV but found nothing... So, I decided to write my very own plugin for this, aiming to provide an easier to use syntax during script calls.
And I succeded! So instead of using:
$gameVariables.setValue(id,value), I can now use: SV(id,value).
Because $gameVariables.setValue(6, $gameVariables.value(5)+$gameVariables.value(4)) is ridiculously long for something so simple... SV(6, RV(5)+RV(4)) is much more appealing to me.
I did this by modifying event command 355 (which is script call) and defining a new function inside.
I did the same for a bunch of functions, approx 50 now and I already am finding it a huge help.
You will find attached to this message the plugin I wrote, and the word help file (it contains a reference of every function I created, the syntax, and any comments I thought of).
Or find the plugin here:
http://pastebin.com/ZngETvEy v0.1
http://pastebin.com/K37wAqhT v0.2
What I need help with is:
- Is my code adequate? So far, it works, but I learned a tiny bit of javascript litteraly yesterday, so maybe I'm missing something obvious that will kill me down the line should I decide to expand upon it. (All functions created are the same, they just call the regular expression, so look at the first couple, don't bother reading all 50 of them.)
- Do I risk anything doing this? I don't know the intricacies of MV functionment, maybe it will bug out somewhere...
- I'm guessing no compatibilites issues will arise unless another script modifies the script call command. Am i right?
- Right now, am I replacing or adding features to the call script event comment? If I'm replacing, how would I make it so that I only add my funcctions, not replace the command?
I plan to release it on the forum if everything is good, on the chance someone else would use it, and before that, I want to be sure I don't risk blowing up everyone's projects.
Bonus questions: I needed a way to access the value at [index] from a game variable that I defined as an array, i found no way to do that both in editor and with script command.
I ended up creating a function based on gameVariables.value. It's at the end of the plugin. Same for setting a value.
-First: Are my functions well written? Do you see something glaringly obvious that any experimented programmer will scream at?
-Second: Was there an easy solution all along and I didn't need to create two functions? setValue(6[0],3) didn't work..., V[6] was set to 3, not V[6][0]. value(6[0]) didn't work either.
Thanks in advance for the help!
Edit: 02/06/2016, for version 0.2