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
Can't get door to open in Custom story
CrazyKilla Offline
Junior Member

Posts: 19
Threads: 6
Joined: Apr 2012
Reputation: 0
#1
Can't get door to open in Custom story

Hello, im CrazyKilla

Im making a custom story and i made this:
void OpenWindDoor(string &in asParent, string &in asChild, int alState)
{
       {
        SetSwingDoorDisableAutoClose("door_wind", true);
        SetSwingDoorClosed("door_wind", false, true);
        AddPropForce("door_wind", 0, 0, -900, "world");
        AddTimer("", 0.2, "TimerWindDoor");
       }

}
    
void TimerWindDoor(string &in asTimer)
{
    PlaySoundAtEntity("scare", "react_scare.snt", "Player", 0, false);
    PlaySoundAtEntity("creaking_door", "joint_door_move_special.snt", "door_wind", 1.0 / 1.8f, false);
    
    GiveSanityDamage(5, true);
    
    AddTimer("breath1", 2.0f, "TimerStopCreak");
    AddTimer("breath2", 5.0f, "TimerStopCreak");
    AddTimer("breath3", 8.0f, "TimerStopCreak");
    
    AddTimer("door_gust", 0.3f, "TimerSwingDoor");
    
    StopSound("creaking_door", 0.4f);
}
But When i go to the script area, player loses sanity, i get a screen effect and a breath sound, see the wind, but the door stays closed, help please!
09-13-2012, 03:38 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#2
RE: Can't get door to open in Custom story

I think you should try messing with the "AddPropForce" numbers there. Maybe you'll catch the right number.

If it moves as if you tossed a stone at it, then it is still closed.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
09-13-2012, 03:40 PM
Website Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#3
RE: Can't get door to open in Custom story

I think it's likely the AddPropForce value. To see any effects, it's best you set it above 2000 at least.

[Image: Tv0YgQb.gif]
Image by BandyGrass
09-13-2012, 03:54 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#4
RE: Can't get door to open in Custom story

You also have an extra set of brackets. =o

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
09-13-2012, 03:58 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#5
RE: Can't get door to open in Custom story

(09-13-2012, 03:58 PM)Mr Credits Wrote: You also have an extra set of brackets. =o
Though it doesn't seem to be much of a problem. Otherwise an error would pop up.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
09-13-2012, 04:00 PM
Website Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#6
RE: Can't get door to open in Custom story

(09-13-2012, 04:00 PM)Nemet Robert Wrote: Though it doesn't seem to be much of a problem. Otherwise an error would pop up.
Yeah, it's probably no big deal. =U

It's more than likely, as you said, the amount of force and the axis he's using.

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
(This post was last modified: 09-13-2012, 04:10 PM by Tomato Cat.)
09-13-2012, 04:06 PM
Find
CrazyKilla Offline
Junior Member

Posts: 19
Threads: 6
Joined: Apr 2012
Reputation: 0
#7
RE: Can't get door to open in Custom story

Nope, i put the force to 2000, nothing, i put it up to 5000, still nothing, i changed it between X Y and Z and still nothing, found 2 tutorials for it and i also found a example of it in '00_rainy_hall.map' from amnesia main story, still nothing
09-13-2012, 05:03 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#8
RE: Can't get door to open in Custom story

Hmmm well there's a possibility that the door is still stuck, despite your code. To rule that out, put something like this in your script, and try to start with your door slightly open:


void OnStart()
{
AddTimer("doortime", 0.01f, "doorfunc");
}

void doorfunc(string &in asTimer)
{
SetSwingDoorDisableAutoClose("crowbardoor", true);
AddTimer("doortime", 0.01f, "doorfunc");
}

Replace "crowbardoor" with whatever your door name is. This script will ensure that all the time, the door will not auto lock itself.

[Image: Tv0YgQb.gif]
Image by BandyGrass
09-13-2012, 05:11 PM
Find
Kiwi2703 Offline
Junior Member

Posts: 27
Threads: 5
Joined: Sep 2012
Reputation: 2
#9
RE: Can't get door to open in Custom story

Shouldn't it be "SetSwingDoorLocked" instead of " SetSwingDoorClosed"? Cause the door might still be locked.. or am I wrong?
09-14-2012, 11:52 AM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#10
RE: Can't get door to open in Custom story

(09-14-2012, 11:52 AM)Kiwi2703 Wrote: Shouldn't it be "SetSwingDoorLocked" instead of " SetSwingDoorClosed"? Cause the door might still be locked.. or am I wrong?
If the door's locked in the Level Editor, you can untick that without using this script.

SetSwingDoorClosed is for closing or opening doors. So it should be correct.


Try setting the door's "open" amount to 0.2 at least. Then it won't be fully closed, and the slightest push will open it. Had to resort to that.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
09-14-2012, 11:54 AM
Website Find




Users browsing this thread: 1 Guest(s)