Hi folks,
I have a lot of script calls I use in various common events which pass game variables into them which are set before running that common event, such as:
(Variables 1-4 are set in the event, then this script is run as a common event)
So, I was wondering how hard it would be for someone with no JS knowledge to make a plugin that does nothing but add a plugin command which accomplishes the same thing, but takes parameters for each of those variables instead of referencing a game variable.
Something like:
A plugin command with these params:
Param1 = Number
Param2 = Number
Param3 = Number
Param4 = Number
Then the command runs:
The reason I want to do this is because I use plugin-specific script calls for things that I might need to change later. To keep things flexible, I'll put the script call in a common event, make it accept variables as it's values, and then set those variables outside the common event before running it. This way, if I need to replace that plugin or change the script call, I can change it in the common event without having to change every instance of that script call, as the values for every different case were set outside of it.
Using a plugin command cleans that up, and allows me to edit the plugin itself instead of a common event if I need to change the script call, and the use of the script call in events will look cleaner since it would be one plugin command instead of setting several variables and then running a common event.
Thanks!
For some context, the setSelfValue script in the example is from a self-variables plugin I use. It has its own commands already, and this is just an example.
I have a lot of script calls I use in various common events which pass game variables into them which are set before running that common event, such as:
JavaScript:
$gameVariables.setSelfValue([$gameVariables.value(1), $gameVariables.value(2), $gameVariables.value(3)], $gameVariables.value(4));
So, I was wondering how hard it would be for someone with no JS knowledge to make a plugin that does nothing but add a plugin command which accomplishes the same thing, but takes parameters for each of those variables instead of referencing a game variable.
Something like:
A plugin command with these params:
Param1 = Number
Param2 = Number
Param3 = Number
Param4 = Number
Then the command runs:
JavaScript:
$gameVariables.setSelfValue([param1, param2, param3], param4);
The reason I want to do this is because I use plugin-specific script calls for things that I might need to change later. To keep things flexible, I'll put the script call in a common event, make it accept variables as it's values, and then set those variables outside the common event before running it. This way, if I need to replace that plugin or change the script call, I can change it in the common event without having to change every instance of that script call, as the values for every different case were set outside of it.
Using a plugin command cleans that up, and allows me to edit the plugin itself instead of a common event if I need to change the script call, and the use of the script call in events will look cleaner since it would be one plugin command instead of setting several variables and then running a common event.
Thanks!
For some context, the setSelfValue script in the example is from a self-variables plugin I use. It has its own commands already, and this is just an example.