catventure
12-12-2005, 21:01
Hi,
Need some advice here...
I want to add a 'timeout' feature to my text adventure project.
If the player takes too long to type in some text input into a textbox control - and press a button control to 'enter' it, then I wish to cause a message such as "Time Passes..." to appear in the output textbox.
I've assumed I may need to do something along the lines of below using TIMER:
dim tempval as double
dim timeout as long value 30
'set 30 second timeout??
tempval=TIMER+timeout
and then immediately after that some sort of loop to check whether the 30 seconds has passed:
if TIMER>=tempval then
control append text hdlg,%ID_TEXTBOX1,"Time Passes..."
end if
The timeout would need to be aborted should the player respond within the 30 seconds and reset after text output for the next player input...
I'm not quite sure how to code it and whether or not the check should be in the dialog window event handler loop or outside of it...
I tried a few things but not having much joy.
Regards,
catventure.
Need some advice here...
I want to add a 'timeout' feature to my text adventure project.
If the player takes too long to type in some text input into a textbox control - and press a button control to 'enter' it, then I wish to cause a message such as "Time Passes..." to appear in the output textbox.
I've assumed I may need to do something along the lines of below using TIMER:
dim tempval as double
dim timeout as long value 30
'set 30 second timeout??
tempval=TIMER+timeout
and then immediately after that some sort of loop to check whether the 30 seconds has passed:
if TIMER>=tempval then
control append text hdlg,%ID_TEXTBOX1,"Time Passes..."
end if
The timeout would need to be aborted should the player respond within the 30 seconds and reset after text output for the next player input...
I'm not quite sure how to code it and whether or not the check should be in the dialog window event handler loop or outside of it...
I tried a few things but not having much joy.
Regards,
catventure.