question screen

Started by Best, Sun 14/09/2003 21:49:36

Previous topic - Next topic

Best

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.
Valame tes lan-utas desi gronto?

Ishmael

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?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Best

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...
Valame tes lan-utas desi gronto?

ThunderStorm

As for music:
Try the freeware MIDI sequencer Jazz++ on www.jazzware.com.

dtm1980

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}

Scummbuddy

i think an if else statement would work better.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Best

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.
Valame tes lan-utas desi gronto?

Ishmael

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);
}
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk