Adding Scripts? - 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: Adding Scripts? (/thread-23356.html) |
Adding Scripts? - schwem00 - 09-24-2013 I have been trying to make my first CS and I have gone through the wiki looking for this. It may sound like a stupid question, but how do I add scripts to my level? I have already copied down the code for locked doors and I have the inventory spots in the lang file but I have no idea where to put my code. I downloaded a few custom maps to try to find out how to add scripts but I just cant figure it out. Thanks in advance! RE: Adding Scripts? - FlawlessHappiness - 09-24-2013 Oh, haha See, when you downloaded the maps, did you notice these .hps files? These are what you're looking for. I recommend having a program like Geany. It'll help you with colors and such when you're scripting, but notepad is ok too. Download Geany though. It'll help you. What you do is, you start with an empty text file. Then you write this: PHP Code: void OnStart() This has to be in the file, for it to work. Now save the file, but change the extension from .txt to .hps. Save it in the maps folder of your custom story and call it the same as the corresponding map. A script is always defined inside brackets like these { } It's important to keep all script lines inside brackets. These scripts can only be triggered if they're in a function. NOTE: A function is one sequence of script lines, created by a name, parameters and two brackets. Help with parameters: http://www.frictionalgames.com/forum/thread-18368.html If you're having any more problems with scripting, please DO ask! Also... Questions about scripting and Level Editing usually goes here: http://www.frictionalgames.com/forum/forum-39.html RE: Adding Scripts? - schwem00 - 09-24-2013 (09-24-2013, 10:07 PM)Darth FlawlessHair Wrote: Oh, haha Thanks so much! I didn't think the .hps files did anything other then load the map, this solves my problems! RE: Adding Scripts? - CarnivorousJelly - 09-25-2013 Of course it didn't do anything :p you haven't added any functions to it! This is a list of all the different engine scripts you can use and what they do. BeeKayK Darth FlawlessHair might have given that link earlier, but I didn't see it, so I felt the need to add c: And just like he said - if you have any questions at all, ask (make sure you ask in this thread)! If you can, searching the forum for FAQs is also a good idea. Also, I generally don't bite, but I'm not fantastic with scripting. If you have relatively simple questions (ie: what's a bool/string/float/whatever, or how do I add pictures to loading screens) I can answer them. I like to think I'm good with the level editor though, so if you ever need help in that area, don't be shy! Being shy was a bit of a mistake I made when I joined the forum - well, I was actually lurking for several months before I joined - and I wasted a lot of time because I was too shy to ask 'noob' questions. Edit: remembered BeeKayK is now Darth FlawlessHair Edit: Added a bit RE: Adding Scripts? - FlawlessHappiness - 09-25-2013 (09-25-2013, 03:57 AM)Kia Wrote: Edit: remembered BeeKayK is now Darth FlawlessHair You'll still be Kiandra in my head... |