| 
		
	
		| i3670   Posting Freak
 
 Posts: 1,308
 Threads: 74
 Joined: Oct 2011
 Reputation: 
36
 | 
			| Ending map with a note 
 
				I'm want my credits to start and my map to end when I pick up a note.
 Any suggestion on script?
 
 
 
 
 Found some threads about starting your credits, but none (what I could find) that said anything about notes.
 
 |  |  
	| 10-17-2011, 05:17 PM |  |  
	
		| Elven   Posting Freak
 
 Posts: 862
 Threads: 37
 Joined: Aug 2011
 Reputation: 
26
 | 
			| RE: Ending map with a note 
 
				void SetEntityCallbackFunc(string& asName, string& asCallback);Calls a function when the player interacts with a certain entity.
 Callback syntax: void MyFunc(string &in asEntity, string &in type)
 Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc
and void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);Starts the end credits screen.    asMusic - the music to play (including .ogg)
 abLoopMusic - determines whether the music should loop
 asTextCat - the category to be used in the .lang file (must be “Ending”)
 asTextEntry - the entry in the .lang file (must be “MainCredits”)
 alEndNum - Amnesia has 3 different endings and displays a code  at the bottom. Determines which code is displayed. 0-2 will display  codes, any other integer will not.
  
 |  |  
	| 10-17-2011, 05:38 PM |  |  
	
		| schmupper   Junior Member
 
 Posts: 23
 Threads: 1
 Joined: Aug 2011
 Reputation: 
2
 | 
			| RE: Ending map with a note 
 
				Think you could use this one: void SetEntityCallbackFunc(string& asName, string& asCallback);Calls a function when the player interacts with a certain entity.
 Callback syntax: void MyFunc(string &in asEntity, string &in type)
 Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc
And in the MyFunc; 
 void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);Starts the end credits screen.    asMusic - the music to play (including .ogg)
 abLoopMusic - determines whether the music should loop
 asTextCat - the category to be used in the .lang file (must be “Ending”)
 asTextEntry - the entry in the .lang file (must be “MainCredits”)
 alEndNum - Amnesia has 3 different endings and displays a code  at the bottom. Determines which code is displayed. 0-2 will display  codes, any other integer will not.
 ''Oh. My. God. He's DEAD. Quickly, if he hasnt started to smell, give him the kiss of life!''
 Clarence - The monkey hater
 |  |  
	| 10-17-2011, 05:38 PM |  |  
	
		| i3670   Posting Freak
 
 Posts: 1,308
 Threads: 74
 Joined: Oct 2011
 Reputation: 
36
 | 
			| RE: Ending map with a note 
 
				Can you put that in the: 
OnStart()
 
Will make it easier to understand    |  |  
	| 10-17-2011, 05:59 PM |  |  
	
		| schmupper   Junior Member
 
 Posts: 23
 Threads: 1
 Joined: Aug 2011
 Reputation: 
2
 | 
			| RE: Ending map with a note 
 
				void OnStart(){
 
 SetEntityCallbackFunc(string& asName, string& asCallback);
 
 }
 
 void MyFunc(string &in asEntity, string &in type)
 {
 
 StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
 
 }
 
 ''Oh. My. God. He's DEAD. Quickly, if he hasnt started to smell, give him the kiss of life!''
 Clarence - The monkey hater
 |  |  
	| 10-17-2011, 09:10 PM |  |  
	
		| A Tricky Carnie   Member
 
 Posts: 72
 Threads: 15
 Joined: Sep 2011
 Reputation: 
0
 | 
			| RE: Ending map with a note 
 
				I did that on one of my maps, it went like this: Quote:{SetEntityPlayerInteractCallback("note_4", "Note_mapchanger", true);
 }
 void Note_mapchanger(string &in asEntity)
 {
 ChangeMap("map6.map", "PlayerStartArea_1", "", "");}
 |  |  
	| 10-18-2011, 08:50 PM |  |  |