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
what the script Doorslam but reverse
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#1
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
PHP Code: (Select All)
void OnEnter()
{
    
AddEntityCollideCallback("Player""doorslam_1_area""func_slam"true1);

 
void func_slam(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("mansion_1"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
    
PlaySoundAtEntity("""react_scare""Player"0false);  PlaySoundAtEntity("""close_door.snt""Player"0false); 
    
GiveSanityDamage(5.0ftrue);
    
SetPlayerActive(false);
    
StartPlayerLookAt("mansion_1"3.0f5.0f"");
    
AddTimer("timerReleasePlayer"1.5f"timerReleasePlayer");
}

void timerReleasePlayer(string &in asTimer) {
    
SetPlayerActive(true);
    
StopPlayerLookAt(); 


http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
12-27-2011, 03:08 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
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
PHP Code: (Select All)
void OnEnter()
{
    
AddEntityCollideCallback("Player""doorslam_1_area""func_slam"true1);

 
void func_slam(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("mansion_1"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
    
PlaySoundAtEntity("""react_scare""Player"0false);  PlaySoundAtEntity("""close_door.snt""Player"0false); 
    
GiveSanityDamage(5.0ftrue);
    
SetPlayerActive(false);
    
StartPlayerLookAt("mansion_1"3.0f5.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
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#3
RE: what the script Doorslam but reverse

A doorlsam up the doors it closed when they enter area the doors slams up

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
12-27-2011, 03:19 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
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
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#5
RE: what the script Doorslam but reverse

what i gonna put in this script
PHP Code: (Select All)
AddPropImpulse("nameofdoor"float afXfloat afYfloat afZ"world"); 

Im new on this :S

When i took the first you gave it still closed the doors :S

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 12-27-2011, 03:30 PM by jessehmusic.)
12-27-2011, 03:29 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
RE: what the script Doorslam but reverse

(12-27-2011, 03:29 PM)jessehmusic Wrote: what i gonna put in this script
PHP Code: (Select All)
AddPropImpulse("nameofdoor"float afXfloat afYfloat 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
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#7
RE: what the script Doorslam but reverse

it stills close the door :S
This is how it looks
PHP Code: (Select All)
void OnEnter() 
{
    
AddEntityCollideCallback("Player""doorslam_1_area""func_slam"true1);

 
void func_slam(string &in asParentstring &in asChildint alState)
{
    
AddPropImpulse("doorslam_1"500"world");
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
    
PlaySoundAtEntity("""react_scare""Player"0false);  PlaySoundAtEntity("""close_door.snt""Player"0false); 
    
GiveSanityDamage(5.0ftrue);
    
SetPlayerActive(false);
    
StartPlayerLookAt("doorlsam_1"3.0f5.0f"");
    
AddTimer("timerReleasePlayer"1.5f"timerReleasePlayer");
}

void timerReleasePlayer(string &in asTimer) {
    
SetPlayerActive(true);
    
StopPlayerLookAt();


http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 12-27-2011, 03:42 PM by jessehmusic.)
12-27-2011, 03:39 PM
Website Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#8
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:
PHP Code: (Select All)
SetSwingDoorClosed("doorname"falsetrue); 
(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:
PHP Code: (Select All)
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:
PHP Code: (Select All)
AddPropImpulse("doorname"float afXfloat afYfloat 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
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#9
RE: what the script Doorslam but reverse

is the axis the pos on the door

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
12-27-2011, 04:12 PM
Website Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#10
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
Website Find




Users browsing this thread: 1 Guest(s)