[SCRIPT] Wheel lever wont stick in positon once turned - 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] Wheel lever wont stick in positon once turned (/thread-50274.html) |
Wheel lever wont stick in positon once turned - serbusfish - 06-24-2016 I have wrote a script which opens a bulkhead door, but for some reason the wheel lever wont stick in position even though it is sucessfully opening the door. I tried using the stuckstate command and SetPropStaticPhysics but neither work. Here is what I have: Quote:void OnStart() Any help is really appreciated. RE: Wheel lever wont stick in positon once turned - Mudbill - 06-24-2016 The script is incorrectly formatted so I assume you're crashing the game? Remember you cannot call a void block function from within another function (like inside your OnStart). Try this: PHP Code: void OnStart() With this you can also try //commenting out the SetPropStaticPhysics and see if SetWheelStuckState works better for you if you want. RE: Wheel lever wont stick in positon once turned - serbusfish - 06-25-2016 (06-24-2016, 05:08 PM)Mudbill Wrote: The script is incorrectly formatted so I assume you're crashing the game? I added the {} to the OnStart part manually so that is why it look wrong, the actual script file is correct and the level works fine but the wheel wont become stuck or static. EDIT: Well this is strange because now the script is working! I have had this sort of thing happen before, for example a few times now I have put a custom sound in my CS folder and the game wont find it, but the next day after a PC restart it now does find it. Something to do with cache perhaps? I dont know, but my script now works so thank you anyway RE: Wheel lever wont stick in positon once turned - Mudbill - 06-25-2016 You can try replacing the name of the wheel with asEntity inside your ValveEventHandler function. That will make sure it always gets the right name of the entity. PHP Code: SetPropStaticPhysics(asEntity, true); Which entity as you using btw? RE: Wheel lever wont stick in positon once turned - serbusfish - 06-25-2016 (06-25-2016, 08:02 AM)Mudbill Wrote: You can try replacing the name of the wheel with asEntity inside your ValveEventHandler function. That will make sure it always gets the right name of the entity. Cheers for that tip, I am using 'valve_iron'. |