Frictional Games Forum (read-only)

Full Version: Why doesn't this work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.
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);
}
(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
Try removing the f at 10.
(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...
(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?!
(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?
Is your ScriptArea or whatever your player is colliding with in your map named 'Sleep'?
(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
(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.
Pages: 1 2