| 
		
	
		| JetlinerX   Senior Member
 
 Posts: 599
 Threads: 49
 Joined: Jun 2011
 Reputation: 
19
 | 
			| Force Credits Help! 
 
				Hey all- 
Just wondering how I can get the credits to start rolling on my script, it seems all it does is fade to black and you hear Danial breathing, but I need the credits to start rolling when its faded out.  Here is my script:
 void OnEnter (){
 AddEntityCollideCallback("Player", "ScriptArea_1", "FirstScriptArea", true, 1);
 AddEntityCollideCallback("Player", "ScriptArea_2", "SecondScriptArea", true, 1);
 AddEntityCollideCallback("Player", "ScriptArea_3", "ThirdScriptArea", true, 1);
 AddEntityCollideCallback("Player", "ScriptArea_4", "LastScriptArea", true, 1);
 }
 void FirstScriptArea(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "DerrekMother", 0);
 SetPlayerMoveSpeedMul(0.5f);
 SetPlayerJumpDisabled(true);
 SetPlayerCrouchDisabled(true);
 PlayMusic("EndFile1.ogg", false, 20, 0, 0, true);
 }
 void SecondScriptArea(string &in asParent, string &in asChild, int alState)
 {
 StartEffectFlash(0.1f, 1.0f, 0.1f);
 SetEntityActive("ScriptArea_4", true);
 SetEntityActive("armour_nice_complete_4", true);
 SetEntityActive("armour_nice_complete_5", true);
 SetEntityActive("armour_nice_complete_6", true);
 SetEntityActive("armour_nice_complete_3", false);
 SetEntityActive("armour_nice_complete_1", false);
 SetEntityActive("armour_nice_complete_2", false);
 }
 void ThirdScriptArea(string &in asParent, string &in asChild, int alState)
 {
 AddPropHealth("final_door", -100);
 PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
 GiveSanityDamage(100, true);
 AddPlayerBodyForce(-55000, 25000, 0, false);
 FadePlayerRollTo(75, 5, 2);
 StartPlayerLookAt("display_1", 10, 10, "");
 SetPlayerCrouching(true);
 GivePlayerDamage(10, "BloodSplat", false, false);
 PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
 }
 void LastScriptArea(string &in asParent, string &in asChild, int alState)
 {
 FadePlayerRollTo(75, 5, 2);
 StartPlayerLookAt("display_1", 10, 10, "");
 SetPlayerCrouching(true);
 PlayMusic("EndFile2.ogg", false, 20, 0, 0, true);
 FadeOut(5);
 }
 void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
 {
 StartCredits("THEATTICSONG.ogg" , true , "Endcredits" , "Credittext" , 1);
 }
 void OnLeave ()
 {
 
 }
 
				
(This post was last modified: 08-22-2011, 06:02 AM by JetlinerX.)
 |  |  
	| 08-22-2011, 04:41 AM |  |  
	
		| Obliviator27   Posting Freak
 
 Posts: 792
 Threads: 10
 Joined: Jul 2011
 Reputation: 
66
 | 
			| RE: Force Credits Help! 
 
				void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);{
 StartCredits("THEATTICSONG.ogg" , true , "Endcredits" , "Credittext" , 1);
 }
 
 You lack a function that calls this callback, as well as using the function parameters incorrectly.
 |  |  
	| 08-22-2011, 05:34 AM |  |  
	
		| JetlinerX   Senior Member
 
 Posts: 599
 Threads: 49
 Joined: Jun 2011
 Reputation: 
19
 | 
			| RE: Force Credits Help! 
 
				No, the perimeters are right, because they work if they are in the other function, but what is the callback for starting credits?
			 
 |  |  
	| 08-22-2011, 05:36 AM |  |  
	
		| Obliviator27   Posting Freak
 
 Posts: 792
 Threads: 10
 Joined: Jul 2011
 Reputation: 
66
 | 
			| RE: Force Credits Help! 
 
				No, I mean, you need something along the lines of
 AddEntityCollideCallback("Player", "CreditArea", "StartCredits", 1, true);
 
 void StartCredits(string &in asParent, string &in asChild, int alState)
 {
 StartCredits("THEATTICSONG.ogg", true, "Endcredits", "Credittext", 1);
 }
 
 But perhaps I'm wrong. I've not played around with the credits as of yet. It's just what I see.
 
				
(This post was last modified: 08-22-2011, 05:42 AM by Obliviator27.)
 |  |  
	| 08-22-2011, 05:42 AM |  |  
	
		| JetlinerX   Senior Member
 
 Posts: 599
 Threads: 49
 Joined: Jun 2011
 Reputation: 
19
 | 
			| RE: Force Credits Help! 
 
				Dang it!  Is there any way to do it at the end of the fade?  I dont really want the player to get up and have to walk into another area...
			 
 |  |  
	| 08-22-2011, 05:44 AM |  |  
	
		| Obliviator27   Posting Freak
 
 Posts: 792
 Threads: 10
 Joined: Jul 2011
 Reputation: 
66
 | 
			| RE: Force Credits Help! 
 
				Try adding in StartCredits(); in LastScriptArea. I'm not sure if it'll work for sure, though.Also, change it up to void StartCredits()
 
 This is all guesswork, though.
 
				
(This post was last modified: 08-22-2011, 05:47 AM by Obliviator27.)
 |  |  
	| 08-22-2011, 05:46 AM |  |  
	
		| JetlinerX   Senior Member
 
 Posts: 599
 Threads: 49
 Joined: Jun 2011
 Reputation: 
19
 | 
			| RE: Force Credits Help! 
 
				 (08-22-2011, 05:46 AM)Obliviator27 Wrote:  Try adding in StartCredits(); in LastScriptArea. I'm not sure if it'll work for sure, though.Also, change it up to void StartCredits()
 
 This is all guesswork, though.
 
Tested that before (without void) and it starts the credits the second the player enters the area :/
 
EDIT:  Oh DUH!  I can use a timer xD
 
Sorry bout that!
			 
 
				
(This post was last modified: 08-22-2011, 06:02 AM by JetlinerX.)
 |  |  
	| 08-22-2011, 05:49 AM |  |  |