Frictional Games Forum (read-only)
Why doesn't this work? - 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: Why doesn't this work? (/thread-29828.html)

Pages: 1 2


Why doesn't this work? - Storfigge - 04-16-2015

Hey

I have a script box named "Sleep". Why doesn't the script work??

{
AddEntityCollideCallback("Player", "Sleep", "activate_sleep", true, 1);
}

void activate_sleep(string &in asParent, string &in asChild, int alState)
{
FadeOut(5);
AddTimer("T1", 10f, "Timer_1");
}

void Timer_1(string &in asTimer)
{
FadeIn(5);
}


Just get error... I've used pretty much the exact same script before without any problem.


RE: Why doesn't this work? - FlawlessHappiness - 04-16-2015

You need to tell us the error.

The first thing that comes to mind is that you're missing "void OnStart()" in your first function.

void OnStart()
{
AddEntityCollideCallback("Player", "Sleep", "activate_sleep", true, 1);
}


RE: Why doesn't this work? - Storfigge - 04-16-2015

(04-16-2015, 02:12 PM)FlawlessHappiness Wrote: You need to tell us the error.

The first thing that comes to mind is that you're missing "void OnStart()" in your first function.

void OnStart()
{
AddEntityCollideCallback("Player", "Sleep", "activate_sleep", true, 1);
}

Oops i apologize i did actually add void OnStart() just missed to put that in the first question. The error is

: INFO : Compiling void activate_sleep(string&in, string&in, int)

: ERR : Expected ')' or ',' This one is for the AddTimer


RE: Why doesn't this work? - FlawlessHappiness - 04-16-2015

Try removing the f at 10.


RE: Why doesn't this work? - Storfigge - 04-16-2015

(04-16-2015, 04:42 PM)FlawlessHappiness Wrote: Try removing the f at 10.
The error disappeared but now the fadeout don't work :/ This is so weird all of these scripts worked before I've used them in my past mod...


RE: Why doesn't this work? - Amnesiaplayer - 04-16-2015

(04-16-2015, 04:47 PM)Storfigge Wrote:
(04-16-2015, 04:42 PM)FlawlessHappiness Wrote: Try removing the f at 10.
The error disappeared but now the fadeout don't work :/ This is so weird all of these scripts worked before I've used them in my past mod...

you know that 10 seconds is long, right?! like you dont't just wait 5 seconds and stop... right?!


RE: Why doesn't this work? - Storfigge - 04-16-2015

(04-16-2015, 04:52 PM)Amnesiaplayer Wrote:
(04-16-2015, 04:47 PM)Storfigge Wrote:
(04-16-2015, 04:42 PM)FlawlessHappiness Wrote: Try removing the f at 10.
The error disappeared but now the fadeout don't work :/ This is so weird all of these scripts worked before I've used them in my past mod...

you know that 10 seconds is long, right?! like you dont't just wait 5 seconds and stop... right?!

What?? The fadeout is instant and is suppose to take 5 sec to finish, then the timer will activate the fadein after 10 sec. And since when was 10 seconds a long time?


RE: Why doesn't this work? - Romulator - 04-17-2015

Is your ScriptArea or whatever your player is colliding with in your map named 'Sleep'?


RE: Why doesn't this work? - Storfigge - 04-17-2015

(04-17-2015, 01:07 AM)(拉赫兰) Romulator Wrote: Is your ScriptArea or whatever your player is colliding with in your map named 'Sleep'?

Strange the script works now I guess all I had to do was restart everything :O


RE: Why doesn't this work? - FlawlessHappiness - 04-17-2015

(04-17-2015, 01:30 PM)Storfigge Wrote:
(04-17-2015, 01:07 AM)(拉赫兰) Romulator Wrote: Is your ScriptArea or whatever your player is colliding with in your map named 'Sleep'?

Strange the script works now I guess all I had to do was restart everything :O

Yes. You have to restart to make the script restart.