fantino
Junior Member
Posts: 14
Threads: 2
Joined: Sep 2010
Reputation:
0
|
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!
|
|
10-04-2010, 10:54 AM |
|
locker
Junior Member
Posts: 14
Threads: 1
Joined: Sep 2010
Reputation:
0
|
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 |
|
Chilton
Member
Posts: 138
Threads: 9
Joined: Sep 2010
Reputation:
0
|
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 |
|
fantino
Junior Member
Posts: 14
Threads: 2
Joined: Sep 2010
Reputation:
0
|
RE: Make an end ?
thank you both!
|
|
10-05-2010, 03:33 PM |
|
|