HELP!!! - 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: HELP!!! (/thread-14851.html) |
RE: HELP!!! - JPPSJ - 04-17-2012 (04-17-2012, 12:46 AM)Putmalk Wrote: Okay, so, first, we have a mapping problem. In our map, we are going to have a door called "mansion_1", an area called "AreaSlamDoor", and that's pretty much it. Our player is always called "Player" when referred to by the script.Ok, thank so much. can you please post another comment showing everything without the notes inbetween? RE: HELP!!! - Putmalk - 04-17-2012 Code: void OnStart() RE: HELP!!! - JPPSJ - 04-17-2012 (04-17-2012, 12:53 AM)Putmalk Wrote:Do i add //slam door, with sound, effect, and sanity damage? or [/code]? RE: HELP!!! - Putmalk - 04-17-2012 In your script, you can add anything you want if it is preceded by "//", because that tells the computer that the line is a comment and to ignore everything past it. It doesn't check it for syntax. Comments are there so that you can tell yourself what is going on, or else you will forget, and I promise you, you will forget a lot. So always comment what the code is doing so you know what's going on! [/code] is for these forums, not for scripting. RE: HELP!!! - Xanthos - 04-17-2012 EDIT: I got ninja'd RE: HELP!!! - JPPSJ - 04-17-2012 (04-17-2012, 12:59 AM)Putmalk Wrote: In your script, you can add anything you want if it is preceded by "//", because that tells the computer that the line is a comment and to ignore everything past it. It doesn't check it for syntax. Comments are there so that you can tell yourself what is going on, or else you will forget, and I promise you, you will forget a lot. So always comment what the code is doing so you know what's going on!Ok i will try this. i will post what i scripted if it doesnt work maby u coukd tell me what i did wrong. thanks soo mch! RE: HELP!!! - Putmalk - 04-17-2012 Yup, glad I can help. Just please don't copy/paste. You won't learn a thing. RE: HELP!!! - JPPSJ - 04-17-2012 (04-17-2012, 01:02 AM)Putmalk Wrote: Yup, glad I can help. Just please don't copy/paste. You won't learn a thing. Wait, does this go under void on leave? void SlamDoor(string &in asParent, string &in asChild, int alState) { //slam door, with sound, effect, and sanity damage SetSwingDoorLocked("mansion_1", true, true); GiveSanityDamage(10, true); PlaySoundAtEntity("doorslam", "15_slam_door.snt", "mansion_1", 0.4f, false); RE: HELP!!! - Putmalk - 04-17-2012 Functions aren't constrained to "below or above" any other function (at least in our game scripts!). It can technically go anywhere. For example, in the main game scripts, onstart and other functions are at the bottom of the script; sometimes, I have them on the top. Location doesn't matter. What does matter is that you're not putting the functions inside of other functions, like this: Code: OnStart() That's bad. RE: HELP!!! - JPPSJ - 04-17-2012 (04-17-2012, 01:11 AM)Putmalk Wrote: Functions aren't constrained to "below or above" any other function (at least in our game scripts!). It can technically go anywhere. For example, in the main game scripts, onstart and other functions are at the bottom of the script; sometimes, I have them on the top. Location doesn't matter.Ok, so i put everthing you put in void OnStart() { "your example" } |