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
Open Door Script problem
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#1
Open Door Script problem

Hey guys Smile
I have a problem I made a timer for making a door open slowly and copied the script from one of the original scripts and it worked however i made a second timer exactly like the first one with anothe rname and it doesn't work..
can anybody help me?

working timer:
        SetSwingDoorClosed("mansion_2", false, false);
    SetSwingDoorDisableAutoClose("mansion_2", true);
    AddTimer("mansion_2", 0.01f, "TimerSwingDoor");

void TimerSwingDoor(string &in asTimer)
{
    if(GetLocalVarInt("SwingDoor") == 10){
        SetLocalVarInt("SwingDoor", 0);
        return;
    }
    
    if(asTimer == "mansion_2") AddPropForce(asTimer, 70.0f, 0, 0, "World");
    else AddPropForce(asTimer, -95.0f, 0, 0, "World");
    
    AddLocalVarInt("SwingDoor", 1);
    
    AddTimer(asTimer, 0.03f, "TimerSwingDoor");
}
Not working timer:
        SetSwingDoorLocked("mansion_4", false, false);
    SetSwingDoorClosed("mansion_4", false, false);
    SetSwingDoorDisableAutoClose("mansion_4", true);
    GiveSanityDamage(30, true);
    AddTimer("mansion_4", 0.01f, "TimerSwingDoor2");

void TimerSwingDoor2(string &in asTimer)
{
    if(GetLocalVarInt("SwingDoor1") == 10){
        SetLocalVarInt("SwingDoor1", 0);
        return;
    }
    
    if(asTimer == "mansion_4") AddPropForce(asTimer, 70.0f, 0, 0, "World");
    else AddPropForce(asTimer, -95.0f, 0, 0, "World");
    
    AddLocalVarInt("SwingDoor1", 1);
    
    AddTimer(asTimer, 0.03f, "TimerSwingDoor2");
}

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
02-06-2011, 11:25 AM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#2
RE: Open Door Script problem

Is your second door along the same axis as the first one? Make sure you apply the forces on the correct vector.
02-06-2011, 12:15 PM
Find
pawsUp1703 Offline
Junior Member

Posts: 45
Threads: 16
Joined: Jan 2011
Reputation: 0
#3
RE: Open Door Script problem

(02-06-2011, 12:15 PM)Tottel Wrote: Is your second door along the same axis as the first one? Make sure you apply the forces on the correct vector.

yeah thanks i just had to change the force direction to the opposite because teh door was rotated 180°

It doesn't matter if you love him, or capital H.I.M.
Just put your Paws Up, 'cause you were Born This Way baby!
02-06-2011, 12:35 PM
Find




Users browsing this thread: 2 Guest(s)