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
Script Help Sound not activating upon collision
Saitoshiba Offline
Junior Member

Posts: 7
Threads: 2
Joined: Dec 2012
Reputation: 0
#1
Sound not activating upon collision

My script file looks fine, but when the player enters on the scrip area the effect of losing sanity happens( usually don't) but the sound doesn't play. The other room that has the exact same thing plays the sound perfectly.


void OnStart()
{

AddEntityCollideCallback("Player","ScriptArea_8","Torture1",true,0);
AddEntityCollideCallback("Player","ScriptArea_10","Torture2",true,0);
}


void OnEnter()
{

}

void OnLeave()
{
}

// The collision that it is working perfectly

void Torture1(string &in parent, string &in child, int state)
{
GiveSanityDamage(0,true);
PlaySoundAtEntity("Burn1","24_burn.snt","Player",0,false);
}

void Torture2(string &in parent, string &in child, int state)
{
GiveSanityDamage(0,true);
PlaySoundAtEntity("Saw","23_saw2.snt","Player",0,false);
PlaySoundAtEntity("SawVoice","23_saw_voice2.snt","Player",0,false);
}

Can somebody help me?
12-11-2012, 09:54 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: Sound not activating upon collision

I'm pretty sure the arguments (or maybe they're called "parameters") for your Torture 1 & 2 functions is supposed to be asChild, asParent, and alState, rather than child, parent, and state.

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
(This post was last modified: 12-11-2012, 10:14 PM by Tomato Cat.)
12-11-2012, 10:06 PM
Find
Saitoshiba Offline
Junior Member

Posts: 7
Threads: 2
Joined: Dec 2012
Reputation: 0
#3
RE: Sound not activating upon collision

Doesn't change much. Still not playing the sound in the place, but in another place that there isn't any script area. Weird.
12-12-2012, 04:47 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Sound not activating upon collision

(12-11-2012, 09:54 PM)Saitoshiba Wrote: My script file looks fine, but when the player enters on the scrip area the effect of losing sanity happens( usually don't) but the sound doesn't play. The other room that has the exact same thing plays the sound perfectly.


void OnStart()
{

AddEntityCollideCallback("Player","ScriptArea_8","Torture1",true, 0);
AddEntityCollideCallback("Player","ScriptArea_10","Torture2",true, 0);
}


void OnEnter()
{

}

void OnLeave()
{
}

// The collision that it is working perfectly

void Torture1(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(0,true);
PlaySoundAtEntity("Burn1","24_burn.snt","Player",0,false);
}

void Torture2(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(0,true);
PlaySoundAtEntity("Saw","23_saw2.snt","Player",0,false);
PlaySoundAtEntity("SawVoice","23_saw_voice2.snt","Player",0,false);
}

Can somebody help me?
Try this script.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-12-2012, 05:03 PM
Find




Users browsing this thread: 1 Guest(s)