Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why doesn't this work?
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#1
Why doesn't this work?

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.

(This post was last modified: 04-16-2015, 01:58 PM by Storfigge.)
04-16-2015, 01:57 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Why doesn't this work?

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);
}

Trying is the first step to success.
04-16-2015, 02:12 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#3
RE: Why doesn't this work?

(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

04-16-2015, 04:39 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Why doesn't this work?

Try removing the f at 10.

Trying is the first step to success.
04-16-2015, 04:42 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#5
RE: Why doesn't this work?

(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...

(This post was last modified: 04-16-2015, 04:47 PM by Storfigge.)
04-16-2015, 04:47 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#6
RE: Why doesn't this work?

(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
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#7
RE: Why doesn't this work?

(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?

04-16-2015, 04:57 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#8
RE: Why doesn't this work?

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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-17-2015, 01:07 AM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#9
RE: Why doesn't this work?

(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

(This post was last modified: 04-17-2015, 01:31 PM by Storfigge.)
04-17-2015, 01:30 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
RE: Why doesn't this work?

(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.

Trying is the first step to success.
04-17-2015, 01:34 PM
Find




Users browsing this thread: 1 Guest(s)