Frictional Games Forum (read-only)
[SCRIPT] Script Codes for Shutting Swing Door? - 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] Script Codes for Shutting Swing Door? (/thread-21400.html)



Script Codes for Shutting Swing Door? - FurtherGames - 05-04-2013

Hey there, I've been working on my custom story for a while now.

The player enters his bedroom, and he decides to go to sleep, but first he must blow out all the candles, so he does. Then, once all the candles are out, the player teleports to the bed. He then wakes up on the bed. I want it so that while he is teleporting to the bed, the door shuts. Without the player saying it or anything like that. So that even if the player doesn't shut the door, it does it anyway.



RE: Script Codes for Shutting Swing Door? - CarnivorousJelly - 05-04-2013

(05-04-2013, 05:48 PM)FurtherGames Wrote: <bolded text question here>

http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#doors Should have the function you're looking for. Specifically, it's this one:

void SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);
string& asName = "Insert the name of the door here"
bool abClosed = true/false, you want true
bool abEffects = true/false depending on if you want sound to accompany the door closing

And one more thing. I believe the majority of the questions you've asked so far have been answered before and in tutorials on the wiki. Try searching here http://wiki.frictionalgames.com/hpl2/tutorials/start#scripting_tutorials and the forum before you post a question. I certainly don't mind answering, but posting a new thread for each scripting question bumps other people's questions down the page which certainly doesn't help them get their questions answered. I usually just post new questions in the same thread as my old, answered one (so long as they are relevant) to avoid spamming everyone Smile


RE: Script Codes for Shutting Swing Door? - FurtherGames - 05-04-2013

(05-04-2013, 05:58 PM)Kiandra Wrote:
(05-04-2013, 05:48 PM)FurtherGames Wrote: <bolded text question here>

http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#doors Should have the function you're looking for. Specifically, it's this one:

void SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);
string& asName = "Insert the name of the door here"
bool abClosed = true/false, you want true
bool abEffects = true/false depending on if you want sound to accompany the door closing

And one more thing. I believe the majority of the questions you've asked so far have been answered before and in tutorials on the wiki. Try searching here http://wiki.frictionalgames.com/hpl2/tutorials/start#scripting_tutorials and the forum before you post a question. I certainly don't mind answering, but posting a new thread for each scripting question bumps other people's questions down the page which certainly doesn't help them get their questions answered. I usually just post new questions in the same thread as my old, answered one (so long as they are relevant) to avoid spamming everyone Smile

I sort of dislike using that website because it's sort of mashed up.


RE: Script Codes for Shutting Swing Door? - CarnivorousJelly - 05-04-2013

Just use the search function at the top or press CTRL+F on your keyboard and type in a search word

As messy as it is, it's useful. Seriously. Most of what I've learned comes from there and reading other people's questions on the forum

There's also YourComputer's scripting tutorial guide, but I can't find it right now. I'll update this post with a link when I do.

Edit found them:
http://www.frictionalgames.com/forum/thread-10798.html
http://www.frictionalgames.com/forum/thread-19933.html
http://www.frictionalgames.com/forum/thread-19019.html
There's a lot more under the Articles Thread if you just look. Once you understand what string, bool, and float mean, you can use the majority of scripts available.