Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ pauses in mprogs
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Ellie
(4 posts) Bio
|
Date
| Mon 05 Jan 2004 03:35 PM (UTC) |
Message
| Hey all. I was wondering if there was any way to put pauses into mprogs. For instance, having a minstrel type mob able to tell a story longer than 2 or 3 lines with enough time for someone to actually read before the next few lines come up. I know I've seen this other places, but not sure what kind of codebase was used. Thanks for the help! | Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #1 on Mon 05 Jan 2004 06:08 PM (UTC) |
Message
| The only codebase Ive seen that it actually works on is Dawn of Time though there may be others. I used it quite extensively in our newbie academy on SB:R and if you want to test it, the syntax would be something like mpq <delay in seconds> |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #2 on Mon 05 Jan 2004 07:30 PM (UTC) |
Message
| Pauses must be one of the most frequently-asked for, and hardest things to do, at both client and server end. The reason is, simply, that both ends are usually needing to do something else (eg. handle other players), so a literal "do nothing for 3 seconds" will not work.
At the server end it could be done, but you would need something like:
a) break the story into pieces
b) send one piece
c) mark the player as needing to do something in (say) 3 seconds
d) pick that up in the heartbeat loop at the appropriate time
e) allow for cancelling (eg. the player has stopped listening)
f) advance to the next piece
g) go to (b)
SMAUG does has some provisions for timed events, you could hook into that.
There have been some posts about this in the past, in fact the one about sending a story in pieces is one of them. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Ellie
(4 posts) Bio
|
Date
| Reply #3 on Mon 05 Jan 2004 09:38 PM (UTC) |
Message
| Thanks for the help guys! I'll let you know what we figure out. :) | Top |
|
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #4 on Tue 06 Jan 2004 02:05 AM (UTC) Amended on Tue 06 Jan 2004 02:07 AM (UTC) by Nick Cash
|
Message
| I think I might have another answer for you. If you want your programs to pause, use mpsleep. I remember something being posted here on the forum a while back about mpsleep. In fact, I liked the idea so much I added it to my mud and it has worked perfectly. Try using the forum search for a thread on mpsleep. It even has the bug fix.
From waht I've heard and read (though I'm sure there could be more), mpsleep is used in SMAUG. However, my code is SWR and I use it also. I don't even think I had to adapt anything.
Good luck. |
~Nick Cash
http://www.nick-cash.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
17,602 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top