ID:164734
 
I'm trying to make a semi-turned based combat system. Like most turned based combat, there are rounds, and each round is broken into 10 time sections. I was hoping to make it so that if you don't make a decision in 10 seconds, then you take the default action.

can this be done? I mean, if I ask for an input, doesn't beyond freeze everything else in that proc until an input is given?
You could do something similar to this, not sure if its the "best" way...
spawn()
input("Lots of choices and such") // just do you input stuff under spawn
sleep(100)//wait ten seconds
if(player has not made a decision)
//do default action
else
//do chosen action


As you can see that won't work with copy&paste...

Hope that helps!

-KirbyAllStar
In response to KirbyAllStar
KirbyAllStar wrote:
You could do something similar to this, not sure if its the "best" way...
> spawn()
> input("Lots of choices and such") // just do you input stuff under spawn
> sleep(100)//wait ten seconds
> if(player has not made a decision)
> //do default action
> else
> //do chosen action
>

As you can see that won't work with copy&paste...

Hope that helps!

-KirbyAllStar

All and good, but with that the input window stays does it not?

In response to Jik
You might do better to look up Kujila's prompt closing library.
I haven't read the actual programming, don't care to, but you might learn something about what you're wanting to do if you can understand it.
In response to Jik
Yes, well the best way I could tell you would be to not allow the input from the player to do any actions if the time has elapsed.

Or read the library pointed out in another post.

-KirbyAllStar
In response to KirbyAllStar
This is completely untested, but it should work.
input
proc
input(recipient = usr,messsage,title,default)
spawn() input(recipient,message,title,default)
and do
var/input/I = new
I.input(whatever)
spawn(time) del(I)
In response to Xx Dark Wizard xX
Well, yes, this idea works. Not your specific code though. Also you should of course just handle it in New(); I'm not even sure if you can have a custom proc named input() 'n stuff.
In response to Keeth
Keeth wrote:
You might do better to look up Kujila's prompt closing library.
I haven't read the actual programming, don't care to, but you might learn something about what you're wanting to do if you can understand it.

Thanks all. I will try some of these ideas out.