MV Cool JS function for hacker games or games that get meta

I haven't had a ton of time to make stuff in RPGMaker lately, but I still wanted to get better at code for when school is done and I have a little more time, so I've been taking these 5 minute JS coding lessons off an app recently. Anyhow, today I ran into this cool function that I hadn't seen before, and I though most other people probably wouldn't have seen it either, but it could be really cool.

The function is
console.log("your string goes here")

What it does is prints the string to your debug console (which you can see in-game by pressing F12 or Ctrl+Shift+I or clicking "Inspect" off the right-click button, where it pops open another window for you to see your console).

There's probably a whole host of other methods you could use with config to do interesting things with, but this is the one the lesson was about, so it's all I've run into

Anyhow, I thought this cool be really cool for a game that involved hacking or that wanted to get really meta or something, with the game giving "secret" instructions or messages to the player as they play through various parts of the game. The game I'm working on doesn't really make use of that, so I thought I'd share here so somebody else could use it.

I did a quick sort of mockup of what a game that uses this could maybe look like.
1618212080212.png

1618212174498.png

Of course, I have found that the console won't show the results of console.log() unless the F12 screen was open before the script was run, so that could cause some potential challenges.

I just thought this was potentially a cool idea. Thank you for coming to my BREDtalk.
Cool idea! Reminds me of the Literature Club where you open the Game's directory to delete characters from the disk and then they are wiped from the story line.

In the Dev Tools, you have a Tab called "Source" that lets you inspect the Source Code, including Core Scripts and Plugins. So you can leave secret Messages in your Plugin. What you can also do, as an extended step, is bringing the Player to put Break Points somewhere, this halts your game and lets the Player inspect all the Variables (not only RPG Maker Variables, I mean ALL Variables). Just giving you some inspiration, prompting the Player with all this information could be too much though.
Anyhow, today I ran into this cool function that I hadn't seen before
The function is
console.log("your string goes here")
Great, now you know why the first lesson of absolutely every programming language(?) is to print "Hello world" 😀
print() and console.log() are different functions, although they do serve similar purposes.

I just checked it just now to be sure, and although console.log() will appear in the console, using print() actually tries to print a screenshot as a .pdf, despite the fact that I entered a string as an argument.
1618265229505.png


1618265197128.png

1618265709238.png
Just so you know: you can also write code straight into the log and it will show in the game. Type - $gameParty.gainGold(100); - for example, and see what happens. There is a spreadsheet with a lot of script calls you can use:
Ah yes, this spreadsheet is fantastic! Everybody should have a copy of it saved somewhere for reference, it's helped me out so often! I also recommend they also use the documentation at https://kinoar.github.io/rmmv-doc-web/index.html, which really complements that spreadsheet nicely to give the best possible overview of how to make use of MV.
Just so you know: you can also write code straight into the log and it will show in the game. Type - $gameParty.gainGold(100); - for example, and see what happens. There is a spreadsheet with a lot of script calls you can use:

Original thread: https://forums.rpgmakerweb.com/threads/cool-js-function-for-hacker-games-or-games-that-get-meta.135416/