Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
I was wondering if there is any mode or plugin that takes the username, or uses PC time, such as game time, or any plugin that does something similar, taking information from the computer and using it in the game  

Thank you very much in advance :elhappy::hhappy:
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
862
First Language
English
Primarily Uses
RMMV
@Edilsonsoares Sure, you can use the 'OS' feature of NWJS, the game player included with RPG Maker MV. Be aware that the following code only works in NWJS.

Code:
// Load the 'OS' module
var os = require('os');
// Execute the 'userinfo' method and read the 'username' property
os.userInfo().username;

Code:
// Load the 'OS' module
var os = require('os');
// Execute the 'uptime' method
os.uptime();

The full list of methods and properties of the 'OS' module can be found here.
 

Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
@Edilsonsoares Sure, you can use the 'OS' feature of NWJS, the game player included with RPG Maker MV. Be aware that the following code only works in NWJS.

Code:
// Load the 'OS' module
var os = require('os');
// Execute the 'userinfo' method and read the 'username' property
os.userInfo().username;

Code:
// Load the 'OS' module
var os = require('os');
// Execute the 'uptime' method
os.uptime();

The full list of methods and properties of the 'OS' module can be found here.



I got a little confused, do I need to download and put NWJS in my game? and how would i use these codes? in the text? or in m system? sorry, I'm a little layman
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
862
First Language
English
Primarily Uses
RMMV
@Edilsonsoares Ah, sorry, the player which loads up whenever you do a test play or deploy for a Windows environment is NWJS. Basically, what I am saying is that the code I used will only function within that player. For instance if you upload your game to ichi.io and open your game in another browser (Chrome, Firefox, etc), the code will not work.
 

Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
@Edilsonsoares Ah, sorry, the player which loads up whenever you do a test play or deploy for a Windows environment is NWJS. Basically, what I am saying is that the code I used will only function within that player. For instance if you upload your game to ichi.io and open your game in another browser (Chrome, Firefox, etc), the code will not work.

Damn, I thought it would be something like, writing a text in the dialog box, like "Congratulations" Carlos001 "(pc nick) a simpler thing
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
862
First Language
English
Primarily Uses
RMMV
@Edilsonsoares Well, you could do this :

Code:
◆Control Variables:#0001 = require('os').userInfo().username;
◆Text:None, Window, Bottom
:    :Hello \V[1] !

Basically, set a variable before the message using the 'script' option in the 'Control Variable' event command. Then use the text code \V[n] (where n is the variable id) to spit out the user name.
 

Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
@Edilsonsoares Well, you could do this :

Code:
◆Control Variables:#0001 = require('os').userInfo().username;
◆Text:None, Window, Bottom
:    :Hello \V[1] !

Basically, set a variable before the message using the 'script' option in the 'Control Variable' event command. Then use the text code \V[n] (where n is the variable id) to spit out the user name.

I'm feeling a little dumb now, thank you so much for your help now, for example, and just one thing that is not yet understood how to put Node.js in my project, now it's not my computer, for example, I'm a layman, and not being able to put Node.js in my project :eswt2:
 

Black Mamba

Veteran
Veteran
Joined
Mar 6, 2014
Messages
266
Reaction score
88
First Language
pt-br
Primarily Uses
can i make like doki doki literature club, when you progress the game it delete some game files?
 

myenemy

Veteran
Veteran
Joined
Jan 17, 2014
Messages
82
Reaction score
39
First Language
Spanish
Primarily Uses
RMMZ
can i make like doki doki literature club, when you progress the game it delete some game files?
You can if the game has the right permisions on the machine. Ask for a request for more info instead stealing a thread.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,481
Reaction score
1,871
First Language
EN
Primarily Uses
RMMZ
I'm feeling a little dumb now, thank you so much for your help now, for example, and just one thing that is not yet understood how to put Node.js in my project, now it's not my computer, for example, I'm a layman, and not being able to put Node.js in my project :eswt2:
NW is built on Node, and RMMV games (as Ossra stated) are built on NW. You don't have to include any extra modules or anything like that. The provided script calls can be used as-is, no further action necessary.

As mentioned, it'll only work for a local application, i.e. an app on the player's system. Standard browser security blocks remote attempts to access your private information. HTML-deployed RMMV games are sandboxed, which basically means they're extremely limited in what they can do outside that box, with good reason!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,334
Reaction score
11,758
First Language
English
Primarily Uses
RMVXA
@Black Mamba [mod]Please do not hijack a thread by asking a different question from that of the OP.[/mod]
Please start a separate thread.
 

Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
NW is built on Node, and RMMV games (as Ossra stated) are built on NW. You don't have to include any extra modules or anything like that. The provided script calls can be used as-is, no further action necessary.

As mentioned, it'll only work for a local application, i.e. an app on the player's system. Standard browser security blocks remote attempts to access your private information. HTML-deployed RMMV games are sandboxed, which basically means they're extremely limited in what they can do outside that box, with good reason!



thank you very much, you don't know how you made me happy, I tried here and it worked
 

Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
@Edilsonsoares Sure, you can use the 'OS' feature of NWJS, the game player included with RPG Maker MV. Be aware that the following code only works in NWJS.

Code:
// Load the 'OS' module
var os = require('os');
// Execute the 'userinfo' method and read the 'username' property
os.userInfo().username;

Code:
// Load the 'OS' module
var os = require('os');
// Execute the 'uptime' method
os.uptime();

The full list of methods and properties of the 'OS' module can be found here.


I tried here and it worked, thank you very much
 

Latest Threads

Latest Profile Posts

I cant not for the life of me figure out where this bomb item comes from.
Ami
this is Remade of my MZ Character,after acquire the free RPG Maker MZ
This One Plugin Adds Subfolder Support for Every Other Plugin | RPG Maker News #80

It's been so long... lol
Theydies and gentlethems, presenting Touch the Stars character #1: Anna Smith and her transformed form, Sagittaria!1624568259771.png

Forum statistics

Threads
112,546
Messages
1,069,092
Members
146,236
Latest member
Pulauputri
Top