[CF-Devel] object movers

Andreas Vogl andi.vogl at gmx.net
Wed Apr 4 09:48:07 CDT 2001


>
     
      As to my code, I have several questions:
     
     >
     
     
     >
     
      What do I need to do to make sure it doesn't move things like other
     
     movers,
>
     
      the floor, directors, and such?  Should I have a list of object types that
     
     >
     
      are by default excluded?
     
     
Yes, this surely is neccessary. A mover that is screwing up maps would be
terrible. Keep in mind that movers are often placed below the floor.

Like Mark said, exclude objects with the following "flags" from movement:
FLAG_IS_FLOOR, FLAG_NO_PICK, invisible

Also exclude everything with "weight 0". This should prevent
moving spell effects/ connected stuff (triggers,detectors,gates etc)
and the likes. I hope none of them uses weight for internal calculations
or other forms of mess..?

>
     
      In using these, how much do I have to worry about CPU time?  If no object
     
     >
     
      rrives on the same square as the mover, will the mover still have to scan
     
     >
     
      through the objects on the square?
     
     
CPU time, say "performance", is an important issue. Try to make your
mover function as efficient as possible. E.g.: Loop through the items
on the mover's square only once. If possible, avoid checking every tick
- instead check only when an item was added. Exclude spell
effects (-> "weight 0") from all checks and loops at first.


In addition, I have a small feature request for the new movers:  =)
If movers have the connected value set, have them move objects only
by activation. This would allow some cool things. Like moving NPCs
"on command" for example: You speak a keyword to the guards - and
they step aside to let you pass.


Andreas V.


    
    


More information about the crossfire mailing list