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
SetSwingDoorDisableAutoClose
nickTs Offline
Junior Member

Posts: 12
Threads: 3
Joined: Sep 2010
Reputation: 0
#1
SetSwingDoorDisableAutoClose

    else if (asTimer == "Slam1NoAuto")
    {
        SetSwingDoorDisableAutoClose("SlamDoor1", true);
    }

The door is shut and locked when this is supposed to activate, but it doesn't seem to work. I've checked for typos and all seems to be in order. Any ideas as to what's keeping it from working?
09-22-2010, 03:59 PM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#2
RE: SetSwingDoorDisableAutoClose

That function alone does not really do anything?

It only disables so that a door will not auto close when getting within a certain angle to being closed.

So the only use this function really have is to be used together with other functions, like for example when trying push a door open with an impulse (if not using disable autoclose, the door would auto close again after impulse is given.).
09-22-2010, 04:07 PM
Website Find
nickTs Offline
Junior Member

Posts: 12
Threads: 3
Joined: Sep 2010
Reputation: 0
#3
RE: SetSwingDoorDisableAutoClose

(09-22-2010, 04:07 PM)jens Wrote: That function alone does not really do anything?

It only disables so that a door will not auto close when getting within a certain angle to being closed.

So the only use this function really have is to be used together with other functions, like for example when trying push a door open with an impulse (if not using disable autoclose, the door would auto close again after impulse is given.).

That's what I'm trying to do. I have it set to unlock then open with a body impulse a few seconds later.

Edit: Here's the full timer if that helps.

    else if(child == "Slam1Timer")
    {
        AddTimer("Slam1", 0, "SlamDoor1Seq");
        AddTimer("Slam1Sound", 0.1, "SlamDoor1Seq");
        AddTimer("Slam1Look", 0.2, "SlamDoor1Seq");
        AddTimer("Slam1Lock", 0.5, "SlamDoor1Seq");
        AddTimer("Slam1NoAuto", 1, "SlamDoor1Seq");
        AddTimer("Slam1StopLook", 1, "SlamDoor1Seq");
        AddTimer("Slam1Unlock", 8, "SlamDoor1Seq");
        AddTimer("Slam1Open", 10, "SlamDoor1Seq");
    }

void SlamDoor1Seq (string &in asTimer)
{
    if (asTimer == "Slam1")
    {
        PlaySoundAtEntity("", "TensionTick","Player", 0, false);
        SetSwingDoorClosed("SlamDoor1", true, true);
    }
    else if (asTimer == "Slam1Sound")
    {
        AddPlayerBodyForce(6000*2.5f,6000,0, false);
        PlaySoundAtEntity("", "break_wood", "SlamDoor1", 0, false);
    }
    else if (asTimer == "Slam1Look")
    {
        StartPlayerLookAt("SlamDoor1", 5, 5, "");
        PlayGuiSound("react_scare.snt", 1);
    }
    else if (asTimer == "Slam1Lock")
    {
        SetSwingDoorLocked("SlamDoor1", true, true);
    }
    else if (asTimer == "Slam1StopLook")
    {
        StopPlayerLookAt();
    }
    else if (asTimer == "Slam1NoAuto")
    {
        SetSwingDoorDisableAutoClose("SlamDoor1", true);
    }
    else if (asTimer == "Slam1Unlock")
    {
        SetSwingDoorLocked("SlamDoor1", false, false);
    }
    else if (asTimer == "Slam1Open")
    {
        AddBodyImpulse("SlamDoor1_Body_1", -2, 0, 0, "World");
    }
}
09-22-2010, 04:11 PM
Find




Users browsing this thread: 1 Guest(s)