I want to make sure the system can handle complicated interactions. Here is an example where a bullet shoots an enemy. I added an imaginary extra "sender" parameter to make it easier:
Bullet/player script:
enemy:SendMessage("hurt",0,"-5")
Enemy script:
function ReceiveMessage( message, extra, sender )
if message="hurt"
self.health=self.health-tonumber(extra)
if self.health<=0 then
self:Kill()
sender:SendMessage("addscore")--Add to the killer's fragcount
else
self.model:EmitSound(sound_ouch)
end
end
end
What other scenarios can you think of that might be difficult? As far as I can tell, this system can handle everything, but I want to make sure.