Frictional Games Forum (read-only)

Full Version: Collide callback problem.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code is for when a sledge hammer collides with the window, the window with glass disappears and is replaced by a window with no glass. The glassed window disappears, but the spawn particle system and play sound at entity function are not working. What did I do wrong?


void OnStart ()
{
AddEntityCollideCallback("breakglass", "sledge_1", "glassbreak", false, 1);
}

void breakglass(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("mb_window_1", false);
CreateParticleSystemAtEntityExt("", "ps_dust_push_09.ps", "mb_window_noglass_1", false, 1, 0, 0, 0, true, 1, 2, 30, 40);
PlaySoundAtEntity("", "break_glass_large.snt", "mb_window_noglass_1", 2, false);
}


void OnEnter ()
{

}

void OnLeave ()
{

}
(09-03-2011, 12:15 AM)rybray Wrote: [ -> ]Code is for when a sledge hammer collides with the window, the window with glass disappears and is replaced by a window with no glass. The glassed window disappears, but the spawn particle system and play sound at entity function are not working. What did I do wrong?


void OnStart ()
{
AddEntityCollideCallback("breakglass", "sledge_1", "glassbreak", false, 1);
}

void breakglass(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("mb_window_1", false);
CreateParticleSystemAtEntityExt("", "ps_dust_push_09.ps", "mb_window_noglass_1", false, 1, 0, 0, 0, true, 1, 2, 30, 40);
PlaySoundAtEntity("", "break_glass_large.snt", "mb_window_noglass_1", 2, false);
}


void OnEnter ()
{

}

void OnLeave ()
{

}

Nevermind.