[MUD-Dev] Newbies

Malcolm Tester MTester at cambric.com
Fri Feb 25 15:17:40 New Zealand Daylight Time 2000


 [Michelle Thompson]
> A small example of data that might be in a small personality script
> Shy personality script
> Player                  Mob
> Action                  Reaction
> wink mob                blush
> taunt mob               cry
> slap mob                leave room
> pinch mob               say "Ow!"
> look at mob             hide
> [some cut]
>
> There are so many things that people react to.  There are so many things
that
> players do, especially to mobs when they are bored.  If you defined
> action/reaction on say even a fourth of them into a specific personality
> script (the list above is not even a fourth of what players can say or do
to
> mobs)  If you defined an action/reaction on every mob for say a fourth of
> them, even for only several hundred mobs, it would quickly take up more
space
> than it was worth.    If you make several general personilty types, they
could
> be assigned to mobs.  The mobs could have some of the comparitively small
> scripts like you described above as well.  Mobs generally do not react to
that
> much.  This is a possible way to have more mobs react more ways to
different things. 

---------------

Hello,
        I'm generally a "lurker" here....but I thought I'd respond to this.
I'm a diehard Amylaar/LDmud user, so I can't say a whole lot about other
code bases that use "mobs", which I assume is just another name for NPCs.
If you are familiar with LPC, and the majority of Amylaar/LD/3.2*/ based
muds out there, you know they use some version of a "soul" for the feelings
for players and NPCs.  Some do this via a /obj/soul.c object that is carried
around by each player or NPC.  Others do this via a daemon type system with
/bin/soul.c or whatnot.  Not that it matters, but I use the daemon type.
Now, as I said, I am not all that familiar with other code bases (except
MudOS...)  so I'm not so sure what you mean when you refer to attaching
scripts to progs.  An inheritable file perhaps?  At any rate, what I've done
in my development lib, (and maybe this will prove too intensive), is in the
soul.c daemon, whenever a player/NPC executes a feeling that requires an
"object" (i.e. 'kick bob', 'lick sandy'), if the object is an NPC, then the
daemon calls a function in the NPC with the name of the player/NPC doing the
action and the name of the action.  Then, in the NPC, the wizard can define
how to react to different actions, and if they have not defined anything,
then a default set is used.  I.e.:

mapping feelings = ([]);

void 
set_feelings(string action, string msg_to, string msg_room);

void
parse_feeling(string action, object whom) {
   ...
   if(member(feelings, action)) {
      ...
   }
   else {
      switch(action) {
         case "kick":
         case "punch":
         case "hit":
            ...
         case "kiss":
         case "hug":
         case "french":
            ...
         default:
            do_nothing
      }
   }
}

With this, the wizard can have an NPC respond to anything that is listed in
the soul as a feeling.  You can even take it further than just having a
message returned, by using #'closures and funcall().  Meaning you can have
the NPC hit back, and do damage, for example.  I'm not sure how this would
apply, or even if you could apply it to your libs, but it sets up global
defaults, and allows for customization, while giving the appearance of more
interaction between the Player and the NPC.

Regards,
Malcolm Tester II (aka Malc)





_______________________________________________
MUD-Dev maillist  -  MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list