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

NeptuneTron

The Salticid Scholar of the North
Veteran
Joined
Jan 13, 2018
Messages
71
Reaction score
39
First Language
English
Primarily Uses
RMMV
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.
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
534
Reaction score
510
First Language
german
Primarily Uses
RMMZ
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.
 

NeptuneTron

The Salticid Scholar of the North
Veteran
Joined
Jan 13, 2018
Messages
71
Reaction score
39
First Language
English
Primarily Uses
RMMV
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
 

Mike-Turtle

Villager
Member
Joined
Apr 17, 2021
Messages
14
Reaction score
26
First Language
English
Primarily Uses
RMMV
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:
 

NeptuneTron

The Salticid Scholar of the North
Veteran
Joined
Jan 13, 2018
Messages
71
Reaction score
39
First Language
English
Primarily Uses
RMMV
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:
 

Latest Threads

Latest Profile Posts

just beat ff7 original for the first time since 2010. having played remake last year, I have a much better appreciation for the original oddly enough. I still like some of the character presentation in remake more, but the original's got a lot going for it.
Ever reach that moment in your life when your juggling a dozen or more projects that you know will never be made but don't have the heart to delete them? Ugh, I hate those moments...
:kaosigh: Why must you hurt me so?
my main character isn't the warrior of light or the chosen one, he's a self righteous, invasive try hard who gets ahead of himself and makes a critical error, resulting in a downward moral spiral that, eventually, leads him to truths that make him a better man, and im DAMN proud of that.
Generate Actors, Dark Fantasy Monsters, & I Heard There Was a Chosen One, | RPG Maker News #42

Work on Cat Quest: The Last Catmancer continues slowly but surely. :kaopride: Today I received the Game Over screen from @Finnuval!
GameOver.png

Forum statistics

Threads
111,448
Messages
1,061,175
Members
144,813
Latest member
SCLemon
Top