| 
		
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| what the script Doorslam but reverse 
 
				hello i wounder if some one know the script for Door slam but the door slams up instead how do i script that if that even work any tip i can only find the normal door slam 
void OnEnter(){
 AddEntityCollideCallback("Player", "doorslam_1_area", "func_slam", true, 1);
 }
 
 void func_slam(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorClosed("mansion_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);
 SetPlayerActive(false);
 StartPlayerLookAt("mansion_1", 3.0f, 5.0f, "");
 AddTimer("timerReleasePlayer", 1.5f, "timerReleasePlayer");
 }
 
 void timerReleasePlayer(string &in asTimer) {
 SetPlayerActive(true);
 StopPlayerLookAt();
 
 
 |  |  
	| 12-27-2011, 03:08 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: what the script Doorslam but reverse 
 
				 (12-27-2011, 03:08 PM)jessehmusic Wrote:  hello i wounder if some one know the script for Door slam but the door slams up instead how do i script that if that even work any tip i can only find the normal door slam 
 void OnEnter(){
 AddEntityCollideCallback("Player", "doorslam_1_area", "func_slam", true, 1);
 }
 
 void func_slam(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorClosed("mansion_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);
 SetPlayerActive(false);
 StartPlayerLookAt("mansion_1", 3.0f, 5.0f, "");
 AddTimer("timerReleasePlayer", 1.5f, "timerReleasePlayer");
 }
 
 void timerReleasePlayer(string &in asTimer) {
 SetPlayerActive(true);
 StopPlayerLookAt();
 
 Do you mean slam the door shut? Or slam the door up? Sorry, I'm confused as to what you need help with?
			 
 |  |  
	| 12-27-2011, 03:14 PM |  |  
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| RE: what the script Doorslam but reverse 
 
				A doorlsam up the doors it closed when they enter area the doors slams up
			 
 |  |  
	| 12-27-2011, 03:19 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: what the script Doorslam but reverse 
 
				 (12-27-2011, 03:19 PM)jessehmusic Wrote:  A doorlsam up the doors it closed when they enter area the doors slams up SetSwingDoorClosed("nameofdoor", true, true);
 
If that doesn't work:
 
AddPropImpulse("nameofdoor", float afX, float afY, float afZ, "world");
 
With the propimpulse one, go into the level editor and check weather it would be a negative value or a positive value for the door closing.
			 
 |  |  
	| 12-27-2011, 03:26 PM |  |  
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| RE: what the script Doorslam but reverse 
 
				what i gonna put in this script  AddPropImpulse("nameofdoor", float afX, float afY, float afZ, "world"); 
Im new on this :S
 
 
When i took the first you gave it still closed the doors :S
			
 
				
(This post was last modified: 12-27-2011, 03:30 PM by jessehmusic.)
 |  |  
	| 12-27-2011, 03:29 PM |  |  
	
		| flamez3   Posting Freak
 
 Posts: 1,281
 Threads: 48
 Joined: Apr 2011
 Reputation: 
57
 | 
			| RE: what the script Doorslam but reverse 
 
				 (12-27-2011, 03:29 PM)jessehmusic Wrote:  what i gonna put in this script AddPropImpulse("nameofdoor", float afX, float afY, float afZ, "world"); 
Im new on this :S
 A float is a number basically. Put maybe 5 in the float afX part. Then put 0 in all the others. If it goes the other direction add a - behind the 5.
 
AddPropImpulse("nameofdoor", 5, 0, 0, "world"); 
 
But it really depends on the layout of your map.
			 
 
				
(This post was last modified: 12-27-2011, 03:33 PM by flamez3.)
 |  |  
	| 12-27-2011, 03:32 PM |  |  
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| RE: what the script Doorslam but reverse 
 
				it stills close the door :S 
 
This is how it looks  void OnEnter() {
 AddEntityCollideCallback("Player", "doorslam_1_area", "func_slam", true, 1);
 }
 
 void func_slam(string &in asParent, string &in asChild, int alState)
 {
 AddPropImpulse("doorslam_1", 5, 0, 0, "world");
 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);
 SetPlayerActive(false);
 StartPlayerLookAt("doorlsam_1", 3.0f, 5.0f, "");
 AddTimer("timerReleasePlayer", 1.5f, "timerReleasePlayer");
 }
 
 void timerReleasePlayer(string &in asTimer) {
 SetPlayerActive(true);
 StopPlayerLookAt();
 }
 
 
				
(This post was last modified: 12-27-2011, 03:42 PM by jessehmusic.)
 |  |  
	| 12-27-2011, 03:39 PM |  |  
	
		| Linus Ågren   Senior Member
 
 Posts: 309
 Threads: 58
 Joined: Jan 2011
 Reputation: 
5
 | 
			| RE: what the script Doorslam but reverse 
 
				Okay, first of all, you want to make the door "open" like someone pressed the handle down. 
Use this code:
 SetSwingDoorClosed("doorname", false, true); 
(Replace doorname with your own doors name.
 
Secondly, you want to make sure that the door does not close by itself instantly after the "handle is pulled". I think it like someone is holding the handle down. Use this code for that:
 SetSwingDoorDisableAutoClose("doorname", true); 
Now you want to push the door open, but in order not to push it in the wrong direction, check in the level editor which axis you're supposed to use, and also if it's a negative or a positive value. (It's probably the X or Z axis unless the door is on the ceiling or floor)
 
Now apply the actual force to open the door:
 AddPropImpulse("doorname", float afX, float afY, float afZ, ""); 
Replace the "float afX/Y/Z" with the amount of force you'd like, and make sure it's the correct axis.
			
 Creator of The Dark Treasure. |  |  
	| 12-27-2011, 03:53 PM |  |  
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| RE: what the script Doorslam but reverse 
 
				is the axis the pos on the door 
			 
 |  |  
	| 12-27-2011, 04:12 PM |  |  
	
		| Linus Ågren   Senior Member
 
 Posts: 309
 Threads: 58
 Joined: Jan 2011
 Reputation: 
5
 | 
			| RE: what the script Doorslam but reverse 
 
				http://img31.imageshack.us/img31/7067/71691297.jpg
The arrows coming from the object are what you're looking for. For example, my door opens outwards, which means if I would had wanted a force to open that door, I would need to change the Z axis (Blue Arrow). And since the arrow's head is outwards, that means I need to apply a positive value.
			 
 Creator of The Dark Treasure. |  |  
	| 12-27-2011, 04:18 PM |  |  |