Author Topic: [SOLVED] Open a specific website from within an AGS game?  (Read 254 times)

Hi folks,

Is there a way to realize the following scenario within an AGS game?
Some GUI is shown.
  • User clicks on a specific GUI button
  • AGS reacts by opening the standard internet browser of the computer and showing a specific website in it.

This would probably only work on Windows systems, since Linux doesn't have the concept of a “standard” web browser AFAIK.
« Last Edit: 30 Jan 2020, 14:49 by fernewelten »

Re: Open a specific website from within an AGS game?
« Reply #1 on: 22 Dec 2019, 09:17 »
Yes you can do that with the ShellExecute plugin, this is what you should do:

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

Code: Adventure Game Studio
  1. // inside button interact
  2. ShellExecute("", "http://website.com", "");

Re: Open a specific website from within an AGS game?
« Reply #2 on: 22 Dec 2019, 13:59 »
This would probably only work on Windows systems, since Linux doesn't have the concept of a “standard” web browser AFAIK.
You would normally use 'xdg-open'.
https://www.freedesktop.org/wiki/Software/xdg-utils/


here for Windows and Linux -> https://www.adventuregamestudio.co.uk/forums/index.php?topic=30948.msg636585168#msg636585168

Sorry, I don't own a Linux system so I can only blindly obey instructions.

So where exactly does the file libagsshell.so go?
To ((program directory))/Linux/lib32, to ((program directory))/Linux/lib64 or to both of them?


eri0o

I know the plug-in is really simple but I believe I only built for Linux 64 bits.

The reason is I simply didn't had a 32 bit Linux installation to test.

So place it on lib64. AGS will complain you don't have the 32 bit version though.