Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
677
Reaction score
219
First Language
English
Primarily Uses
RMMV
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!
 

Jragyn

JABS codemonkey
Veteran
Joined
Aug 14, 2012
Messages
221
Reaction score
169
First Language
English
Primarily Uses
RMMZ
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).
 

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
677
Reaction score
219
First Language
English
Primarily Uses
RMMV
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.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,013
Reaction score
1,523
First Language
Dutch
Primarily Uses
RMMV
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?
 

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
677
Reaction score
219
First Language
English
Primarily Uses
RMMV
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.
 

Jragyn

JABS codemonkey
Veteran
Joined
Aug 14, 2012
Messages
221
Reaction score
169
First Language
English
Primarily Uses
RMMZ
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.
 

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
677
Reaction score
219
First Language
English
Primarily Uses
RMMV
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.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,529
Reaction score
14,848
First Language
English
Primarily Uses
RMMV
@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.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,499
Reaction score
2,615
First Language
English
Primarily Uses
RMMZ
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? :p
 

Vis_Mage

Novice Magician
Veteran
Joined
Jul 28, 2013
Messages
677
Reaction score
219
First Language
English
Primarily Uses
RMMV
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? :p
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.)
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,499
Reaction score
2,615
First Language
English
Primarily Uses
RMMZ
Okay, I've figured out all the moving parts for this. Will let you know when it's done.
 

Latest Threads

Latest Profile Posts

Hope he recovers fast :|
Looks like it's functional:
It's a common thing to forget eating &drinking while you are working concentrated, right?
If I had discovered RPG-Maker before moving together with my girlfriend, I'd have died of dehydration a long time ago.
Ami
trying to change my picture & got screwed up...
I've been busy working on my next music pack, and I've also been busy composing some personal compositions. Depending on the type of mood and setting, sometimes I just really love the sound of music created in lofi mono. It has its charm.

Forum statistics

Threads
112,495
Messages
1,068,680
Members
146,163
Latest member
cryoparty
Top