Frictional Games Forum (read-only)

Full Version: end credits
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how do i end a demo without doing an outro? i just need end credits. im going to be possibly doing an outro for the complete game.
Run the script called StartCredits. Very straight forward.
(01-01-2015, 06:06 AM)Mudbill Wrote: [ -> ]Run the script called StartCredits. Very straight forward.


void OnStart()
{

AddEntityCollideCallback("Player", "Sutior_1", "AreaCollide", true, 1);

PlayMusic("18_amb", true, 5, 2.0, 4, true);

AddEntityCollideCallback("Player", "Script_1", "ActivateStatue", true, 1);

AddEntityCollideCallback("Player", "PlaySound", "Sound", true, 1);

AddUseItemCallback("", "Storage", "StorageDoor", "UseKey", true);

AddEntityCollideCallback("Player", "ActivateDoor", "DoorAppear", true, 1);

}




void UseKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("StorageDoor", false, true);

PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);

RemoveItem("Storage");
}




void DoorAppear(string &in asParent, string &in asChild, int alState)
{

SetEntityActive("StorageDoor", true);

}




void ActivateStatue(string &in asParent, string &in asChild, int alState)
{

SetEntityActive("CreepyStatue", true);

}




void AreaCollide(string &in asParent, string &in asChild, int alState)
{

SetEntityActive("Sutior", true);


AddEnemyPatrolNode("Sutior", "Node_1", 0.001, "");
AddEnemyPatrolNode("Sutior", "Node_5", 0.001, "");
AddEnemyPatrolNode("Sutior", "Node_6", 0.001, "");
AddEnemyPatrolNode("Sutior", "Node_8", 0.001, "");
AddEnemyPatrolNode("Sutior", "Node_10", 0.001, "");
AddEnemyPatrolNode("Sutior", "Node_16", 0.001, "");
AddEnemyPatrolNode("Sutior", "Node_20", 0.001, "");
AddEnemyPatrolNode("Sutior", "Node_26", 0.001, "");

}







void OnEnter()
{



}



void OnLeave()
{

StartDemoEnd();

StartCredits("29_end_amb_soft", true, "Levels", "EndDemoCreits", 2);

}



like this?
I haven't used the StartDemoEnd(); myself, so I don't really know how they work together, but yes, otherwise that should be correct.

There is another detail though. I noticed that if you run the credits script in OnLeave, it will instantly go black and start it if you click a level door. If you'd rather have it fade to black before running the credits, you can add a timer with 0.01 in time and set the level door to load the same map you're currently in. What will happen is that there will be no loading screen when you click it (because the level is already loaded) and the credits will run as soon as the fade out is done (because timers freeze during level transitions).