Scripts open external windows RPG Maker MV.

LyonBuster

GAN's Professor
Veteran
Joined
Apr 8, 2018
Messages
69
Reaction score
22
First Language
Spanish
Primarily Uses
RMMV
It is something as simple as to open another window with these comands inside the script in-game boxes, using the prebuilt pdf lector of chrome, or the mp3 lector:
JavaScript:
window.open('url')
window.open('book.pdf')
window.open('music.mp3')
As you can see, it is not necessary to use YEP_External_Links.js. But you lack the control the plugin has. It's a shame, but easier than with plugins.

So RPG Maker MV's Built-in Chrome can both support m4a, ogg and mp3 files. I knew it from the first time i could open an external window.

AND PDFS. With pdfs you can just turn-it-around and create a fabulous book inside the game. It just another way to make permanent tutorials, stories, bestiaries and item books and loads of things.

So, my questions:
It's there any way to open an mp3 music without opening another window?.
Can we get advantage of external window opening in another ways? (see my other linked questions: Question 1, Question 2)
It is necessary to create a brand new plugin from scratch in order to do so, or it is viable with scripting?
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,895
Reaction score
1,029
First Language
Dutch
Primarily Uses
RMMV
I know only how to open a website, but there are ways to open files (if exist)
in the gamefolder which should be specified.

for any website you can use one of those:

// Open URL in a new window
window.open('https://github.com/nwjs/nw.js', '_blank');

// Open URL with default browser (Windows Or Mac Only)
require('nw.gui').Shell.openExternal('https://web-adress/nwjs/nw.js');

the best one is the shell.openExternal , as for open MP3 file from the root or audio folder,
I think you need to place ./audio/mp3 or similair, but I cant confirm that though.

else you need to make a plugin for it, that can open like that if it goes to the root directly.
 

LyonBuster

GAN's Professor
Veteran
Joined
Apr 8, 2018
Messages
69
Reaction score
22
First Language
Spanish
Primarily Uses
RMMV
// Open URL with default browser (Windows Or Mac Only)
require('nw.gui').Shell.openExternal('https://web-adress/nwjs/nw.js');
I suppose that with this you achieve to open an url within the game window?
Or is it for internet connected games?


Yes, for both pdf and mp3 you have to track the folder they are. But they open a new window though.
Is it possible to maintain it on game window?
 

LyonBuster

GAN's Professor
Veteran
Joined
Apr 8, 2018
Messages
69
Reaction score
22
First Language
Spanish
Primarily Uses
RMMV
// Open URL with default browser (Windows Or Mac Only)
require('nw.gui').Shell.openExternal('https://web-adress/nwjs/nw.js');
I suppose that with this you achieve to open an url within the game window?
Or is it for internet connected games?
I've just tried this piece of code, and what it makes is opening in on the net within the default PC browser.
It's not what I want to do, as i try to make an off-line game.
I know that if the game is off-line, an url example should not be used. But i used it 'coz it's the default purpose of the code.

So... in order to do what i want at the scale I want... i shall make a plugin, uh?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
The window itself is always a browser of some sort (a local deployment is essentially a custom Chromium browser); its address/location determines which page/file is being displayed. You can directly get/set the window's current location value via a Script command, e.g.
JavaScript:
window.location = "https://forums.rpgmakerweb.com";
Not sure how you plan to let players navigate back to the game, though. :kaoswt:
 

LyonBuster

GAN's Professor
Veteran
Joined
Apr 8, 2018
Messages
69
Reaction score
22
First Language
Spanish
Primarily Uses
RMMV
Not sure how you plan to let players navigate back to the game, though. :kaoswt:
I think this is just my problem and i didn't know how to express it.
There should be a way to control the time you have been with the other window browser open or a way to get players back to the game.


For example, with a pdf you'll open the Chromium pdf reader and you'll have to close manually the window.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top