its a limitation of the drawmethod clip, because the character will still show the full sprite, not the clipped one. Same for mirror.
It's not a limitation - it's what I (and you) remind people. Script does exactly what you tell it - nothing more or less. The shadow is another sprite with its own drawmethods - which logically it needs in order to work. It's really not all that sophisticated. The engine just gets your current sprite and color table pointer, then draws a copy, with predetermined drawmethods to invert it, skew it, and add an opaque tint (unless it's a reflection).
C:
shadowmethod = plainmethod;
shadowmethod.fillcolor = (shadowcolor > 0 ? shadowcolor : 0);
shadowmethod.alpha = shadowalpha;
shadowmethod.channelb = shadowmethod.channelg = shadowmethod.channelr = shadowopacity;
shadowmethod.table = drawmethod->table;
shadowmethod.scalex = drawmethod->scalex;
shadowmethod.scaley = light.y * drawmethod->scaley / 256;
shadowmethod.config = (shadowmethod.config & ~DRAWMETHOD_CONFIG_FLIP_X) | (drawmethod->config & DRAWMETHOD_CONFIG_FLIP_X);
shadowmethod.config = (shadowmethod.config & ~DRAWMETHOD_CONFIG_FLIP_Y) | (drawmethod->config & DRAWMETHOD_CONFIG_FLIP_Y);
shadowmethod.centery += alty;
if (shadowmethod.config & DRAWMETHOD_CONFIG_FLIP_Y)
{
shadowmethod.centery = -shadowmethod.centery;
}
if (shadowmethod.scaley < 0)
{
shadowmethod.scaley = -shadowmethod.scaley;
shadowmethod.config ^= DRAWMETHOD_CONFIG_FLIP_Y;
}
shadowmethod.rotate = drawmethod->rotate;
shadowmethod.shiftx = drawmethod->shiftx + light.x;
// f = current sprite pointer
spriteq_add_sprite(qx, qy, z, f, &shadowmethod, 0);
if (use_mirror)
{
shadowmethod.config ^= DRAWMETHOD_CONFIG_FLIP_Y;
shadowmethod.centery = -shadowmethod.centery;
spriteq_add_sprite(qx, sy, sz, f, &shadowmethod, 0);
}
Ideally, you could just modify the drawmethod used by native shadow, but there's no way to do that ATM. The shadow drawmethod structure is currently hardcoded directly into the draw routine (see above) and not part of any entity or model. So even if you could access it, any changes would affect every shadow on screen. But... All the tools the engine uses to make shadows - current sprite pointer, palette, light angle, and drawmethod to blit sprites, are all avaialble in both 3.0 and 4.0. So nothing at all stops you from doing your own shadow with clipping added or whatever else you need to handle those special cases.
It's one of those things that look super complex on the surface, but really isn't once you dig in.
Same goes for mirrors, which, unless I am mistaken, @Kratus developed a system for.
DC



