[CF-Devel] speed_left?

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Mon Oct 18 01:26:48 CDT 2004


Todd Mitchell wrote:
>
     
      what is speed_left and should it be listed monster map entries?
     
     >
     
      the description says: 
     
     >
     
     
     >
     
      speed     <no>          speed of O.  A negative number means that
     
     >
     
      speed_left
     
     >
     
                              will be randomized when the object is loaded.
     
     >
     
      speed_left <no>         speed of O remaining, internal.
     
     >
     
     
     >
     
      which I still don't understand.
     
     
  tchize was fundamentally correct.

  The only thing that really wasn't right in what he said is that the objects 
speed_left is increased by the absolute value of the speed value, and when the 
object takes an action, its speed_left is reduced by one - the object takes an 
action when speed gets to 0 or 1 - I forget which.

  negative speed means the objects speed_left is randomized at time of load - 
this is useful so that all monsters are not in lockstep.  IT isn't universally 
desirable - think of a set of moving spikes - you probably do want those to move 
in a syncrhonous fashion.

  speed_left needs to be saved out so that objects don't lose actions - think of 
a slow speed generator - you don't want it to reset to having to wait a long 
time if it happened to get saved out just a little before it was supposed to go.

  This works really based on ordering of fields in the map.  When an object is 
loaded, when it gets the speed value, if negative, it randomizes speed_left 
right then.  When maps are saved out, speed_left is saved after the speed value, 
so that randomized value will then get overwritten when it gets to the 
speed_left line.

The other usage of speed left is for paralyzation attacks - basically, when that 
happens, the monsters/players speed_left is just set to a fairly large negative 
value, so that it will be many ticks before the creatures speed will be 
positive, and thus it gets an action.

  such a tactic could be used by map designers to delay when an object starts 
doing actions (hibernate a monster for a while).  Another example could perhaps 
be a race type thing - need to get to the end of the map within some time period 
- could perhaps use a gate or somethign that doesn't start moving until say 50 
ticks after the map loads - thus, giving the player those 50 ticks to get through.




_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list