Ge15t 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 48 
	Threads: 8 
	Joined: Feb 2011
	
 Reputation: 
0
		
	 | 
	
		
			
Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				void CollideRoomTwo(string &in asParent, string &in asChild, int alState) 
{ 
	SetSwingDoorClosed("mansion_1", true, true); 
	PlaySoundAtEntity("", "react_scare1.ogg", "Player", 0, false); 
} 
 
Ok so when I move through a locked door which I unlock with a key, it slams behind me, but does not play the sound file I have set above..  
 
void UsedKey1OnDoor(string &in asItem, string &in asEntity) 
{ 
	SetSwingDoorLocked("mansion_1", false, true); 
	PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false); 
	 
} 
 
However a sound effect + entity effect works here.. why not with the other one? 
 
I am getting no errors or anything from starting the custom story, the sound refuses to play. I even tried setting the sound to come from something else like a vase or the door itself, but still no dice.
			 
			
			
			
		 |  
	 
 | 
 
	| 05-05-2011, 08:22 AM  | 
	
		
	 | 
 
 
	
		
		cook 
 
 
		
			Member 
			
			
			
 
			
	Posts: 103 
	Threads: 6 
	Joined: Apr 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				PlayGuiSound("react_scare", 1.0f); 
 
It's a GUI sound, I'm assuming that's the problem, paste the command above.
			 
			
			
			
				
(This post was last modified: 05-05-2011, 08:26 AM by cook.)
 
				
			 
		 |  
	 
 | 
 
	| 05-05-2011, 08:25 AM  | 
	
		
	 | 
 
 
	
		
		ricky horror 
 
 
		
			Member 
			
			
			
 
			
	Posts: 54 
	Threads: 8 
	Joined: Apr 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				you're using .ogg for the one that doesn't work, and .snt for the one that does work 
PlaySoundAtEntity HAS to be .snt 
you can't use .ogg
			 
			
			
 
			
		 |  
	 
 | 
 
	| 05-05-2011, 08:39 AM  | 
	
		
	 | 
 
 
	
		
		Ge15t 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 48 
	Threads: 8 
	Joined: Feb 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				Nope neither of those suggestions seem to work either.. 
 
Also what does GUI stand for?
			 
			
			
			
				
(This post was last modified: 05-05-2011, 08:48 AM by Ge15t.)
 
				
			 
		 |  
	 
 | 
 
	| 05-05-2011, 08:45 AM  | 
	
		
	 | 
 
 
	
		
		jens 
 
 
		
			Frictional Games 
			
			
			
 
			
	Posts: 4,093 
	Threads: 199 
	Joined: Apr 2006
	
 Reputation: 
202
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				There must be a snt file for it to work, so if you simply tried react_scare1.snt that does not work, but I think there is a react_scare.snt which will randomly select one of the react_scareX.ogg to play.
			 
			
			
			
		 |  
	 
 | 
 
	| 05-05-2011, 08:48 AM  | 
	
		
	 | 
 
 
	
		
		Ge15t 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 48 
	Threads: 8 
	Joined: Feb 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				 (05-05-2011, 08:48 AM)jens Wrote:  There must be a snt file for it to work, so if you simply tried react_scare1.snt that does not work, but I think there is a react_scare.snt which will randomly select one of the react_scareX.ogg to play. 
Tried that and it still does not work..
 
void CollideRoomTwo(string &in asParent, string &in asChild, int alState) 
{ 
	SetSwingDoorClosed("mansion_1", true, true); 
	PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
	 
}
 
I have tried different variations of of the sound file name as well as the target entity (player).. do i need someone in the first quotations? i didnt for the other script line with the door?
			  
			
			
			
		 |  
	 
 | 
 
	| 05-05-2011, 08:56 AM  | 
	
		
	 | 
 
 
	
		
		cook 
 
 
		
			Member 
			
			
			
 
			
	Posts: 103 
	Threads: 6 
	Joined: Apr 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				void CollideRoomTwo(string &in asParent, string &in asChild, int alState) 
{ 
SetSwingDoorClosed("mansion_1", true, true); 
PlayGuiSound("react_scare", 1.0f); 
} 
 
This is what I do, works all the time, so no idea.
			 
			
			
			
				
(This post was last modified: 05-05-2011, 08:59 AM by cook.)
 
				
			 
		 |  
	 
 | 
 
	| 05-05-2011, 08:58 AM  | 
	
		
	 | 
 
 
	
		
		Ge15t 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 48 
	Threads: 8 
	Joined: Feb 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				 (05-05-2011, 08:58 AM)cook Wrote:  void CollideRoomTwo(string &in asParent, string &in asChild, int alState) 
{ 
SetSwingDoorClosed("mansion_1", true, true); 
PlayGuiSound("react_scare", 1.0f); 
} 
 
This is what I do, works all the time, so no idea. 
I copied/pasted that directly replacing my current one and doesnt work.
 
I even created a SECOND area that sits with the first area:
 //////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
	AddUseItemCallback("", "key1", "mansion_1", "UsedKey1OnDoor", true); 
	PlayMusic("04_amb.ogg", true, .5, 3, 0, true); 
	AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1); 
	AddEntityCollideCallback("Player", "RoomTwoArea2", "CollideRoomTwo2", true, 1); 
	 
} 
 
void CollideRoomTwo(string &in asParent, string &in asChild, int alState) 
{ 
 
SetSwingDoorClosed("mansion_1", true, true); 
PlayGuiSound("react_scare", 1.0f); 
 
} 
 
void CollideRoomTwo2(string &in asParent, string &in asChild, int alState) 
{ 
 
PlayGuiSound("react_scare", 1.0f); 
 
}
And yet it still doesnt work.. im at a complete loss here lol
			  
			
			
			
		 |  
	 
 | 
 
	| 05-05-2011, 09:04 AM  | 
	
		
	 | 
 
 
	
		
		genmills 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 47 
	Threads: 7 
	Joined: Mar 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				Hmm that seems really weird.  I would double check to make sure your sound files are still in their proper place and named correctly?  Just a thought since your code does look good.  Maybe I'm just not seeing it...
			 
			
			
			
		 |  
	 
 | 
 
	| 05-05-2011, 09:13 AM  | 
	
		
	 | 
 
 
	
		
		ricky horror 
 
 
		
			Member 
			
			
			
 
			
	Posts: 54 
	Threads: 8 
	Joined: Apr 2011
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed? 
			 
			
				void UsedKeyOnDoor2(string &in asItem, string &in asEntity) 
{ 
    SetSwingDoorLocked("StartDoor2", false, true); 
    PlaySoundAtEntity("", "unlock_door", "StartDoor2", 0, false);
 
this is actual scripting from the conversion i'm working on 
works fine for me
 
make sure that the third thing typed in (the one next to "unlock_door") is the actual name of the door
 
other than that, i have no idea why it's not working :/
 
edit:
 
try:
 void CollideRoomTwo(string &in asParent, string &in asChild, int alState) 
{ 
    SetSwingDoorClosed("mansion_1", true, true); 
    PlaySoundAtEntity("", "react_scare", "mansion_1", 0, false); 
}
  
			 
			
			
 
			
				
(This post was last modified: 05-05-2011, 09:25 AM by ricky horror.)
 
				
			 
		 |  
	 
 | 
 
	| 05-05-2011, 09:21 AM  | 
	
		
	 | 
 
 
	 
 |