Hmm that's nice to solve my first problem :)
But it won't provide "height affected" shadows, which was my underlying goal actually. For example, if A is taller than B, B should not project shadows on A. Here, walls should project shadows on objects and characters, but characters should not project shadows on walls. And as a result, no self-shadowing, because the top would be "higher" than the sides of the object and won't receive its own shadow. That would be an interesting feature^^
I'm not working on this anymore at the moment, but if I have to I'll probably get back some info here :)