The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
Collide callback problem. - by rybray - 09-03-2011, 12:15 AM



Users browsing this thread: 1 Guest(s)