Re: Wait States

From: Alastair Neil (ajn@essex.ac.uk)
Date: 08/03/95


>>       Does anyone know how to use wait states so that when a player
>> casts a spell it waits a few pulses/ticks before the effect goes off?  I
>> seem only to be able to make the character wait AFTER the spell has been
>> completed.
>
>easy...  just put the WAIT_STATE at the BEGINNING of do_cast() or is it
>cast_spell.. whichever function the wait is at.  (although if you dont
>want a wait if the spell doesn't exist you may need to put it AFTER its
>worked out the spells exist, but BEFORE it actually casts it.
>
>it will be one of the above two functions,  (im not sure cause im not at
>home), but i lean towards do_cast.

WAIT_STATES are really only for blocking the pc's input - the mud carries on
regardless.
I think what Sean wants is a way to delay the effects of a spell without
delaying (unduely) the caster.  The way I did this was to impliment an
events queue for each beat. So now do_cast just adds and event to the queue
for a later beat and it is the event that casts the spell.  An arbitrary
timed events queue is a really good thing to add - you can do so many
interesting things with it.  I was thinking of adding another queue for
times longer than 1 mud hour and use it for scheduling gradual repops etc.

--
Ich habe Dinge gesehen, die ihr Menschen niemals glauben wuerdet. Gigantische
Schiffe, die brannten draussen vor der Schulter des Orion. Und ich habe
C-Beams  gesehen - glitzernd im Dunkeln nahe dem Tannhaeuser Tor. All diese
Momente werden verloren sein in der Zeit...so wie Traenen im Regen.
                                Zeit zu sterben... 



This archive was generated by hypermail 2b30 : 12/18/00 PST