Making a door open slowly [SOLVED] - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Making a door open slowly [SOLVED] (/thread-6624.html) |
Making a door open slowly [SOLVED] - Linus Ågren - 02-17-2011 How do you make a door open slowly and not slam up? I've tried with a few PropImpulses but they seem to be quite rough. I looked at the script in the first level where the door opens, and I saw some PropForces but I can't get it to work. So how do you get a door to slowly open? RE: Making a door open slowly - Vradcly - 02-18-2011 Maby if you send a propforce on a collideable entity like a barrel or something that rolls into the door and by its force in turn makes the door open slowly. And make the barrel invisible by removing its "entity connection". I dont know if this works, just a theory I came up with now... RE: Making a door open slowly - Acies - 02-18-2011 nah. I've just made one. Add a timer linked to a propimpulse. something like (this is not correct code, just my general idea from memory): void PushDoorTimer { if getlocalvarint("TickX") == 40) { return; } else AddPropImpulse("door", 0.0f, 0.0f, 0.04f, ""); // 0.04f (around this force makes it open slowly regarding the timer) SetSwingDoorDisableAutoClose("door", false); AddTimer("PushDoor", 0.1f, "PushDoorTimer"); AddLocalVarInt("TickX", 1); } This script will give the door a small push every 0.1 second for a total of 4 seconds. The swingdoordisableautoclose is important, since such small forces wouldn't open the door otherwise. If you are still having trouble I could copy --> paste the script for you tomorrow. RE: Making a door open slowly - Linus Ågren - 02-18-2011 Okay, I fixed the errors, but the door won't push itself open. The script now looks like: Code: void DoorOpenTimer(string &in asTimer) but it doesn't work. The door remains closed. RE: Making a door open slowly - jens - 02-18-2011 Add SetSwingDoorClosed("cellar_wood01_1", false); //<- look up the exact function incase I rememeber incorrectly And then change the order of things to be: SetSwingDoorDisableAutoClose("cellar_wood01_1", false); SetSwingDoorClosed("cellar_wood01_1", false); AddPropImpulse("cellar_wood01_1", 0.0f, 0.0f, 0.04f, ""); RE: Making a door open slowly - Linus Ågren - 02-18-2011 (02-18-2011, 07:35 AM)jens Wrote: Add SetSwingDoorClosed("cellar_wood01_1", false); //<- look up the exact function incase I rememeber incorrectly Alright, I changed the script to: Code: void DoorOpenTimer(string &in asTimer) Now the door bugs up and opens/closes very very little, spamming the open & close sound. I tried adding more PropImpulse to the door, but with no luck. Edit: I found the problem. I changed: Code: SetSwingDoorDisableAutoClose("cellar_wood01_1", false); Code: SetSwingDoorDisableAutoClose("cellar_wood01_1", true); |