| 
		
	
		| GoreGrinder99   Member
 
 Posts: 166
 Threads: 47
 Joined: Feb 2013
 Reputation: 
1
 | 
			| Slam Door script help. 
 
				I'm trying to set up a slam door script. This is what I have - 
 void OnStart()
 {
 AddEntityCollideCallback("Player", "slam_attic_1", "attic_slam_1", true, 1);
 }
 void slam_attic_1(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorClosed("attic_slam_1", true, true);
 PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
 PlaySoundAtEntity("", "react_scare", "Player", 0, false);
 PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
 GiveSanityDamage(5.0f, true);
 }
 
 slam_attic_1 is the script name and attic_slam_1 is the door name.
 
 -Grind to the Gore- 
				
(This post was last modified: 08-17-2013, 11:36 PM by GoreGrinder99.)
 |  |  
	| 07-19-2013, 10:23 PM |  |  
	
		| DeAngelo   Senior Member
 
 Posts: 263
 Threads: 26
 Joined: Feb 2013
 Reputation: 
11
 | 
			| RE: Slam Door script help. 
 
				In the initial callback you have the script area as "slam_attic_1" and the callback itself as "attic_slam_1"
 In the second part you have the function as slam_attic_1, but that's your script area, your callback belongs there.
 
 |  |  
	| 07-20-2013, 12:13 AM |  |  
	
		| GoreGrinder99   Member
 
 Posts: 166
 Threads: 47
 Joined: Feb 2013
 Reputation: 
1
 | 
			| RE: Slam Door script help. 
 
				 (07-20-2013, 12:13 AM)DeAngelo Wrote:  In the initial callback you have the script area as "slam_attic_1" and the callback itself as "attic_slam_1"
 In the second part you have the function as slam_attic_1, but that's your script area, your callback belongs there.
 
So, how should that look? lol Kinda raw with these scripts.
			 
 -Grind to the Gore- |  |  
	| 07-20-2013, 12:32 AM |  |  
	
		| PutraenusAlivius   Posting Freak
 
 Posts: 4,713
 Threads: 75
 Joined: Dec 2012
 Reputation: 
119
 | 
			| RE: Slam Door script help. 
 
				void OnStart(){
 AddEntityCollideCallback("Player", "slam_attic_1", "Attic_Slam", true, 1);
 }
 void Attic_Slam(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorClosed("attic_slam_1", true, true);
 PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
 PlaySoundAtEntity("", "react_scare", "Player", 0, false);
 PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
 GiveSanityDamage(5.0f, true);
 }
The last string parameter and the parameter after the return_type (in this case void) is the function, not the door/script name.
			 
 "Veni, vidi, vici.""I came, I saw, I conquered."
 |  |  
	| 07-20-2013, 12:39 AM |  |  
	
		| GoreGrinder99   Member
 
 Posts: 166
 Threads: 47
 Joined: Feb 2013
 Reputation: 
1
 | 
			| RE: Slam Door script help. 
 
				 (07-20-2013, 12:39 AM)JustAnotherPlayer Wrote:  void OnStart(){
 AddEntityCollideCallback("Player", "slam_attic_1", "Attic_Slam", true, 1);
 }
 void Attic_Slam(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorClosed("attic_slam_1", true, true);
 PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
 PlaySoundAtEntity("", "react_scare", "Player", 0, false);
 PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
 GiveSanityDamage(5.0f, true);
 }
The last string parameter and the parameter after the return_type (in this case void) is the function, not the door/script name.
 
Thank you!
			 
 -Grind to the Gore- |  |  
	| 07-20-2013, 12:54 AM |  |  |