[SCRIPT] SetLanternLitCallback - 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] SetLanternLitCallback (/thread-22185.html) Pages:
1
2
|
RE: SetLanternLitCallback - SilentStriker - 08-03-2013 (08-03-2013, 07:16 PM)hunchbackproduction Wrote: Ok! tried to get this to work, I thought I understood this, But boy was I wrong xD it should not be bool LanternLit it has to be bool abLit since it's a programmed parameter. so it should look more like this Code: SetLanternLitCallback("LanternLit"); Here's your fixed code: Code: void LanternTinderCheck(bool abLit) RE: SetLanternLitCallback - Tomato Cat - 08-04-2013 (08-03-2013, 07:16 PM)hunchbackproduction Wrote: Ok! tried to get this to work, I thought I understood this, But boy was I wrong xDDon't worry. It will all make sense. =p You could put addNumber(1, 3) somewhere, but the parser/compiler will give you an error unless you define that function somewhere. I and K, as in my previous example, represent the values that you pass to that function. "public" is what's known as an access specifier. It's more of an advanced topic. It was force of habit, but I don't think the HPL scripting requires it. You can ignore it if you like. The boolean is passed through the internal workings of the engine. You define parameters when you define the function. Also, try using "AddDebugMessage" rather than setmessage. RE: SetLanternLitCallback - PutraenusAlivius - 08-04-2013 (08-04-2013, 01:33 AM)Tomato Cat Wrote:(08-03-2013, 07:16 PM)hunchbackproduction Wrote: Ok! tried to get this to work, I thought I understood this, But boy was I wrong xDDon't worry. It will all make sense. =p Oh. I really thought it's a returnType. RE: SetLanternLitCallback - Tomato Cat - 08-04-2013 (08-04-2013, 02:12 AM)JustAnotherPlayer Wrote: Oh. I really thought it's a returnType. No, in this case "void" is the return type (or lack thereof). RE: SetLanternLitCallback - PutraenusAlivius - 08-04-2013 (08-04-2013, 03:06 AM)Tomato Cat Wrote:(08-04-2013, 02:12 AM)JustAnotherPlayer Wrote: Oh. I really thought it's a returnType. Oh ok. If returnType is int/float, I have to return a value through return; right? RE: SetLanternLitCallback - Tomato Cat - 08-04-2013 Yep. It's the same with all the primitive types and any objects etc. RE: SetLanternLitCallback - Your Computer - 08-04-2013 (08-03-2013, 09:31 PM)SilentStriker Wrote: it should not be bool LanternLit it has to be bool abLit since it's a programmed parameter. In computer programming, parameter variable names are irrelevant insofar as the signature of the function is concerned. All that really matters is the data type of the parameter. In other words, either "LanternLit" or "abLit" or whatever, or nothing at all, can be used. For example, this would still work: PHP Code: void LanternCallback(bool) RE: SetLanternLitCallback - SilentStriker - 08-04-2013 (08-04-2013, 09:42 AM)Your Computer Wrote:(08-03-2013, 09:31 PM)SilentStriker Wrote: it should not be bool LanternLit it has to be bool abLit since it's a programmed parameter. True, god I'm rusty with my programming... RE: SetLanternLitCallback - hunchbackproduction - 08-04-2013 Haha ^ Thanks to all of you :3 The CODE IT WORKS ! Real thanks to you guys, reputation for everyone. May even put you guys in the credits if I ever finish this thing! |