Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Duration of dialog box (http://www.alice.org/community/showthread.php?t=8498)

Castrillon 05-11-2012 05:28 AM

Duration of dialog box
 
Hi there..my first post..yeah..I am new to Alice but I have a strong background in programming in C++.So my first question is how do I make the dialog box which came from an "ask user for a string" command appear only for a specific amount of time (let's say 2 seconds)?? And my second question is if I can specify, and of course save, the time that the user needed to answer in what I asked him to type in the dialog box mentioned above???

Thanks everyone in advance..

arty-fishL 05-11-2012 06:12 AM

You cant.

What you could do is make a graphical input box. You could create 3D text and use key listener events to update it, but that's rather elaborate for just getting a string from the user.

You could also set a number variable to the time (under world functions) before showing the dialog, ensure the user knows how long they have to answer, and after they answer subtract the new time from the previous time. Then you could work out if they answered within time. But as far as actually cancelling the dialog goes, that is not possible.

Castrillon 05-11-2012 06:33 AM

Thank you very much..I'm gonna try the last one you said..I think it would be better.. :)

Castrillon 05-11-2012 06:44 AM

ok..done..but i can only display seconds of time..and as I mentioned the duration will be 2 seconds..so I would like to be more precise and have some information about the subdivisions of time..is that possible? Thanx

arty-fishL 05-11-2012 06:56 AM

I don't think you can get more precise. The only way to do that would be to use the "time elapsed" function, but that returns the wrong value as the world freezes when you show a dialog.

The only other way of doing this that I can think of would be to use Jython scripting, then you could get your exact originally desired result. Issue here is I don't usually like to bring up scripting with newbies to the forums as these are usually assignments or homework, so scripting may not be allowed.

Castrillon 05-11-2012 08:06 AM

Yes, I've already tried the "time elapsed" function but as you said I noticed that time probably freezes when dialog box comes out..Having a timer next to dialog box I guess it would do the same, no? Such as freezing during dialog box is in surface,eh?? You're right, I don't want to mix some scripting because it is supposed to be an assignment..Maybe I should ask professor how precise he wants us to be..But if you have to answer in 2 seconds, there are not a lot of options (your time will be 1 or 2 - not so fast to do 0).Anyway, thank you so much for your time and of course for your help..

arty-fishL 05-11-2012 08:34 AM

NP. Sorry I couldn't help you out properly. :)


All times are GMT -5. The time now is 06:01 PM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.