Hi. Is there a way to make a hotspot, that can open an URL for the outer web-site?
Inserting URL in the game
Visual Novel Maker SupportPut it in a script call command:
that will open the link in the user's default browser
if you want it to open in VNM you can use this
Code:
nw.Shell.openExternal("example.com");
Code:
window.open("example.com", "_blank");
Wonderful! Thanks a lot!
I've tried implementing this feature to open links to NG and Patreon and the script does work as indicated. However, during the testing, after I press one of them, the other buttons on the main menu screen don't work anymore, they still make the hotspot hover and click noises when I look over them but they don't function properly when clicked on. I attached a screenshot of what I've done. Do I need to have something after the script to prevent the issue? Or did I break something else?
Ok, I actually found a fix myself. Basically if you put a "jump to label" after the script that goes to the beginning of the scene. It'll go back to normal.
Does this script not work for web versions? I've tried uploading a version to NG but the buttons don't seem to do anything. I haven't changed anything since the last post, since it works on exe and mac versions.
EDIT: Implementing the second option that opens the url in game has it work, however it doesn't open in the game. It opens in a browser tab which is a bit confusing imo but it works so I don't have a problem.
The best way I found it was to place a link on a button (image), using a hospot that calls a common event, in that common event you put a script with one of the codes that Archeia put.
Hotspot - call common event --- script with link code.
Works on any label or scene. Just call the common event.
Hotspot - call common event --- script with link code.
Works on any label or scene. Just call the common event.
Original thread: https://forums.rpgmakerweb.com/threads/inserting-url-in-the-game.107245/