Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: shaungaryevans on Mon 27/10/2008 11:09:30

Title: Make a question within a game?
Post by: shaungaryevans on Mon 27/10/2008 11:09:30
Hi all,

I want to make a question within a room, if they get it right a object appears but if they get it wrong the game will restart? Can somebody help me by explaining how would I do this please?
Title: Re: Make a question within a game?
Post by: Khris on Mon 27/10/2008 11:12:17
This should be what you're looking for:
http://www.adventuregamestudio.co.uk/manual/Game.InputBox.htm

If you want a prettier input box, create a GUI with a text input field, make it visible when the question is supposed to appear and handle the answer in its OnActivate function.
Title: Re: Make a question within a game?
Post by: shaungaryevans on Mon 27/10/2008 19:47:35
ok? Can you create a hotspot that if you click or interact with it, it activeate a GUI? If yes how?
Title: Re: Make a question within a game?
Post by: RickJ on Mon 27/10/2008 20:36:37
1. Create a gui and give it a name such as gMygui

2. Create a hotspot and give it a script name such as  hHotspot1.

3. Create an interaction function using the lighting bolt icon.

4. Use the following code to activate the gui


function hHotspot1_Interact() {
     gMygui.Visible = true;
}
Title: Re: Make a question within a game?
Post by: shaungaryevans on Mon 27/10/2008 20:46:09
thanks for that!!!  :)
Title: Re: Make a question within a game?
Post by: shaungaryevans on Mon 27/10/2008 21:00:46
soory but one more question, I made my own GUI and when I tested the game the GUI came up straight away, I want it to come up when i say. How can I do this please?
Title: Re: Make a question within a game?
Post by: monkey0506 on Mon 27/10/2008 21:11:54
You can set that via the "Visibility" property in the GUI's pane (i.e., the window where you can edit the GUI in the editor). Setting it to "Pause game when shown" or "Normal, initially off" would have it turned off at the start of the game and appear when you set the Visible property of the GUI to true (in your script). "Pause game when shown," as it says, pauses the game any time the GUI is shown on-screen, "Normal, initially off" does not.

Oh, also, at the top of your posts there is a link, "Modify." It's usually best to modify your posts instead of double-posting (per forum rules). ;)
Title: Re: Make a question within a game?
Post by: shaungaryevans on Mon 27/10/2008 21:15:33
Thank you :)