Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collide callback problem.
rybray Offline
Junior Member

Posts: 31
Threads: 9
Joined: Aug 2011
Reputation: 1
#1
Collide callback problem.

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.
(This post was last modified: 09-03-2011, 12:17 AM by rybray.)
09-03-2011, 12:15 AM
Find




Users browsing this thread: 1 Guest(s)