| 
		
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| IT WORKS! yay 
 
				Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?
			 
 
				
(This post was last modified: 04-11-2012, 04:01 PM by jessehmusic.)
 |  |  
	| 04-11-2012, 02:29 PM |  |  
	
		| Cranky Old Man   Posting Freak
 
 Posts: 986
 Threads: 20
 Joined: Apr 2012
 Reputation: 
38
 | 
			| RE: Player Respawn on other map 
 
				 (04-11-2012, 02:29 PM)jessehmusic Wrote:  Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue? This question is probably answered in these forums once every week. You can also check out how Frictional Games did it in the chancel/prison map.
			 
 |  |  
	| 04-11-2012, 02:37 PM |  |  
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| RE: Player Respawn on other map 
 
				 (04-11-2012, 02:37 PM)Cranky Old Man Wrote:   (04-11-2012, 02:29 PM)jessehmusic Wrote:  Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?This question is probably answered in these forums once every week. You can also check out how Frictional Games did it in the chancel/prison map. they have to hard script i dont understand them :S 
			 
 |  |  
	| 04-11-2012, 02:37 PM |  |  
	
		| Mackiiboy   Member
 
 Posts: 101
 Threads: 7
 Joined: Jan 2012
 Reputation: 
11
 | 
			| RE: Player Respawn on other map 
 
				 (04-11-2012, 02:29 PM)jessehmusic Wrote:  Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?. 
You can set the player's health to 0 by using: 
void SetPlayerHealth(float afHealth);
 
You can set up a checkpoint that calls a function when you die. Put in a mapchange into that function.
 
void CheckPoint (string& asName, string& asStartPos, string&asCallback, string& asDeathHintCat, string& asDeathHintEntry);
 
Sets a checkpoint at which the player will respawn in case he dies. 
Callback syntax: void MyFunc(string &in asName, int alCount) 
Count is 0 on the first checkpoint load!
asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file
 
AND
 
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
 
Immediatly loads another map.
asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded
 
I can come up with three more possible ways to script this, but using checkpoints is probably the best way. 
			 
				
(This post was last modified: 04-11-2012, 02:52 PM by Mackiiboy.)
 |  |  
	| 04-11-2012, 02:48 PM |  |  
	
		| Stepper321   Senior Member
 
 Posts: 263
 Threads: 26
 Joined: Nov 2011
 Reputation: 
8
 | 
			| RE: Player Respawn on other map 
 
				Well, it's the script you have to use.
			 
 Signature to awesome to be displayed. |  |  
	| 04-11-2012, 02:48 PM |  |  
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| RE: Player Respawn on other map 
 
				 (04-11-2012, 02:48 PM)Mackiiboy Wrote:   (04-11-2012, 02:29 PM)jessehmusic Wrote:  Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?. You can set the player's health to 0 by using:
 void SetPlayerHealth(float afHealth);
 
 You can set up a checkpoint that calls a function when you die. Put in a mapchange into that function.
 
 void CheckPoint (string& asName, string& asStartPos, string&asCallback, string& asDeathHintCat, string& asDeathHintEntry);
 
 Sets a checkpoint at which the player will respawn in case he dies.
 Callback syntax: void MyFunc(string &in asName, int alCount)
 Count is 0 on the first checkpoint load!
 
 asName - the internal name
 asStartPos - the name of the StartPos in the editor
 asCallback - the function to call when the player dies/respawns
 asDeathHintCat - the category of the death hint message to be used in the .lang file
 asDeathHintEntry - the entry in the .lang file
 
 AND
 
 void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
 
 Immediatly loads another map.
 
 asMapName - the file to load
 asStartPos - the name of the StartPos on the next map
 asStartSound - the sound that is played when the change starts
 asEndSound - the sound that is played when the new map is loaded
 whats the callback i should use? 
			 
 |  |  
	| 04-11-2012, 02:50 PM |  |  
	
		| Mackiiboy   Member
 
 Posts: 101
 Threads: 7
 Joined: Jan 2012
 Reputation: 
11
 | 
			| RE: Player Respawn on other map 
 
				 (04-11-2012, 02:50 PM)jessehmusic Wrote:  whats the callback i should use?. 
Callback syntax for checkpoints: void MyFunc(string &in asName, int alCount) 
So you'll have to put your ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); into MyFunc. 
			 |  |  
	| 04-11-2012, 02:54 PM |  |  
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| RE: Player Respawn on other map 
 
				 (04-11-2012, 02:54 PM)Mackiiboy Wrote:   (04-11-2012, 02:50 PM)jessehmusic Wrote:  whats the callback i should use?. Callback syntax for checkpoints: void MyFunc(string &in asName, int alCount)
 So you'll have to put your ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); into MyFunc.
 So the Changemap is the callback ? getting confused ?
			 
 |  |  
	| 04-11-2012, 02:56 PM |  |  
	
		| Mackiiboy   Member
 
 Posts: 101
 Threads: 7
 Joined: Jan 2012
 Reputation: 
11
 | 
			| RE: Player Respawn on other map 
 
				 (04-11-2012, 02:56 PM)jessehmusic Wrote:  So the Changemap is the callback ? getting confused ?. 
MyFunc or whatever you are going to call it is the callback. That function should call the ChangeMap.
. 
void CheckPoint (string& asName, string& asStartPos, string&asCallback , string& asDeathHintCat, string& asDeathHintEntry);
asCallback - the function to call when the player dies/respawns
 
So, when you die, a function will be called, lets call it MyFunc.
 
That function has the callback syntax (string &in asName, int alCount) 
 void MyFunc(string &in asName, int alCount)
 
{ 
// Put everything here that you want to happen after death
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); 
}
			 
				
(This post was last modified: 04-11-2012, 03:08 PM by Mackiiboy.)
 |  |  
	| 04-11-2012, 03:03 PM |  |  
	
		| jessehmusic   Senior Member
 
 Posts: 423
 Threads: 102
 Joined: Dec 2011
 Reputation: 
8
 | 
			| RE: Player Respawn on other map 
 
				 (04-11-2012, 03:03 PM)Mackiiboy Wrote:   (04-11-2012, 02:56 PM)jessehmusic Wrote:  So the Changemap is the callback ? getting confused ?. MyFunc or whatever you are going to call it is the callback. That function should call the ChangeMap.
 .
 void CheckPoint (string& asName, string& asStartPos, string&asCallback, string& asDeathHintCat, string& asDeathHintEntry);
 
 asCallback - the function to call when the player dies/respawns
 
 So, when you die, a function will be called, lets call it MyFunc.
 
 That function has the callback syntax (string &in asName, int alCount)
 
 void MyFunc(string &in asName, int alCount)
 {
 // Put everything here that you want to happen after death
 ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
 }
 okey i got the changemap now but Daniel start looking in the ground and he donst stop any clue?
			 
 |  |  
	| 04-11-2012, 03:16 PM |  |  |