MV Dev Tool - Shift all Switches/Variables/Etc by X Slots

Hello,

Would someone be able to help me with a bit of an odd request. It isn't a plugin that you would have in a completed game, but instead a developers tool that you would run only as needed.

What I'm hoping to achieve is to have a plugin that, when you run the game with it ON, all the switches, variables, common events, and whatever else you enable in the plugin configuration would be shifted forward X slots.

To give an example, the scenerion I'm currently in is that I've spent quite a while developing a complicated card game minigame, which uses hundreds of switches, variables, and common events. Now though, I've decided that I'd really like to implement this into an existing project of mine. Instead of going through a massive amount of events hoping I don't miss anything or screw up changing them, I'd love to be able to simply "shift" the switches/variables/common events by 2000 (so any references to switch 1 become switch 2001, and so on).

I do realize that this won't affect switches/variables/common events that are referenced in plugins, nor those used in message boxes or script calls, but even so, this would be an absolute massive help both for myself, and anyone else that finds themselves in a similar situation.

For my own purpose, I just need comparability with switches, variables, and common events. However, if it's not too difficult to add additional database items (items, weapons, armor, etc) that would always be snazzy to have.

I hope I explained this well, if you have any questions, definitely do ask.

Thank you!
I imagine this would come in a few-step process in-code:

- clone the $dataXXX object
- iterate over the original $dataXXX object and manually write the data into the cloned object with an indexer of +1 or whatever
- assign the original the value of the clone to overwrite with the new updated

I haven't tested this, but I wager anyone who knows some javascript and RM code could probably piece together a script/plugin type thing for ya (or you yourself could do it).
Some Random Dude's Super Tools Engine

Awesome dev tool should hopefully be of some help... Can flip/edit switches, variables, objects, while in game. A bit above my head at times so maybe more than a little helpful to you.
Thanks for the replies! 🙂

@Jragyn
Ah, thank you. While I don't have much understanding of js, it's reassuring to hear that the solution should be fairly straightforward to set up.

@ephesus
Thanks for the heads up. While SRD's Super Tools doesn't quite do what I'm looking for, it's still pretty handy to have, and should help with testing.
Bump
I dont think that would be easy, if you have use for example
switches and variales 1-500 and move those higher to 501 - 1000
than you still need to manually change the variables and switches in
the game it self which arent directly changed.

how would you fix this problem? manually setting those over is probably
more work, so if you create them while making when you need it, than
what is the problem if you add 1-2 more if the switch has higher location?
I might be misinterpreting you question, but in the my case at least, I'm looking to push all of my switches and variables up by 2000, instead of just some of them.
I might be misinterpreting you question, but in the my case at least, I'm looking to push all of my switches and variables up by 2000, instead of just some of them.
I think @ShadowDragon is just trying to warn you that if you shifted all your switches in the database up by 2000, the editor would not helpfully accommodate any assignments you have to them presently.

Example:
if you have an event that leverages switch #25, programmatically shifting all switches by +2000 would not update your event to point at switch #2025.
Ah, I understand now.

I suppose in my case then, that would be what I'm hoping to achieve with this plugin. Bulk copying and pasting the names of all the switches/vars/etc is easy enough, it's the actual editing of the map and database files themselves to change any event that points to variable X to instead point to the variable that is 2000 greater that I'm going for.
Bump
@Jragyn it's not just the switches and variables themselves that would need to change, but you'd have to go through all the database and map files looking for where those switches and variables have been used, and adjust those as well.
Bumpers 😊
I might be able to do something like this for you, but how do you propose to increase common events by 2000 when that's the maximum number your project can have? 😛
I might be able to do something like this for you, but how do you propose to increase common events by 2000 when that's the maximum number your project can have? 😛
Hey, and thank you! If you are able to, it would be much appreciated.

And haha, fair point. Depending on how the plugin was set up, I'd probably run it once to move the switches/variables by +2000, and a second time to move Common Events by +500 or so. (As a side note, you can technically go over the limit of 2000 by manually adding new lines to the common event .json file, but I don't need that many CE's, haha.)
Okay, I've figured out all the moving parts for this. Will let you know when it's done.
Bump
Bumpers
Bump
Bumpers
Bump

Original thread: https://forums.rpgmakerweb.com/threads/dev-tool-shift-all-switches-variables-etc-by-x-slots.136160/