Make a question within a game?

Started by shaungaryevans, Mon 27/10/2008 11:09:30

Previous topic - Next topic

shaungaryevans

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?

Khris

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.

shaungaryevans

ok? Can you create a hotspot that if you click or interact with it, it activeate a GUI? If yes how?

RickJ

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

Code: ags

function hHotspot1_Interact() {
     gMygui.Visible = true;
}

shaungaryevans


shaungaryevans

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?

monkey0506

#6
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). ;)

shaungaryevans


SMF spam blocked by CleanTalk