Hi. Long time has passed from when I figured out a way to have shadows in custom made stages, for example imports or block-based stages.
I posted a shadow stage some time ago with the main models for you to place shadows in your stages. But I guess I never explained how they work.
Well, the shadow system consists of just an invisible model that casts shadows like most floors in official brawl stages. When these models are placed over floors without shadows, you get the shadow effect in your ground.
The standard model is just a surface centered in Y=0, that goes from -10 to 10 in the X and Z axes.
The model has 2 bones that can be used together to place the shadow in the right place. But I guess I won't explain this again. I'll just paste what I PM'd to CutterKirby64 when asked about my shadow system.
First of all, you must know that you can see the shadow models you're placing in brawlbox, but not until you enable them to be seen. If you've not done this yet, do it. Preview each MShadow model, and on the left, enable the TShadow1 texture. Now, you can see where the model will be placed.
With only this, you could place shadows accurately, but if you want to master the shadow system, you need more.
First of all, you need proper collisions. The collisions for your platforms are not perfect, they're near, but you've made them by just looking where they are. But you are the one who placed them, and you may know how big they are. With this info, you could make perfect collisions. Making perfect collisions is the same as knowing where the surface of the platform is, and this is needed to make a perfect shadow on it.
So, go to Platform01 and open the vertices folder. Inside, there are 2 elements. In any of them, you will see the Emin and Emax values. These mean which are the maxium dimensions of the model. In this case, your model goes from -10 to 10 in X, from 8 to 10 in Y, and from -20 to 20 in Z.
Now, you've animated that platform to place it somewhere. If you didn't move it, the perfect collision for the surface would be from -10,10 to 10,10. 10 is the higher value in vertical, so that's where the surface is. But you moved it, so you need to make a moved collision too. Unless you attach the collision as a separate collision object, if you were to do this, the collision would follow the model and would be always on it, whereever it is. This would be the needed thing if the platform was animated and you wanted a moving collision.
But this isn't the case, and your option was drawing the collision where the platform is. Platform01 is the right one, and the collisions you made went from (60.23403, 29.81254) to (102.4309, 29.81257). In your animation, the model has been moved and scaled. Doubled in X and Y. So, if we only thing that it's scaled, now the collision would be from -20,20 to 20,20. Now, let's apply the move. X=80. So let's add 80 to the X values. Now the collision would be from 60,20 to 100,20. Now, let's add that Y=10. The collision would be 60,30 to 100,30.
Your collision: (60.23403, 29.81254) to (102.4309, 29.81257)
The exact one: (60, 30) to (100, 30)
As you can see, you were near to the exact, but you weren't using the proper collisions. If you're using squared blocks, you should never fail with this from now on.
Well, now lets go with shadows. The shadow models go from -10 to 10 in X, they're in Y=0 and go from -10 to 10 in Z. Also, it has 2 bones.
With the lower bone, we can change the properties of the shadow model. Let's change them, for example, to the ones in the surface of your platform. Viewing the max values, is easy to see that the surface is a square that goes from -10 to 10 in X, it's in Y=10 and goes from -20 to 20 in Z. If we move the MShadow model to Y=10.1, and double the size of Z, the shadow will fit the surface (well, it's 0.1 higher because if it was exactly where the surface is, there would be some flashing between shadow and surface).
Now, if we control the modified shadow in the same way we controled the platform, any change made to the platform will be automatically applied to the shadow. So, if we make:
NShadow-> Y=10.1, Z(size)=2
MShadow1-> X=80, Y=10, X(size)=2 and Y(size)=2
Then the shadow will be exactly on the platform.
Also, we can include the contributions of both bones, and an equivalent single bone would be like this:
X=80, Y=30.2, X(size)=2, Y(size)=2, Z(size)=2
And this, in terms of where the shadow is exactly, means that the shadow goes from 60 to 100 in X, it's in Y=30.2, and goes from -20 to 20 in Z. So, it's 0.2 higher to the surface, near enough to have a nice shadow effect without strange flashes.
Read all this more than once if you need it, and try to follow these steps in your original file. You can use the one I've sent you to compare.
The example in this quote should be good enough to help you understand things about shadow placements and even collisions in block-based stages.
Any question, just ask.