I use a factory which uses a prototype to create different sprites from the atlas it references - done by sending the generated sprite the play_animation message to tell it which sprite to use. I also record the type of sprite by sending the generated sprite a custom message with the sprite_type as payload.
The Lua script used by the prototype does something along the lines of
if (message_id == hash("sprite_type")) then self.spriteType = message.payload end
Now imagine this - the sprites are bumping around in their gameworld and, from time-to-time, they collide. When I trap the collision_response message I know, amongst other things the auto-generated id of the other sprite. But what if I now want to establish the sprite_type of the other sprite prior to deciding how to react.
In other words, how do I find collidedSprite.spriteType?