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
end credits
G510s Offline
Banned

Posts: 58
Threads: 32
Joined: Jun 2014
#1
end credits

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.
01-01-2015, 01:19 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: end credits

Run the script called StartCredits. Very straight forward.

01-01-2015, 06:06 AM
Find
G510s Offline
Banned

Posts: 58
Threads: 32
Joined: Jun 2014
#3
RE: end credits

(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?
01-01-2015, 06:32 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: end credits

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).

(This post was last modified: 01-01-2015, 06:38 AM by Mudbill.)
01-01-2015, 06:37 AM
Find




Users browsing this thread: 2 Guest(s)