+- 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] Script won't work (/thread-17338.html)
Workin' on a script atm. Half of the lever script works except for the "SetMoveObjectState("PORTNAME", 0);"s. But the real problem is the graveyard script and spike tunnel script neither of which will work i.e. nothing happens.
I'm not sure if its of any significance, but when you use the "for" loop, the last part is supposed to be "++i", not i++.
For the graveyard part, try adding "SetLocalVarInt("Var1", 0);" to void OnStart()
For the lever part, you're setting the lever stuck state twice per function, each time a different value. I'm not sure about using the castle portcullis with a lever either; I've never seen that application, I've only seen it used with a wheel, perhaps that is a possible issue?
Try using debug messages as much as often to see if the problem is with the callback or the function; the more you can isolate the problem, the better off you'll be for troubleshooting.
I don't see why there would be any problem with the script since I've re-used parts of scripts from other maps I've tinkered on and those maps work just fine.