[MUD-Dev] Object Models

KevinL darius at bofh.net.au
Tue Nov 21 11:32:42 CET 2000


>>> John Robert Arras wrote
> 
> Ben wrote:
> 
> > For example I have an object that is both a key and a monster.
> 
> I started out coding on a Diku, and found there were a few big

[snip]

> So, the "key/monster" thing I would set up by making a monster, then
> make it so you can pick up the monster, then make it so you can
> wield/hold the monster, then add a "key" chunk of data, and then add some
> information to that chunk (some flag) that says "if this key is used in
> the wrong door, attack the user". I would then add a small
> piece of code to the "unlock" function which says if the key can fight
> and if this flag is set, and the door is wrong, the key leaps from your
> hand and attacks you.
> 
> 
> At any rate, this method is really really simple. Stuff just
> falls into place and works without me putting in much effort.

Whereas, I'd create an object, and tell it to inherit from key and from 
monster, and optionally setup the behaviour of the critter in question (to 
attack if used in the wrong door) off the 'unlock' method provided by the key.

And in the component world,. you'd create the object, grab the key and monster 
components, and weave them together so the object looks like both.

The Diku approach was a good start, but it doesn't scale well to allowing 
players/builders to online create anything they want - too often you have to 
go back to the underlying C code to change the structure of the engine, just 
to add a new type of behaviour.  That's annoying for me at least ;)

KL

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list