I have searched and experimented high and low, but this script got the better of me. I have an epoxy container (entity:"ready") and I want to throw a rock at it to make a nice explosion to clear some debris. The only problem is the collision callback. I have 3 rocks to use, and I added a collision callback to the container for each of them, but the game still won't run the callback. All that happens is the container fizzles silently and disappears. Any help is appreciated.
void interactDoor(string &in asEntity)
{
SetPropHealth("scareDoor", 10.0f);
CreateParticleSystemAtEntity("ps1", "ps_break_wood.ps", "areaDoorDust", true);
GiveSanityDamage(15.0f, true);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
PlayMusic("amb_extra02.ogg", true, 0.3f, 1, 1, true);
AddEntityCollideCallback("ready", "rock1", "collideBoom", true, 1);
AddEntityCollideCallback("ready", "rock2", "collideBoom", true, 1);
AddEntityCollideCallback("ready", "rock3", "collideBoom", true, 1);
}
void collideBoom(string &in asParent, string &in asChild, int alState)
{
AddTimer("sound", 1, "timerBoom");
AddTimer("1", 4, "timerBoom");
}
void timerBoom(string &in asTimer)
{
if(asTimer == "sound"){
PlaySoundAtEntity("", "12_epoxy_blow", "caveIn", 0, false);
StartScreenShake(0.01, 0, 0, 2.9f);
return;
}
SetPropHealth("caveIn", 0);
StartScreenShake(0.08, 2.5f, 0, 1.0f);
FadeImageTrailTo(0.5, 1);
}