Variable not setting - 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: Variable not setting (/thread-16280.html) |
Variable not setting - Damascus - 06-18-2012 This stupid puzzle is still giving me a headache. I've set up a crank that raises a weight (as stated in an older thread), and when you wind it up, it is supposed to become stuck and set a variable. In the RaiseWeight function, everything works except for apparently the variable becoming one. After I raise the weight, the light comes on and it becomes stuck, but when i go over to test the lever, it keeps playing the "notwound" message and does not become stuck. PHP Code: void OnStart() RE: Variable not setting - palistov - 06-18-2012 Add debug messages to make sure the lever is going to state 1. It could be going to state -1. Same with the wheel. Check its state with a debug message AddDebugMessage("state: "+alState, false); I see no other way you could be getting this bug. Also, instead of setting the variable when the wheel reaches a certain state, do it when the weight object enters/exits a certain area. I've done that before and had everything turn out fine and dandy. RE: Variable not setting - Damascus - 06-18-2012 Crap. I see what i did wrong now. I was setting a GLOBAL variable and checking a LOCAL variable. It's stupid mistakes like these that I only see after posting a thread about it. RE: Variable not setting - palistov - 06-18-2012 Haha! It's the smallest of mistakes that get the best of us. |