![]() |
A script problem. [SOLVED] - 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: A script problem. [SOLVED] (/thread-6178.html) |
A script problem. [SOLVED] - Seragath - 01-12-2011 Hey. I have a problem with this script. Since I'm really new to C++ as a whole, I cannot actually see what I am doing wrong. But here is the script. An explanation of what I am doing wrong and why, would be appreciated. Seragath. Code: void OnStart() It does trigger the first FadeOut(0) etc. But not the rest of it. (And this "string &in asSomething") is still quite confusing for me. ![]() RE: A script problem. - jens - 01-12-2011 change (string &in asParent, string &in asChild, string &in asTimer, int alState) to (string &in asTimer) for your two timer functions and it should work. RE: A script problem. - Seragath - 01-12-2011 (01-12-2011, 11:40 AM)jens Wrote: change Yeah but then the string to TeleportPlayer won't work. >.> The error: Main(149,1): ERR: A function with the same name and parameters already exist main(147,1):ERR: Expected';' main(151,1):ERR :Multiple matching signatures to 'TeleportPlayer(String@&)' main 158,1):ERR : (Same as the one above) Sadly I do not know what this means....At all. >.> (Of course the game crashes with this error.) RE: A script problem. - Tottel - 01-12-2011 Go to line 149 in your script file, and check if you're using the proper function. ![]() RE: A script problem. - Seragath - 01-12-2011 Found the mistake. What I did wrong was that I did Code: void TeleportPlayer I had to change the name. I guess it got confused when I did it like that. And that FadeOut(0) was missing a ";" in the end. (>.<) Code: FadeOut(0); Since I have this thread open still, I have another question. When I add a code with a timer, Code: AddTimer("Something", 5f, "Somethingelse" What does the 5f mean ? I see some use 5f while others just use 5. And thanks for the help! ![]() EDIT: So basically what the code says now is that. When Faint_Scare triggers there will go 2 seconds before it calls TelePortPlayer and another 2 seconds till it calls TelePortback ? RE: A script problem. - jens - 01-12-2011 f means float, meaning a 1.0 number unlike an integer which would only be 1. You don't have to use f to specify a float, but I personally do it because I think the script is easier to read. yes, what you say should happen is what the script should do. RE: A script problem. - Seragath - 01-12-2011 (01-12-2011, 01:18 PM)jens Wrote: f means float, meaning a 1.0 number unlike an integer which would only be 1. You don't have to use f to specify a float, but I personally do it because I think the script is easier to read. Okey, thanks for the help. ![]() Huff, it's already getting confusing when I have to look through 200 or something lines...I will be insane by the time I'm done. >.< RE: A script problem. - Tottel - 01-12-2011 (01-12-2011, 01:40 PM)Seragath Wrote: Huff, it's already getting confusing when I have to look through 200 or something lines...I will be insane by the time I'm done. >.< http://en.wikipedia.org/wiki/Indent_style I can really suggest you to read and use that then. ![]() RE: A script problem. - Seragath - 01-12-2011 (01-12-2011, 01:46 PM)Tottel Wrote:(01-12-2011, 01:40 PM)Seragath Wrote: Huff, it's already getting confusing when I have to look through 200 or something lines...I will be insane by the time I'm done. >.< Thanks I'll read it once I get the time. ![]() |