Please note that variable keys can’t have an empty space!Į.g. The key (or name) of the variable is used to identify it. This information could be anything – usually the player’s progress in the game (like status of quests or solved puzzles). But that’s not all, you can even create whole new systems using variables (like a calendar system). Hope this answers your questions.Game variables are used to store information in a running game. I suspect that's not what the OP is doing, and even my solution won't help in that case. Out of interest, would your plugin work if the variable were being changed via a damage formula? I think v is a direct link to $gameVariables._data, isn't it, and it bypasses the $tValue(id, value) function? So if that's the function you aliased, a change to a variable in a damage formula might not trigger it. And this is why I added the "unless" disclaimer to my original comment. In that case, a plugin like yours will be the most appropriate solution. 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. I'm just a fan of not using parallel processes or plugins if there's not a real, valid reason to do so. 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. 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. We've seen numerous instances where people have struggled with that. In addition, a plugin requires the user to download and save it correctly, and to set up the parameters correctly. And if one isn't, most people probably can't go in and fix that themselves. 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. Note though, even though you have aliased and called the aliased function, it doesn't guarantee there'll be no compatibility issues. 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. 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. It's a lot better than checking X times every second, because it's only running the extra code when a variable is changed. 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. 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. 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. It's just unnecessary if the variable is only being changed by an event command. It's certainly better than a parallel process solution. Don't get me wrong - I'm not saying a plugin is bad.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |