13 Mar, 2010, jurdendurden wrote in the 1st comment:
Votes: 0
I could have sworn there was a snippet for this out there somewhere, anyone know where I can find it?
13 Mar, 2010, Runter wrote in the 2nd comment:
Votes: 0
If you wanted to do it yourself it shouldn't be hard if there's a function that is called when the tick happens.

In that case you'd simply add a command and call the function.
13 Mar, 2010, Sharmair wrote in the 3rd comment:
Votes: 0
Assuming that you mean an immortal command that will proactively force a
tick update so you don't have to wait for one. One easy way would be to
move the pulse_point variable from the update_handler function to global
scope (outside any function). I would just move the whole line up to just
outside the function keeping it static. Then add your command function
just after update_handler (end of update.c). All the command has to do is
set pulse_point to 1 (or less) and return. Then you just have to add the
declaration of the command function to interp.h and the command info to
the cmd_table in interp.c.
The advantage of doing it this way other then having your command call
the update functions directly, is that the timing is kept in sync with the
normal update cycle.
13 Mar, 2010, jurdendurden wrote in the 4th comment:
Votes: 0
@Runter:

Yes I was thinking of just doing it on my own since the function would be like… 3 lines long.. but ran into the problem of having to force the pulse_point variable somehow to decrement. However! Sharmair gave the exact solution one would need to do this, a static global variable. Thanks to both of you!
13 Mar, 2010, Runter wrote in the 5th comment:
Votes: 0
jurdendurden said:
@Runter:

Yes I was thinking of just doing it on my own since the function would be like… 3 lines long.. but ran into the problem of having to force the pulse_point variable somehow to decrement. However! Sharmair gave the exact solution one would need to do this, a static global variable. Thanks to both of you!


Eh, well, static will make its scope limited to the file it is in. If you want a command function from a different file to access it then this wouldn't be desirable.
16 Jul, 2010, Rarva.Riendf wrote in the 6th comment:
Votes: 0
Late to the party but here is my solution:

void update_handler(bool force) {
if (force)
pulse_point = 0;
//yadayada
}

void do_tickforce(CHAR_DATA *ch, char *argument) {
update_handler(TRUE);
}
16 Jul, 2010, Elervan wrote in the 7th comment:
Votes: 0
Odd how that snippet is gone I remember it being listed before as well. I know on a old mud I use to work on it used that snippet and the parts from it are as follow: (ROM mud)

act_wiz.c

Add this in local functions at the top:
extern void update_handler2( bool forced );


Then add this at the bottom of the file.
void do_force_tick(CHAR_DATA *ch, char *argument)
{
update_handler2(TRUE);
send_to_char("You have forced time to fly by….TICK\n\r",ch);
return;
}


and in update.c

Add this in local functions at the top of file.
void update_handler2( bool forced );


Then under the update_handler add:
void update_handler2( bool forced )
{
static int pulse_area;
static int pulse_mobile;
static int pulse_violence;
static int pulse_point;
static int pulse_music;

pulse_area = PULSE_AREA;
area_update ( );
pulse_music = PULSE_MUSIC;
song_update();
pulse_mobile = PULSE_MOBILE;
mobile_update ( );
pulse_violence = PULSE_VIOLENCE;
violence_update ( );
wiznet("TICK!",NULL,NULL,WIZ_TICKS,0,0);
pulse_point = PULSE_TICK;
weather_update ( );
char_update ( );
obj_update ( );
// bank_update ( );
aggr_update( );
tail_chain( );
return;
}


Then add the commands for use in interp.c/.h.

Not sure if that was the snippet you were thinking of?

PS I also found this site:
Salem's Snippet's
17 Jul, 2010, Scandum wrote in the 8th comment:
Votes: 0
My codebase has something like this:
void do_tick( CHAR_DATA *ch, char *argument)
{
int cnt, ticks;

ticks = atol(argument);

for (cnt = 0 ; cnt < ticks * PULSE_TICK ; cnt++)
{
update_handler();
}
ch_printf(ch, "Time advances %d mud %s.\n\r", ticks, short_to_name("hour", ticks));
}

So rather than messing with the update routines you call it 120 times, or however many are needed to do one tick.
17 Jul, 2010, quixadhal wrote in the 9th comment:
Votes: 0
OTOH, I've done my best to try and make ticks harder to predict in my game. Besides splitting more things out into seperate timers than usual, I also introduce a small amount of randomness into the tick timers. This not only makes them seem a bit more natural, but also defeats people who try to use timer macros to sleep right before the healing ticks and then wake up immediately afterwards.

