Frictional Games Forum (read-only)
Fadein help - 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: Fadein help (/thread-12290.html)

Pages: 1 2 3 4


RE: Timer help - Statyk - 01-11-2012

How hard is your timer??

//____________________

void OnStart()
{
AddTimer("", 5, "Timer_function");
}

void Timer_function(string &in asTimer)
{
//functions go here
}


//_________________

Timer, done in 5 seconds.


RE: Timer help - eagledude4 - 01-11-2012

(01-11-2012, 10:43 PM)Statyk Wrote: How hard is your timer??

//____________________

void OnStart()
{
FadeIn(5);
AddTimer("", 5, "Timer_function");
}

void Timer_function(string &in asTimer)
{
//functions go here
}


//_________________

Timer, done in 5 seconds.

I already have that >.>

Code:
AddTimer("FadeTimer", 5, "StartGame");

Code:
void StartGame(string &in asTimer) {
    SetPlayerActive(true);
}

I didn't ask you to make a timer for me, I'm asking what's wrong with mine.





RE: Timer help - Statyk - 01-11-2012

Nothing is wrong with it by the looks of it.


RE: Timer help - eagledude4 - 01-11-2012

(01-11-2012, 10:48 PM)Statyk Wrote: Nothing is wrong with it by the looks of it.
That's the conclusion I've come to as well, but it WONT work.





RE: Timer help - Statyk - 01-11-2012

Try something other than "StartGame"... I'm sorry, Idk what else.


RE: Timer help - eagledude4 - 01-11-2012

(01-11-2012, 10:50 PM)Statyk Wrote: Try something other than "StartGame"... I'm sorry, Idk what else.
Sorry, I should have been more clear. The timer works. After 5 seconds I am able to move again (which the timer does), but the fadein doesn't work.



RE: Timer help - Statyk - 01-11-2012

(01-11-2012, 10:45 PM)eagledude4 Wrote:
(01-11-2012, 10:43 PM)Statyk Wrote: How hard is your timer??

//____________________

void OnStart()
{
FadeIn(5);
AddTimer("", 5, "Timer_function");
}

void Timer_function(string &in asTimer)
{
//functions go here
}


//_________________

Timer, done in 5 seconds.

I already have that >.>

Code:
AddTimer("FadeTimer", 5, "StartGame");

Code:
void StartGame(string &in asTimer) {
    SetPlayerActive(true);
}

I didn't ask you to make a timer for me, I'm asking what's wrong with mine.
void OnStart()
{
AddTimer("FadeTimer", 5, "StartGame");
FadeOut(0);
}


void StartGame(string &in asTimer)
{
SetPlayerActive(true);
FadeIn(1);
}


//It should look JUST like that.


RE: Timer help - eagledude4 - 01-11-2012

(01-11-2012, 10:43 PM)Statyk Wrote: void OnStart()
{
AddTimer("FadeTimer", 5, "StartGame");
FadeOut(0);
}


void StartGame(string &in asTimer)
{
SetPlayerActive(true);
FadeIn(1);
}


//It should look JUST like that.

I want it to fade from black as soon as the game starts, not after the timer ends. I'm trying to simulate the player waking up. The time I want it to take to fade is 5 seconds, so why doesn't my code work?




RE: Timer help - Statyk - 01-11-2012

(01-11-2012, 11:01 PM)eagledude4 Wrote:
(01-11-2012, 10:43 PM)Statyk Wrote: void OnStart()
{
AddTimer("FadeTimer", 5, "StartGame");
FadeOut(0);
}


void StartGame(string &in asTimer)
{
SetPlayerActive(true);
FadeIn(1);
}


//It should look JUST like that.

I want it to fade from black as soon as the game starts, not after the timer ends. I'm trying to simulate the player waking up. The time I want it to take to fade is 5 seconds, so why doesn't my code work?

You are going to need another timer then... Try this:



void OnStart()
{
AddTimer("FadeTimer", 5, "StartGame");
AddTimer("", 0.5f, "Fadeinfunc");
FadeOut(0);
}

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


void StartGame(string &in asTimer)
{
SetPlayerActive(true);
}



RE: Timer help - eagledude4 - 01-13-2012

(01-11-2012, 11:13 PM)Statyk Wrote:
(01-11-2012, 11:01 PM)eagledude4 Wrote:
(01-11-2012, 10:43 PM)Statyk Wrote: void OnStart()
{
AddTimer("FadeTimer", 5, "StartGame");
FadeOut(0);
}


void StartGame(string &in asTimer)
{
SetPlayerActive(true);
FadeIn(1);
}


//It should look JUST like that.

I want it to fade from black as soon as the game starts, not after the timer ends. I'm trying to simulate the player waking up. The time I want it to take to fade is 5 seconds, so why doesn't my code work?

You are going to need another timer then... Try this:



void OnStart()
{
AddTimer("FadeTimer", 5, "StartGame");
AddTimer("", 0.5f, "Fadeinfunc");
FadeOut(0);
}

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


void StartGame(string &in asTimer)
{
SetPlayerActive(true);
}
thank you.