![]() |
Open a door with 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Open a door with script (/thread-6123.html) Pages:
1
2
|
Open a door with script - pawsUp1703 - 01-09-2011 Hey I have a kinda dumb question I gues.. but I wanted to know if it is possible to open a door with a script. You close it with the setswingdoorclosed command but if you set it to false the door doesn't open, thats what i tried first. So does anybody know how to open a door with script? I mean not to unlock it but to make it swing open... RE: Open a door with script - Tottel - 01-09-2011 SetSwingDoorLocked("DoorName", false, true); RE: Open a door with script - pawsUp1703 - 01-09-2011 (01-09-2011, 02:57 PM)Tottel Wrote: SetSwingDoorLocked("DoorName", false, true); Uuhm I mean to make the door open not just unlock it i mean i want it to swing open.. RE: Open a door with script - Tottel - 01-09-2011 Oh, my bad. I haven't actually used these before, but you can probably use one of these: void AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem); void AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem); RE: Open a door with script - Frontcannon - 01-09-2011 Just use SetSwingDoorClosed ![]() RE: Open a door with script - pawsUp1703 - 01-09-2011 (01-09-2011, 03:12 PM)Tottel Wrote: Oh, my bad. I#ll try these also they look a little bit complex... (01-09-2011, 03:15 PM)Frontcannon Wrote: Just use SetSwingDoorClosed as I said i tried this but it didn't worked... RE: Open a door with script - Tottel - 01-09-2011 They allow you to put a force along a 3D vector (hence the 3 axes). RE: Open a door with script - pawsUp1703 - 01-09-2011 (01-09-2011, 03:24 PM)Tottel Wrote: They allow you to put a force along a 3D vector (hence the 3 axes). The Script function site on wiki says that these commands shouldn't be used together with swingdoors as this would cause the game to crash. RE: Open a door with script - Tottel - 01-09-2011 No, it says do not use them on the joints. ^^ But as I said, I haven't used them before. RE: Open a door with script - Andross - 01-09-2011 Code: AddPropForce("MyDoor", 100.0f, 0.0f, 0.0f, "World"); ![]() The example assumes that your door swings open towards the x-axis. If I remember it correctly, 100.0 is not enough to open the door completely, so you might have to either call this multiple times by means of a timer or adjust the force value. |