From my perspective, it seems more useful to just provide commands to force a particular update routine, rather than mess with the tick timers to fudge it. If you want to call zone_update(), make an "update" command that takes the argument "zone" to do so.
17 Jul, 2010, KaVir wrote in the 10th comment:
Votes: 0
quixadhal said:
OTOH, I've done my best to try and make ticks harder to predict in my game. Besides splitting more things out into seperate timers than usual, I also introduce a small amount of randomness into the tick timers. This not only makes them seem a bit more natural, but also defeats people who try to use timer macros to sleep right before the healing ticks and then wake up immediately afterwards.

Why use healing ticks at all? Why not smooth it out, so that you heal gradually rather than in spurts?
17 Jul, 2010, Lyanic wrote in the 11th comment:
Votes: 0
KaVir said:
quixadhal said:
OTOH, I've done my best to try and make ticks harder to predict in my game. Besides splitting more things out into seperate timers than usual, I also introduce a small amount of randomness into the tick timers. This not only makes them seem a bit more natural, but also defeats people who try to use timer macros to sleep right before the healing ticks and then wake up immediately afterwards.

Why use healing ticks at all? Why not smooth it out, so that you heal gradually rather than in spurts?

Good man. You tell'em!
17 Jul, 2010, ralgith wrote in the 12th comment:
Votes: 0
Implementing gradual healing is on my TODO list as well…
17 Jul, 2010, Ssolvarain wrote in the 13th comment:
Votes: 0
KaVir said:
Why use healing ticks at all? Why not smooth it out, so that you heal gradually rather than in spurts?


This and abolishing the need for leveling gear. One day, all great muds will share these two common factors.

Edit: Plus it'd be nice to see more X over Time affects in muds. A useful regen spell?! Great Scott!

Back to your regularly programmed thread.
17 Jul, 2010, ralgith wrote in the 14th comment:
Votes: 0
Ssolvarain said:
This and abolishing the need for leveling gear. One day, all great muds will share these two common factors.


Explain that in detail please? I'm curious as to your opinions on that statement, and what you define as "leveling" gear?
17 Jul, 2010, KaVir wrote in the 15th comment:
Votes: 0
ralgith said:
Ssolvarain said:
This and abolishing the need for leveling gear. One day, all great muds will share these two common factors.


Explain that in detail please? I'm curious as to your opinions on that statement, and what you define as "leveling" gear?

In a typical Diku mud, leveling gear is a set of equipment with bonuses to wisdom and constitution, and penalties to hp, mana and move. You put it on just before you gain a level, therefore increasing the amount of hp, mana, move, practices and trains you receive for leveling.
17 Jul, 2010, ralgith wrote in the 16th comment:
Votes: 0
KaVir said:
ralgith said:
Ssolvarain said:
This and abolishing the need for leveling gear. One day, all great muds will share these two common factors.


Explain that in detail please? I'm curious as to your opinions on that statement, and what you define as "leveling" gear?

In a typical Diku mud, leveling gear is a set of equipment with bonuses to wisdom and constitution, and penalties to hp, mana and move. You put it on just before you gain a level, therefore increasing the amount of hp, mana, move, practices and trains you receive for leveling.


That's one definition of leveling gear ;)
My own definition is a little different. To me leveling gear is lower level gear (I have level restrictions on equipment) that has better stats than bonuses, but doesn't HAVE to be seriously negative.
17 Jul, 2010, Ssolvarain wrote in the 17th comment:
Votes: 0
KaVir was pretty much right.
17 Jul, 2010, ralgith wrote in the 18th comment:
Votes: 0
I've always hated that concept of leveling gear too.
17 Jul, 2010, quixadhal wrote in the 19th comment:
Votes: 0
KaVir said:
quixadhal said:
OTOH, I've done my best to try and make ticks harder to predict in my game. Besides splitting more things out into seperate timers than usual, I also introduce a small amount of randomness into the tick timers. This not only makes them seem a bit more natural, but also defeats people who try to use timer macros to sleep right before the healing ticks and then wake up immediately afterwards.

Why use healing ticks at all? Why not smooth it out, so that you heal gradually rather than in spurts?


Only because it would require a bit of a rework of the regen system (IE: hunger/thirst, poisons, etc). Back in the day, it didn't occur to me, and now I don't care enough to make that large a change in this old klunker. :)

Gradual healing is the way to go though. In fact, both HoT and DoT spells are much more fun, IMHO.
18 Jul, 2010, ralgith wrote in the 20th comment:
Votes: 0
DoT being Death over Time? Or something else?
0.0/53