[SCRIPT] Door - 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: [SCRIPT] Door (/thread-11280.html) |
RE: Door - flamez3 - 11-11-2011 (11-11-2011, 06:49 PM)proshitness Wrote: didn't workIf his didn't work: void OnStart() { AddEntityCollideCallback("Player", "Shut1", "CloseDoors", true, 1); } void CloseDoors(string &in asParent, string &in asChild, int alState) { AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem); SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects); // you have to edit these with the correct information } RE: Door - proshitness - 11-11-2011 but what should i put in the afX afY and afZ RE: Door - Statyk - 11-11-2011 a float. a number to represent force amount. could be 0, or 300-1000. make Y zero so there's no issues. (a door doesn't open UP >> ) move the door on the map to see which direction is X or Z. then make sure if it will be a positive number or negative number, depending on the direction the door opens or closes. RE: Door - proshitness - 11-11-2011 so when it opens to the Z and and closes to the X so i need to put somewhere about 600 to X? RE: Door - Statyk - 11-11-2011 (11-11-2011, 08:41 PM)proshitness Wrote: so when it opens to the Z and and closes to the X so i need to put somewhere about 600 to X?yes, sounds about right. if it doesn't go anywhere or the wrong way, just set it to negative. RE: Door - proshitness - 11-19-2011 Still doesn't work... =\ RE: Door - JenniferOrange - 11-19-2011 All of the suggestions are correct. Are you sure the script areas and door names correspond? Yes, the easiest way to do it IS with SetSwingDoorClosed. RE: Door - proshitness - 11-20-2011 Here please look at the code, it still isn't working... please look at this and tell me what am i doing wrong Code: void OnStart(){ AddEntityCollideCallback("Player", "Light_Out", "LampsOff_func", true, 1); AddEntityCollideCallback("Player", "Shut1", "CloseDoors", true, 1);} RE: Door - Statyk - 11-20-2011 Honestly, I hope you get this working because I have the SAME problem you do. My door does NOT want to open, no matter what I script (I'm almost abandoning the idea). When I script this, the door jerks like it WANTS to open, but it IMMEDIATELY shuts within one frame of a second. =\ You're not alone on this boat. RE: Door - Your Computer - 11-20-2011 (11-20-2011, 04:40 PM)proshitness Wrote: Here please look at the code, it still isn't working... Change PHP Code: void CloseDoors(string &in asParent, bool abChild, int alState) to PHP Code: void CloseDoors(string &in asParent, string &in asChild, int alState) |