Relatively new to coding for smaug, was wondering two things. One I was wanting to display the layer value on objects specifically armor when you analyze it, and two, is there any way to code in a timer that sends a global message or forces the player to perform certain actions. IE reading a hfile or something along those lines.
Global messages on timer
Posted by Solo on Sat 21 Mar 2009 12:34 AM — 8 posts, 31,158 views.
Ok I figured out the layer thing by myself. Felt kinda dumb afterward. But still having trouble with the timer function. Any help or a pointer in the right direction would be appreciated.
Do you want to echo this stuff at same intervals?
Yes, was looking to do it roughly every 30 to 45 minutes.
During the update tick function in update.c, you could do an ifcheck on the current real time and then perform whatever is needed. I think the function is char_update?
Ok I went into update.c and added an if check, under char_update. But its not doing what its supposed to do.
if ( (current_time % 1800) == 0 )
{
do_help( ch, "voteinfo" );
}
Now, if I'm not mistaken, this should, every 30 minutes, every character should have the voteinfo hfile displayed. I am I missing something?
if ( (current_time % 1800) == 0 )
{
do_help( ch, "voteinfo" );
}
Now, if I'm not mistaken, this should, every 30 minutes, every character should have the voteinfo hfile displayed. I am I missing something?
Try it in the char_check function. That one is called more frequently.
You should probably add in a config option to turn that off as I would never play a game that spams me to vote every 30 minutes. That's just a personal preference though.
To me, that's just poor taste and makes the mud look bad. Again, just my personal opinion.
To me, that's just poor taste and makes the mud look bad. Again, just my personal opinion.