Printing or exporting event code.

Here's my situation. I'm using a rather long common event from a posted demo from somewhere as the basis for a minigame I'm putting in my game. (all permitted by the author)

However, like I said, it's quite long, and I need to make a lot of edits, as well as put in my own code where it's needed so that it interacts with certain switches etc. I could go line by line and make those changes, (mostly replacing variables since those var id's are already used elsewhere) but after a while it gets repetitive and easy to lose track of where I am. So I have to reload the original demo, double check myself, then reload my project, scroll down (would love it if there were a search function in a future release of MV that would allow us to locate code or comment in an event--or better yet search and replace) 🙂 Anyway, you get the picture.

Is there a way (or program, I'm not picky) that allows me to copy and paste or export the code to a text file or something so I can have a written copy to refer to, make notes on as to variable names etc? Or am I stuck with doing a line by line change?
You can make bulk find/replace from the json files in the data folder. Since it's a common event, it should be the CommonEvents.json file. Make sure to keep a backup in case you mess up. You can try the online json beautifier sites to make it easier to read.
@Hyouryuu-Na I've actually tried that. The problem is that the json files are primarily just a bunch of numbers and stuff I do not recognize.
code, indent, parameters. Nothing to (obviously, at least) indicate what is an if statement, a variable assignment, values assigned to that variable etc.

I'm willing to give it a shot but that leads to the question of how do I decode what is actually in the JSON file? If it were just a matter of making text edits, I could do that easily. I'm talking about editing the code. and variables.
I thought you just wanted to change values? It's easy to find and replace values directly in the json file then doing it manually.
I went ahead and did a test.
This is a test common event:
1602957206730.png

This is the json file:
JSON:
[
null,
{"id":1,"list":[{"code":122,"indent":0,"parameters":[2,2,0,0,10]},{"code":121,"indent":0,"parameters":[1,1,0]},{"code":111,"indent":0,"parameters":[0,1,0]},{"code":355,"indent":1,"parameters":["\"I'm a script\""]},{"code":0,"indent":1,"parameters":[]},{"code":412,"indent":0,"parameters":[]},{"code":0,"indent":0,"parameters":[]}],"name":"","switchId":1,"trigger":0}
]

So matching them... code 122 is variable assignment, code 121 is switch assignment, code 111 is conditional branch and code 355 is script call... probably.

I think it would just be better to do it manually than trying to understand these stuff.
code":122,"indent":0,"parameters":[2,2,0,0,10]}

Actually, in this instance what I'm trying to do is change which variable itself is called.
In your example, the variable id is 2, but there are 2 2's in the parameters. Any idea which, or both would need changing?

Anybody happen to know if there's a RMMV JSON file reference somewhere?

Original thread: https://forums.rpgmakerweb.com/threads/printing-or-exporting-event-code.128794/