I’m actually having a really hard time figuring out how the music player interface is going to work. I know I want it to use a command structure similar to that used by the sound and animation behaviors, but how the command parameters are going to be structures is going to have to be very different indeed. Sound an animation behaviors are tied very much to one entity, whereas the music behavior needs to be aware of many entities, as well as the general state of the game.
So here’s what I’m thinking right now. The commands will take a tag, a status parameter, and something to compare that parameter against. As I mentioned yesterday I just came up with a behavior that can tag entities with different names depending on their role, so the tag checks all entities with that tag: It looks at the status of those entities, based on the provided parameter, and compares it against a value. Then it plays whichever music track is appropriate, transitions as necessary, etcetera. It’s still… pretty hazy. But it’s a start, I think. It may be enough of an idea that I can get started developing it for real tomorrow.