ID:269233
![]() Apr 20 2005, 4:19 pm
|
|
How would i go about making a pause proc for like pausing a single player world, then having it reume every thing that was paused and picking up exactly where it left off?
|
Hiro the Dragon King wrote:
How would i go about making a pause proc for like pausing a single player world, then having it reume every thing that was paused and picking up exactly where it left off? The hard part isn't really the proc; it's the way you pause the action. Basically this would be done with a simple var, and anything that runs needs to suspend its actions until the var is cleared. If any homemade timers are running, you need to notify them so they can keep track of when they paused, so they'll know exactly what to do when they resume. Lummox JR |
I'm pretty sure one can "pause" everything. It's the matter of knowing how to do it and being skilled enough to know how to do it. I'd say Lummox Jr could accomplish it if he tried. At least I do think someone can accomplish this feat..
But, I've seen people make some pretty amazing thngs with DM. I've seen a 3d engine with nice polygons, and it didn't have to pause and load to see the next view. It basically rotated an object and it had great lighting effects when doing so, looked pretty nice. I believe there is a demo on the engine, however, it isn't open source. I've also heard in many places that almost anything is possible in DM, why not pause? And if DM can handle a pretty nice 3-D system, why can it not handle a pause command? He did say it was single player, it's not like you are pausing everyone about.. |
You would have to go through every proc in the world (including built-in ones) and set a variable with a time to pick up at. This would be a waste of time.
-Ryan |
Ryne Rekab wrote:
You would have to go through every proc in the world (including built-in ones) and set a variable with a time to pick up at. This would be a waste of time. Well not really. With most procs it's simply a matter of waiting and not doing anything until the pause is finished. Built-in procs you don't have to worry about because anything you'd pause would by necessity have to avoid using anything it couldn't control (like walk() or such). And you wouldn't set the time to unpause, because that's an unknown. Lummox JR |
CaptFalcon33035 wrote:
I'm pretty sure one can "pause" everything. It's the matter of knowing how to do it and being skilled enough to know how to do it. I'd say Lummox Jr could accomplish it if he tried. At least I do think someone can accomplish this feat.. It's actually pretty trivial; you just have to be careful not to forget to pause something. Procs that run on timers need to be paused, obviously. This is as easy as inserting this line in appropriate places (probably after the proc's own delay): while (paused) sleep(5) Verbs need to be disallowed: mob/verb/say() And so does movement: mob/Move() There are few oddities with this - for example, if you pause for a few hours and come back, every single timer in the world will trigger at once when you unpause - but there are ways around that. (Hint: Rather than having one huge long sleep(), break it up into multiple sleep()s using a for loop and do the pause check every iteration of the loop.) If you make sure to apply it to any proc that sleep()s or recursively spawn()s itself, apply it to all of your verbs (except the unpause verb =P), and (importantly) test it thoroughly, there shouldn't be a problem. |
-Ryan