Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Opening Door Script not working
Author Message
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #1
Opening Door Script not working

So I'm trying to get a door to open in the face of a player as quick as scripts I've seen and used where the door slams closed. So far I've used codes like the setdoorswinglocked to false, the setdoorswingclosed to false, the setdoordisableautoclose to false, and also the addpropimpulse in the right direct to have the door open (in this case, positive Z). But for some reason, I can't get it to open? I can easily get the scripts where the door closes shut quickly to work, but for some reason I can't get this one to work!

Help?

Check out my custom stories(1)(2)!
10-13-2010 02:51 AM
Find all posts by this user Quote this message in a reply
Chilton Offline
Member

Posts: 138
Joined: Sep 2010
Reputation: 0
Post: #2
RE: Opening Door Script not working

Hmm... Try disabling effects with the door closing thing, other than that this is interesting
10-13-2010 03:01 AM
Find all posts by this user Quote this message in a reply
Entih Offline
Junior Member

Posts: 47
Joined: Sep 2010
Reputation: 0
Post: #3
RE: Opening Door Script not working

Hmm. Did you say you disabled the disabling of the auto-close? Wouldn't that mean you enabled automatic door closing? That might be your issue if that wasn't a mis-type, same double negative got me confused in the early stage of my map.

Otherwise, make sure you are using more than one impulse, as a single impulse is often ineffective. Multiple using timers is effective. Refer to the script for the doors in the first map in Amnesia for reference.

Though you have me curious about what the difference is between a physics impulse and physics force.
10-13-2010 06:00 AM
Find all posts by this user Quote this message in a reply
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #4
RE: Opening Door Script not working

Hmm, I'll check, that might be the issue if that wasn't a typo I made.

Check out my custom stories(1)(2)!
10-13-2010 09:52 PM
Find all posts by this user Quote this message in a reply
Pandemoneus Offline
Senior Member

Posts: 328
Joined: Sep 2010
Reputation: 0
Post: #5
RE: Opening Door Script not working

Take a look at my little test map:

http://www.mediafire.com/?h4g1mk3rbt8rl0z

The force you need to push a door seems to vary from door to door though.

10-13-2010 10:27 PM
Find all posts by this user Quote this message in a reply
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #6
RE: Opening Door Script not working

Sorry for the relatively late reply, got caught up in college studies. In regards to the previous posters, no I still couldn't get the door to open correctly...

Ok, Pandemoneus, once I have some good amount of free time, I'll check it out, thanks.

Check out my custom stories(1)(2)!
10-15-2010 06:12 AM
Find all posts by this user Quote this message in a reply
Entih Offline
Junior Member

Posts: 47
Joined: Sep 2010
Reputation: 0
Post: #7
RE: Opening Door Script not working

If it doesn't open when it is unlocked, unclosed, and won't auto-close, then it must be something with the force applied to it. Have you tried 'AddPropForce' rather than 'AddPropImpulse'? As I said, I have no clue what the difference is, but it may or may not be important. Otherwise, the value of the force may be too weak, or there are too few forces being used over time.
10-15-2010 06:47 AM
Find all posts by this user Quote this message in a reply
Frontcannon Offline
Senior Member

Posts: 538
Joined: Jul 2010
Reputation: 2
Post: #8
RE: Opening Door Script not working

(10-15-2010 06:47 AM)Entih Wrote:  If it doesn't open when it is unlocked, unclosed, and won't auto-close, then it must be something with the force applied to it. Have you tried 'AddPropForce' rather than 'AddPropImpulse'? As I said, I have no clue what the difference is, but it may or may not be important. Otherwise, the value of the force may be too weak, or there are too few forces being used over time.

I've asked me that question, too.. AddPropForce doesn't work in my floating tut, though.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
10-15-2010 12:29 PM
Find all posts by this user Quote this message in a reply
Entih Offline
Junior Member

Posts: 47
Joined: Sep 2010
Reputation: 0
Post: #9
RE: Opening Door Script not working

Yes, but force is, however, what I had used to open doors in my own map, to complete success, as seen in the following code snippet.

void MainhallDoorTouch(string &in entity)
{
    AddQuest("mainhall00", "mainhall00");
    
    SetSwingDoorLocked("Mainhall_Offdoor_1", false, false);
    SetSwingDoorClosed("Mainhall_Offdoor_1", false, false);
    SetSwingDoorDisableAutoClose("Mainhall_Offdoor_1", true);
    
    AddTimer("SidedoorTimer", RandFloat(5.0f, 10.0f), "MainhallSidedoorOpen");
    SetLocalVarInt("Sidedoor_Swinging", 0);
}

void MainhallSidedoorOpen(string &in asTimer)
{
    if(GetLocalVarInt("Sidedoor_Swinging") == 0)
    {
        PlaySoundAtEntity("DoorCreak", "joint_door_move_special.snt", "Mainhall_Offdoor_1", 1.0f / 2.5f, false);
        StartPlayerLookAt("Mainhall_Offdoor_1", 1.2f, 1.4f, "SidehallLookedat");
        AddTimer("LookStop_mhall", 2, "MainhallSidedoorOpen");
    }
    
    if(asTimer == "LookStop_mhall")
        StopPlayerLookAt();
        
    AddLocalVarInt("Sidedoor_Swinging", 1);
    AddPropForce("Mainhall_Offdoor_1", 0, 0, -75.0f, "World");
    
    if(GetLocalVarInt("Sidedoor_Swinging") < 15)
    {
        AddTimer("SidedoorTimer", 0.07f, "MainhallSidedoorOpen");
    }
    else
    {
        SetSwingDoorDisableAutoClose("Mainhall_Offdoor_1", false);
        StopSound("DoorCreak", 1.0f);
    }
}
10-15-2010 05:48 PM
Find all posts by this user Quote this message in a reply
theDARKW0LF Offline
Member

Posts: 150
Joined: Sep 2010
Reputation: 0
Post: #10
RE: Opening Door Script not working

Again, been too busy to respond, but I got it to work. Apparently 10 is too low of a force and I had to put it all the way up to 45 to get it to open all the way.

Check out my custom stories(1)(2)!
10-17-2010 09:58 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)