![]() |
Levers - 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: Levers (/thread-9427.html) Pages:
1
2
|
RE: Levers - Angerpull - 07-27-2011 (07-27-2011, 09:50 PM)Kyle Wrote:(07-27-2011, 09:35 PM)Angerpull Wrote:(07-27-2011, 09:26 PM)Kyle Wrote: Make sure that everything is named correctly, or else I have hardly an idea why it's messing up. :/ :C This is just stupid. RE: Levers - Roenlond - 07-27-2011 void OnStart() { SetEntityConnectionStateChangeCallback("Slaver_Lever", "Lever_Slaver"); } void Lever_Slaver(string &in asEntity, int alState) { if (alState == 1) { SetSwingDoorLocked("Slaver_Lever_Door", false, true); AddDebugMessage("Door should unlock", false); } } turn on debug messages and see if that message appears. If it does, the lever is fine but the door is misspelled or something somehow. RE: Levers - Angerpull - 07-27-2011 (07-27-2011, 10:14 PM)Roenlond Wrote: void OnStart() No it doesn't work, and IDK what you meant about debug stuff, so I'll just skip that. Is there something I have to do with the lever? It starts at the middle, and I can move the lever up and down... but nothing happens, it doesn't stay in place when it's supposed to be "Activated" It just slides back to it's original position. RE: Levers - Roenlond - 07-27-2011 Debug messages are really helpful to try and determine where the problem is in your script. You turn on debug messages by pressing F1 while in-game if you are in a dev environment (which you really should be - http://wiki.frictionalgames.com/hpl2/amnesia/devenvguide) In this example, I simply wrote the command "AddDebugMessage("Door should unlock", false);" which will display the messages "Door should unlock" in the bottom edge of your screen if you have debug messages turned on. If it doesn't show up, it means that something is messed up with either the lever name or the "void Lever_Slaver(string &in asEntity, int alState)" part. If it do show up however, something is wrong with the " SetSwingDoorLocked("Slaver_Lever_Door", false, true);" part, most probably the same, since the function is ran without problems. |