[SCRIPT] Sanity Function - 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] Sanity Function (/thread-53841.html) |
Sanity Function - PeterP - 08-05-2017 Hello! I am working on a mod and I would like to know how to use an area to trigger a function ONLY when sanity is below a certain level. I know this is a dumb thing to not know so I keep this text short ;p any answers? Thanks for your time. RE: Sanity Function - Romulator - 08-05-2017 Hello! It's actually rather simple. We simply use an "If-Conditional" to check whether the sanity is lesser than a certain value, and if so, execute some code. If you see the first if-block on that page I linked, and combine it with a function where we return a value on the Engine Scripts page, you can make something like this: Spoiler below!
A few notes:
Feel free to ask if you have questions! RE: Sanity Function - PeterP - 08-05-2017 Thanks a lot ^.- It is pretty simple I do not have any questions |