Re: [Newbie][Question] RL_SEC and pulses

From: Welcor (welcor@dune.net)
Date: 09/12/01


----- Original Message -----
From: "Dust" <dustlos@HOTMAIL.COM>
> I've made combat a wee bit less linear by using a modified event
> handler (event.c, etc). So right now, all the damage isn't done every
> 2 seconds, however, combat still runs at 2 seconds between pulses, I'm
> aiming for 1/2 a second by am hit by my limited C knowledge in dealing
> with a couple things..
>
> #define OPT_USEC        100000  /* 10 passes per second */
> #define PASSES_PER_SEC  (1000000 / OPT_USEC)
> #define RL_SEC          * PASSES_PER_SEC
>
> What exactly does  --> * PASSES_PER_SEC <--   do?

It's just a macro, making it easier (:P) to understand how often things happen.
A macro simply substitutes into the code:

10 RL_SEC = 10 * PASSES_PER_SEC = 10 * (1000000 / 100000) = 100 (passes)

Thus, PULSE_ZONE equals 100 passes of the code.

The OPT_USEC pertains to how long the code will 'sleep' for each pass amd thus,
how fast things will seem to happen to the players. As it is, a command is
processed each 1/10th of a second.


> And how can I make a
> pulse for 1/2 a second, I get invalid unary * or other errors when
> trying to make 0.5 second pulses.

#define PASSES_PER_HALF_SECOND  (500000 / OPT_USEC)

(it's not coding, it's math...)

> Thanks for any advice.

NP

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST