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
Make an end ?
fantino Offline
Junior Member

Posts: 14
Threads: 2
Joined: Sep 2010
Reputation: 0
#1
Make an end ?

Hi everyone.

I'm trying to make an end to my level but I don't know how. I built an area and wrote
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
10-04-2010, 10:54 AM
Find
locker Offline
Junior Member

Posts: 14
Threads: 1
Joined: Sep 2010
Reputation: 0
#2
RE: Make an end ?

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


// 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);
}
10-04-2010, 04:45 PM
Find
Chilton Offline
Member

Posts: 138
Threads: 9
Joined: Sep 2010
Reputation: 0
#3
RE: Make an end ?

(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


// 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
10-05-2010, 03:05 AM
Find
fantino Offline
Junior Member

Posts: 14
Threads: 2
Joined: Sep 2010
Reputation: 0
#4
RE: Make an end ?

thank you both! Heart
10-05-2010, 03:33 PM
Find




Users browsing this thread: 1 Guest(s)