Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Duration of dialog box
Old
Castrillon
Junior Member
 
Status: Offline
Posts: 4
Join Date: May 2012
Default Duration of dialog box - 05-11-2012, 05:28 AM

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..

Last edited by Castrillon; 05-11-2012 at 05:46 AM.
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 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.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Old
Castrillon
Junior Member
 
Status: Offline
Posts: 4
Join Date: May 2012
Default 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..
   
Reply With Quote
Old
Castrillon
Junior Member
 
Status: Offline
Posts: 4
Join Date: May 2012
Default 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
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 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.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Old
Castrillon
Junior Member
 
Status: Offline
Posts: 4
Join Date: May 2012
Default 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..
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 05-11-2012, 08:34 AM

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


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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