Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
Entire forum
➜ PennMUSH
➜ Running the server
➜ Scheduled in-game events
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Inge Jones
(3 posts) Bio
|
Date
| Sat 26 Sep 2009 05:43 PM (UTC) |
Message
| Ok I gave up on lambdamoo it just wasn't optimal for the game I was trying to design. I think MUSH is going to have more support for the concepts.
My question is, can someone give me an overview to the usual approach to softcode a process that runs in the game constantly and updates property values on players at, say 15 min intervals?
I don't need the coding details, I can work out language and syntax from the manual, just an overview of the general approach needed. | Top |
|
Posted by
| Daniel P
USA (97 posts) Bio
|
Date
| Reply #1 on Fri 08 Apr 2011 05:23 PM (UTC) Amended on Fri 08 Apr 2011 05:25 PM (UTC) by Daniel P
|
Message
| I dislike an unresponded-to thread.
The best option would be probably the @wait <secs> = <do stuff> command. Expanded this would be something like:
&looper <object> = @wait [mul(<minutes>,60)] = {main script;@trigger me/looper}
However, with the latest build (1.8.4p3), you also have the option of triggering off of socket events such as @dump (via the dump`complete attribute).
Set the dump_interval in the mush.cnf file to 15 minutes, then after the database is saved, your event handler object would fire the proper script. HELP EVENTS spells this out. | Top |
|
Posted by
| Serenity
(18 posts) Bio
|
Date
| Reply #2 on Fri 08 Apr 2011 06:57 PM (UTC) |
Message
| most muds have a timer mechanism:
something like:
timer.add(my event, 100sec);
and this timer is checked every (ie) 100 ms if an event should be started.
In my Mud Engine I've coupled this to lua so you can do something like this in your script:
do something
sleep(15min)
do something
sleep(2sec)
do something
etc
The engine takes care of stuff like creatures dying in the meantime (for creature scripts) etc.. | 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.
15,481 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top