[DGD] Shadows issue
Noah Gibbs
noah_gibbs at yahoo.com
Fri Jul 17 17:12:14 CEST 2009
--- On Fri, 7/17/09, Kamil N <kamiln at gmail.com> wrote:
> shadows had lots drawbacks (determining which
> object is going
> to be the final one masking when more than one shadows is
> applied and
> they all mask the same function, security issues etc), but
> in some
> cases they were really useful.
Makes sense. You'd need a defined order for shadows, and to figure it out explicitly, if you were going to use multiple. It's actually the same kind of problem that inherited functions have -- and solve in different ways in different languages.
> Other than that maybe just coding mudlib so it can deal
> with any kind
> of situation, so if player sits it adds proper
> descriptions, if hes
> mounted, it adds proper leave/arrive messages etc. But all
> this
> requires basically everything to be designed at the start,
> and shadows
> allowed to create things that noone ever thought about when
> creating
> base mudlib, but they were still possible to achieve
> through
> shadowing.
Part of the problem is that you won't be able to achieve everything shadows do without getting some of their problems. A lot of the reason for the security problems is that shadows can do things people don't expect or think about, and which are often a bad idea. If you had a well-defined set of properties and descriptions that they could override then yes, you lose some power. But it's power you really shouldn't be putting into your builders' hands without a *very* good reason.
> Also, any way to do this "body" exchange I described? Maybe
> instead of
> just inheriting it, storing it in some "object body", and
> changing
> object associated with it when its needed? But then I'll
> need to call
> all the functions on body instead of actual player object,
> or find a
> way to somehow delegate them to the body?
Yes. This has the added advantage that if you write more of your functions this way, you can use them on NPCs with less modification, too. Since the NPCs and players both have body objects, code knows how to deal with either one unless you make it specific somehow. At least, that's my preferred way to do it.
Saving the original body can be hard, as previous posters pointed out. But not ridiculously hard, just "you have to make an effort" hard :-)
More information about the DGD
mailing list