Frictional Games Forum (read-only)

Full Version: what the script Doorslam but reverse
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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:
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(); 

(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:
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?

A doorlsam up the doors it closed when they enter area the doors slams up
(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.
what i gonna put in this script
PHP Code:
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
(12-27-2011, 03:29 PM)jessehmusic Wrote: [ -> ]what i gonna put in this script
PHP Code:
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.
it stills close the door :S
This is how it looks
PHP Code:
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();

Okay, first of all, you want to make the door "open" like someone pressed the handle down.
Use this code:
PHP Code:
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:
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:
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.
is the axis the pos on the door
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.
Pages: 1 2