![]() |
Simple Scripting Problem - 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: Simple Scripting Problem (/thread-24822.html) |
Simple Scripting Problem - physcostealth - 03-13-2014 I'm having a little problem with scripting right now. Yesterday I was able to make the player walk into an area and have music play. Now, I want the player to walk into the same area and in doing so forces him to look at a door nearby. I've been scripting for a while today and I think everything is correct, but when I load the custom story it crashes. It did this to me yesterday when I tried loading the music area script, but all I did to fix it was delete the cache file of the map the script was tied to. Here's the code: Code: void OnStart() Any help will be appreciated. Thanks! P.S All the names match with their counterparts in the level editor. RE: Simple Scripting Problem - Mudbill - 03-13-2014 I suggest indenting it correctly to make it easier to read. Tab only inside a block, not the block itself. Your last timer, the stoptimer one, has a semi-colon at the end of the constructor. Remove that. Also add a space between string and &in within the parameters. Code: void stoptimer(string &in asTimer) By the way, you can merge the triggermusic and triggerlook functions. Since they happen at the same time, they might as well be in the same function. It's not required though. RE: Simple Scripting Problem - Daemian - 03-13-2014 The only problem I see it's that triggerlook function is structured as if you were going to use it for a timer, but still you declare a callback for it. Plus, you misspelled string&in, that could rise an error. PHP Code: AddEntityCollideCallback("Player", "SoundArea", "triggerlook", true, 1); PHP Code: triggerlook(string&in asTimer) edit: And what he said above. xD RE: Simple Scripting Problem - physcostealth - 03-13-2014 Hey MudBill, you've been building the awesome temple story I've been watching lately. How would I be able to merge the two functions? And thanks Amn, the misspelled code got rid of the crash. But when I enter the area the PlayerLookAt function doesn't do anything (the music plays, so I know that string is working). Could it be related to the structuring of the code? If so, how would I be able to fix this? I was able to fix the problem. I combined the two functions together... I'm not sure if that's what fixed it or not. Code: void OnStart() RE: Simple Scripting Problem - Mudbill - 03-13-2014 Yes, that's exactly how you merge those functions. This looks just right ![]() RE: Simple Scripting Problem - DnALANGE - 03-14-2014 Bump... You should use the DEBUG MODE! Google DEBUG MODE AMNESIA. It should bring you there : Well, i grabbed it for you. You should have this into your FAVORITE ( internet explorere \ Firefox etc.. ) http://wiki.frictionalgames.com/hpl2/amnesia/devenvguide For any more questions you can ask there here on the forum here : - Spoiler below!
|