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


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

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#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
Chilton Offline
Member

Posts: 138
Threads: 9
Joined: Sep 2010
Reputation: 0
#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
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#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
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#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
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#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
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#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
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#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
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#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
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#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
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#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




Users browsing this thread: 2 Guest(s)