Frictional Games Forum (read-only)
Make an end ? - 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: Make an end ? (/thread-4915.html)



Make an end ? - fantino - 10-04-2010

Hi everyone.

I'm trying to make an end to my level but I don't know how. I built an area and wrote
Code:
void CollideEnd(string &in asParent, string &in asChild, int alState)
{
    FadeOut(1.0f);
    AddTimer("credits", 2.0f, "TimerCredits");
}

void TimerCredits(string &in asTimer)
{
    StartCredits("credits.ogg", false, "Ending", "MyCredits", -1);
}

But it doesn't work.

Can anybody explain to me how to do that ? Thank you! Angel


RE: Make an end ? - locker - 10-04-2010

You could try placing in the function void OnStart() a call to add the player entity collide callback function, when collides with an area. In this case, your area name is "MyAreaName". The engine will check if the player collides with the given entity(area) and if does, then the CollideEnd (...) functions is called

Something like this


Code:
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "MyAreaName", "CollideEnd", true, 1);
}

void CollideEnd(string &in asParent, string &in asChild, int alState)
{
    FadeOut(1.0f);
    AddTimer("credits", 2.0f, "TimerCredits");
}

void TimerCredits(string &in asTimer)
{
    StartCredits("credits.ogg", false, "Ending", "MyCredits", -1);
}



RE: Make an end ? - Chilton - 10-05-2010

(10-04-2010, 04:45 PM)locker Wrote: You could try placing in the function void OnStart() a call to add the player entity collide callback function, when collides with an area. In this case, your area name is "MyAreaName". The engine will check if the player collides with the given entity(area) and if does, then the CollideEnd (...) functions is called

Something like this


Code:
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "MyAreaName", "CollideEnd", true, 1);
}

void CollideEnd(string &in asParent, string &in asChild, int alState)
{
    FadeOut(1.0f);
    AddTimer("credits", 2.0f, "TimerCredits");
}

void TimerCredits(string &in asTimer)
{
    StartCredits("credits.ogg", false, "Ending", "MyCredits", -1);
}

This - And maybe use a timer for before the credits roll so you can make an epilogue of some kind


RE: Make an end ? - fantino - 10-05-2010

thank you both! Heart