Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 16/02/2005 10:36:14

Title: Various newbie questions [SOLVED]
Post by: on Wed 16/02/2005 10:36:14
1. Is there a script command which can open an external file, similar to WinExec in MFC for example. So for example, I could open website when the user clicks a certain button from within the game?

2. Is there a way to easily reset the game? I know there is RestartGame() but that would take the player back to the main menu. What I want is for the player to be able to click New Game during another game, and for it to go straight into the actual start of the adventure, without taking him to the main menu.

3. Is there a way to hide/show GUI buttons during runtime? I.E If I was doing a Demo and Full Version of the game. For the full version I wouldnt want any BUY NOW! buttons to be displayed, but I would in the demo. Ideally I'd like to be able to switch the buy buttons on and off by changing just one variable.

Thanks in advance!
Title: Re: Various newbie questions
Post by: strazer on Wed 16/02/2005 11:55:34
1. I don't think so.

2. SetRestartPoint

3. With AGS v2.7 you will be able to easily switch GUI controls on/off with the .Visible property, but with AGS v2.62 you have to move them away with SetGUIObjectPosition.
Title: Re: Various newbie questions
Post by: Radiant on Wed 16/02/2005 12:49:40
Quote from: Nexic on Wed 16/02/2005 10:36:14
1. Is there a script command which can open an external file, similar to WinExec in MFC for example. So for example, I could open website when the user clicks a certain button from within the game?
No. Also in full-screen mode that would be mildly problematic. What some games do is write their own 'front end' program in, for instance, Visual Basic, that allows you to play, config, read help, go to webpage or uninstall.

Quote
3. Is there a way to hide/show GUI buttons during runtime?
As strazer says, or alternatively set their image to something empty, or put them on a different (but overlapping) GUI that you can turn on/off separately.
Title: Re: Various newbie questions
Post by: on Wed 16/02/2005 13:08:51
Thanks for the help... again!
Title: Re: Various newbie questions [SOLVED]
Post by: RickJ on Thu 17/02/2005 02:06:58
Quote
1. Is there a script command which can open an external file, similar to WinExec in MFC for example. So for example, I could open website when the user clicks a certain button from within the game?
The others have answered your actual question but here are a few asides:

Title: Re: Various newbie questions
Post by: x_traveler_x on Sat 19/02/2005 20:26:30
Quote
3. Is there a way to hide/show GUI buttons during runtime?

I prefer SetGUIObjectEnabled(GUI, int object, int enable).  This will make your GUI button non-clickable.  Note that instead of making it invisible, it will just grey it out.  This is exceptionally handy if you have a button used for inventory items.