Frictional Games Forum (read-only)
Problem with door-opening script - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Problem with door-opening script (/thread-23881.html)



Problem with door-opening script - ArtoLP - 11-17-2013

Hello everybody! Smile

I've got a problem with the opening of a specific door. I want it to open slowly and creepy, but it doesn't open at all Dodgy

Well, when I trigger the script ingame, i can hear the "door-touch-sound" Big Grin
You now what I mean, the sound that plays when you just touch the door, but don't move it. What is wrong?



void OnStart()
{
AddEntityCollideCallback("Player","door_open","dooropen",true,1);
}



void dooropen(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorDisableAutoClose("door4", true);
SetSwingDoorClosed("door4", false, true);

AddPropForce("door4",-600,-600,-600,"world");
}


Thank you! Smile


RE: Problem with door-opening script - Romulator - 11-17-2013

Since you can hear the sound, I would assume the door is in fact opening, but maybe check which way your AddPropForce() command should add force to?

Just an idea if you haven't tried that :3


RE: Problem with door-opening script - ArtoLP - 11-17-2013

I tried it, but it still doesn't work Sad


RE: Problem with door-opening script - DnALANGE - 11-17-2013

(11-17-2013, 03:32 PM)ArtoLP Wrote: I tried it, but it still doesn't work Sad
-600 should be WAY too much..
Mine are like 60 if i am correct.

Try 10,10,10 then
10,0,10 then
0,10,0 etc etc..

You need to check what way your door is opening.

Then make the script in like 2 meter in front of the door.
then you can see if somethign actually happens.
whn you fixed it then just put the scriptarea back where you wanted it to be at first.


RE: Problem with door-opening script - Daemian - 11-17-2013

I don't remember right now, but try this:
AddPropImpulse( "door4", 0, 0, 3, "Local" );


If still nothing, then add a timer to call that impulse again, with a delay of 0.2.