Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Netgibbon on Mon 13/02/2017 21:10:42

Title: Opening web links from within a game
Post by: Netgibbon on Mon 13/02/2017 21:10:42
Is it possible to put an image in an area like the main menu and use something like a hotspot and a click function to open up a web page in a player's browser?
If there is, it'd be cool to know how to do it but if not I suppose I'll have to figure out some other way of achieving this.
Title: Re: Opening web links from within a game
Post by: Khris on Tue 14/02/2017 02:05:26
You can open a browser using this plugin: download (https://mega.nz/#!FcJnBR7D!tNlnCFLlqv0Lp6G2ZSrJoQGYxRcDzIQueSiWKnw59Mc)

1. save and close your game
2. copy the plugin dll into the main AGS folder
3. open the editor and open your game
4. activate the plugin in the project tree

You can now use this command:

int ShellExecute(const string operation, const string file, const string parameters, ShowCommand showCommand = SW_SHOW);

To open a website, use

  // inside hotspot's interact function
  ShellExecute("", "http://website.com", "");
Title: Re: Opening web links from within a game
Post by: Netgibbon on Tue 14/02/2017 23:26:49
Thanks for the reply. I'll give it a shot :-D