Saitoshiba 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 7 
	Threads: 2 
	Joined: Dec 2012
	
 Reputation: 
0
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		Tomato Cat 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 287 
	Threads: 2 
	Joined: Sep 2012
	
 Reputation: 
20
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		Saitoshiba 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 7 
	Threads: 2 
	Joined: Dec 2012
	
 Reputation: 
0
		
	 | 
	
		
			
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  | 
	
		
	 | 
 
 
	
		
		The chaser 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 2,486 
	Threads: 76 
	Joined: Jun 2012
	
 Reputation: 
113
		
	 | 
	
		
			
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) 
 
Aculy iz dolan.  
			
		 |  
	 
 | 
 
	| 12-12-2012, 05:03 PM  | 
	
		
	 | 
 
 
	 
 |