Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Best on Sun 14/09/2003 21:49:36

Title: question screen
Post by: Best on Sun 14/09/2003 21:49:36
I would like to know, how to make a question screen. FE: There is a question and then I want screen to appear. Into this screen player have to write exact word to answer the question.

Thanks.
Title: Re:question screen
Post by: Ishmael on Mon 15/09/2003 05:15:35
From the manual:

InputBox

InputBox (string prompt, string buffer)

This function allows your script to read a string typed in by the user. When this function is called it pops up a window asking the user to type in a string, with PROMPT as the text in the window. What they type in will be copied into BUFFER.
Note that this function only allows small strings (about 20 characters) due to the size of the input box it uses.

Example:

string name;
InputBox("What is your name?", name);

will prompt the user for his name and store in in the string name.


For a start?
Title: Re:question screen
Post by: Best on Mon 15/09/2003 11:35:38
Thats handy, thank you.
Now I know how to do this, but what should I do if I want to start some animation or something like that when player replies YES and another one when he replies NO.

2. How should I compose music? I cannot find any useful program on the net.

Thanky...
Title: Re:question screen
Post by: ThunderStorm on Mon 15/09/2003 12:42:51
As for music:
Try the freeware MIDI sequencer Jazz++ on www.jazzware.com.
Title: Re:question screen
Post by: on Mon 15/09/2003 12:58:43
1:   Try something like that:

Using TKs code...

If name=="yes"             // for name you can of course use answer instead
{your code for the animation} // f.e. AnimateCharcter(...); see help index.

Same for other answers

If name=="no"
{your code}

If name=="" // anything that is neither "yes" nor "no"
{your code ask player again , or so}
Title: Re:question screen
Post by: Scummbuddy on Mon 15/09/2003 15:03:16
i think an if else statement would work better.
Title: Re:question screen
Post by: Best on Mon 15/09/2003 16:45:42
I did this:

 // script for room: First time player enters screen
 
 string name;
 InputBox("Do you do?", name);
 
 if( name=="yes" )
{
   QuitGame (0);
}
 if( name=="no" )
{
 NewRoom (2);
}


Not working in the game. Just the screen asking me  : Do you do? and then (when I answer) nothing happened.
Title: Re:question screen
Post by: Ishmael on Mon 15/09/2003 17:08:53
ImputBox("Do you do?", name);

if (StrCaseComp("yes", name) == 0) { // in case the player types "Yes", "YeS" or "YES", it detect's it as "yes", see the StrCaseComp in teh manual for info on it
QuitGame();
} else { // if answered anything else than "yes", runs this script
NewRoom(2);
}