![]() |
I'm a dumb person. - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: I'm a dumb person. (/thread-6973.html) |
I'm a dumb person. - evertuy - 03-21-2011 I've always had a knack when it comes to map building, but when it comes to scripting, I'm totally lost. But I decided to give it a go and I got this, and of course it doesn't work, can someone help me fix it so I can understand it? I'm trying to make it so when the player walks it a script area a sound plays. Code: void OnStart(){ RE: I'm a dumb person. - Tanshaydar - 03-21-2011 You have an interaction callback. Is this what you want? Or you want to make a collide call back, when player enters that script area. RE: I'm a dumb person. - thepaleking - 03-21-2011 Code: void Func(stuff) RE: I'm a dumb person. - Anxt - 03-21-2011 As Tanshaydar said, there are multiple ways to call functions. Thepaleking's example is how you would go about making it so a sound plays when a character enters an area. Check the script functions page for more information, but here's the general format for what you are trying to do: Code: /*The 1 signifies that the function will be called upon entering the area. -1 means it will be called upon leaving the area. 0 means both. Note that you should probably keep "savesound" as false, because it will loop otherwise. Soundname isn't important, just pick something that no other sound uses. RE: I'm a dumb person. - evertuy - 03-21-2011 (03-21-2011, 03:41 AM)Tanshaydar Wrote: You have an interaction callback. Is this what you want? Or you want to make a collide call back, when player enters that script area. Yes I want a collide call back so when I enter the area. Double post sorry, but what does "NameOfFunction" mean? Or where can I find it? RE: I'm a dumb person. - Tanshaydar - 03-21-2011 It is a placeholder. It can be like that, or you can write there "ThisIsAnAwesomeFunctionThatWillBlowYourMind_Version_2" or simply "AreaCollision". That's something you decide. |