MV Events - Find / Replace

Hey everyone,

As part of bringing a project from VX to MV, and with scripts now being plugins, there are certain Event Commands that I need to change en masse.

Basically, there are Event Commands where I used to control a script by altering a variable, but I now need to replace all of those with one of the new 'Plugin Commands' instead.

Is there some way of automating this? Something that allows me to change all instances of an Event Command with a different one? The equivalent of a 'Find & Replace' tool that you'd find in a word processor.

Hope I've explained this alright. 🙂
No - there is an event searcher in MV, but that won't work for scriptlines.


Best chance would be to use a good text editor to search & replace the string in the json files of the maps
No - there is an event searcher in MV, but that won't work for scriptlines.

Best chance would be to use a good text editor to search & replace the string in the json files of the maps
Hey, this was a simple but brilliant idea...! Worked perfectly. For some reason I thought event data was encoded into RPGM somehow, didn't realize it was just sitting right there in the map file.

For anyone else who comes across this, the only thing I would note is that if you're trying to change a control variable event, it can be a little tricky to search for. You can't search for what you've labelled the variable as - it uses an event code and then just the operand numbers.

So, in my case, I was trying to adapt something from Yanfly's VX Message Core into the new MV version. It used to be that you would have a variable control the number of rows for a message, but now you just send a straight-up plugin command to do it instead. I used Notepad++ to have all of my map files open simultaneously, and did a find and replace in all of them as such:

 

FIND:

 

{"code":122,"indent":0,"parameters":[1,1,0,0,16]}

 

REPLACE:

 

{"code":356,"indent":0,"parameters":["MessageRows 16"]}

 

Basically, this alters all event commands that used to change variable 001 from the default of '4' to '16' into a Plugin Command that does the same.

 

Thanks very much, Andar! With all the translations, my game has 184 maps with message rows switching from 4 to 16 and back again hundreds of times. You saved me a lot of boring work. 😉

Original thread: https://forums.rpgmakerweb.com/threads/mv-events-find-replace.48647/