[CF-Devel] object movers

Mark Wedel mwedel at scruz.net
Sat Apr 7 19:33:02 CDT 2001


Preston Crow wrote:

>
     
     
     >
     
      Is there really any fundamental difference between a mover and a teleporter?
     
     
 Yes - a mover can only move the object to an adjacent space, while a teleporter
can move the object to any space, and potentially to another map I believe.

>
     
     
     >
     
      I could probably make a good argument for a teleporter with all the same
     
     >
     
      options for selecting what gets teleported.  Is there really any reason to
     
     >
     
      have a separate object?
     
     
 As you said, it is rather subjective.

 However, I find it preferable to look at a map someone else did, look at the
archetype, and know 'hey - thats a mover - it moves the player one space'.

 A simple solution here would be to have a function like
'find_mover_object_match' or the like, which takes a teleporter/mover/exit (and
potentially more, like checkers), and uses the information in the object we are
matching against to see if a matching object on the space exists, and if so,
return that object.

 Note that many objects have very similiar code (food vs flesh).  But they can
still be seperate.

 The problem with a 'super mover' is basically you probably need a flag in the
object which says what it does, ie, does it shift the object based onthe
direction, or teleport them to another space?  You could have defaults (if the
destination for teleporter type stuff is zero, then move, etc), but that gets
messy.

 And if you need a flag or the like within the object to say what to do, why not
just use the object type as the flag effectively?  Just because the object types
differ does not mean all the code has to be replicated - good use of functions
and if statements can deal with that.

    
    


More information about the crossfire mailing list