Frictional Games Forum (read-only)
Collide callback problem. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Collide callback problem. (/thread-10122.html)



Collide callback problem. - rybray - 09-03-2011

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.