The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: jackspinoza on January 29, 2013, 01:00:49 PM

Title: open a website from an event [VX Ace request]
Post by: jackspinoza on January 29, 2013, 01:00:49 PM
To whom it may concern,
Thanks for taking a moment to read this request. I've been trying to make an event where the player is given a choice to open a website. My problem is I still can't get my head around scripting.  I thought I could use something like this to show walkthroughs or make colourful puzzles or enhance the story using a related blog.

I need it to:
*open a website from an event script in RPGmaker VX Ace


I've seen Modern Algebra made a fantastic website-opening-script here:  http://rmrk.net/index.php/topic,44535.0.html (http://rmrk.net/index.php/topic,44535.0.html)
That's what gave me the inspiration and the realisation that such a thing might be possible. But it works from the title screen and not whilst playing. Perhaps I'm asking for something that isn't possible.

Thanks in advance and keep well.
J
Title: Re: open a website from an event [VX Ace request]
Post by: D&P3 on January 29, 2013, 01:26:06 PM
Use this:

Code: [Select]
# Use The Following in a Script Call:
#       open_website( url )
# Replacing the URL  with a websire url in quotation marks
# So the Following would be valid:
#   open_website( "rmrk.net" )

class Game_Interpreter
  def open_website( url )
    url.gsub!("http://", "")
    Thread.new { system("start http://#{url}") }
  end
end

The Code was taken from Modern Algebra's script and fixed up for you, so don't credit me for it.
Title: Re: open a website from an event [VX Ace request]
Post by: jackspinoza on January 29, 2013, 01:58:22 PM
Thank you so much! I was miles off the mark with where I was going. I hope I didn't inconvenience you too much and I hope this might be useful for others.

And so fast!