Don't get me wrong - I'm not saying a plugin is bad. It's certainly better than a parallel process solution. It's just unnecessary
if the variable is only being changed by an event command.
If the variable only gets changed by a Control Variables command, then you know exactly when the variable will change, so you can do a Common Event command immediately after the Control Variable. You don't have to have something running all the time in the background keeping an eye out to see when a change has happened.
I can't view your plugin while I'm at work, but I'm guessing you've aliased a function somewhere that changes a variable, and in your aliased function, you call the original, then you check to see if the variable being changed is the one of interest, and then you trigger the common event. It's a lot better than checking X times every second, because it's only running the extra code when a variable is changed. But for every single variable that gets changed during the entire duration of the game, that plugin is checking to see "is THIS the one I need to do something special with?" If the variable is only going to be changed 5 times in the first 15 minutes of the game, and the game goes for 10 hours, that's also a lot of unnecessary checking that's happening. But it won't be a CPU drain like a parallel process would be, because you're being more specific about when / how often you're doing the check.
Note though, even though you have aliased and called the aliased function, it doesn't guarantee there'll be no compatibility issues. What if you had another plugin that also changes the same function
but it didn't alias the function? It's not only
your plugin that has to be set up just the right way, but every other plugin as well. And if one isn't, most people probably can't go in and fix that themselves.
In addition, a plugin requires the user to download and save it correctly, and to set up the parameters correctly. We've seen numerous instances where people have struggled with that. If your plugin uses parameters, either it has to be written so the file name doesn't matter, or it has to be saved with the exact, correct filename. And if they don't set up the parameters (which an awful lot of people don't) or don't set them up correctly, there are still issues.
I'm just a fan of not using parallel processes or plugins if there's not a real, valid reason to do so.
Now, in the case where the variable
isn't being changed by an event, but by another plugin (let's say a variable is being set to a particular actor's weapon id, so is being set by a plugin that changes the Equip screen and equip commands), it's not the developer who's determining when the variable is being changed, but the player, and you can't predict that. In
that case, a plugin like yours will be the most appropriate solution. And this is why I added the "unless" disclaimer to my original comment.
Out of interest, would your plugin work if the variable were being changed via a damage formula? I think v[n] is a direct link to $gameVariables._data, isn't it, and it bypasses the $gameVariables.setValue(id, value) function? So if that's the function you aliased, a change to a variable in a damage formula might not trigger it. I suspect that's not what the OP is doing, and even my solution won't help in that case.
Hope this answers your questions. I certainly didn't think you were being rude
