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
65
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
528
Reaction score
502
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
65
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
13
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
65
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 Posts

Latest Profile Posts

I wish I can work faster on my game. But I don't want to get burned out. :(
I've been working on something on and off for a few years now, and I've been reluctant to share any details on the project before I had anything playable because I did not want to generate hype only for the project to go back on hiatus. That being said I believe what I'm working on is very unique and pushes the boundaries of what RPG Maker projects can be. Bold claims, I know but just wait.
Happy Mother's Day to all the moms :)
Create Anime Art w/ AI, Tall Sprites with Aurora, Customize Variable Display | RPG Maker News #34

[My favorite slow moving track I've made so far]

Forum statistics

Threads
111,200
Messages
1,059,220
Members
144,451
Latest member
Devilstick
Top