| 
		
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| area for teleport.. 
 
				it worked that plank thing    thanks to you all!  
but now i want to do something to.. 
when yo ufall.. the screen goes black.. and you will teleport to an other MAP ?? 
|(sleeping) is this possible ?! and if it is please tell me how    i saw this on a custom story... (forgot name)
			 |  |  
	| 06-27-2014, 11:29 AM |  |  
	
		| DnALANGE  Banned
 
 Posts: 1,549
 Threads: 73
 Joined: Jan 2012
 | 
			| RE: area for teleport.. 
 
				Yes that is possible. 
I tell you in a small way how to do this : 
Make a scriptarea  where you fall  .
 FadeOut(3);//3 is the speed, so this is 3 seconds till black. 
Then make another AddCollideSCRIPT that looks like this So when you are going to fall add thiswhen you hit the gound :  :  AddEntityCollideCallback("Player", "Hittheground", "ThiswillchangeMap", true, 1); 
-
     void ThiswillchangeMap(string &in asParent, string &in asChild, int alState){
 ChangeMap("YOURNEWMAPNAME.map", "PlayerStartArea_???" , "", "");
 }
 
				
(This post was last modified: 06-27-2014, 12:02 PM by DnALANGE.)
 |  |  
	| 06-27-2014, 11:56 AM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: area for teleport.. 
 
				but i'm not gonna fall on ground.. it's just black air...
			 |  |  
	| 06-27-2014, 12:08 PM |  |  
	
		| DnALANGE  Banned
 
 Posts: 1,549
 Threads: 73
 Joined: Jan 2012
 | 
			| RE: area for teleport.. 
 
				Then make the area AFTER 3 seconds (Below the floor you fall of)    Just test it. make is at least 10 meters lower, just test it out.
			
				
(This post was last modified: 06-27-2014, 12:12 PM by DnALANGE.)
 |  |  
	| 06-27-2014, 12:12 PM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: area for teleport.. 
 
				but where on my script must i type That fadeout ??
			 |  |  
	| 06-27-2014, 12:18 PM |  |  
	
		| Mudbill   Muderator
 
 Posts: 3,881
 Threads: 59
 Joined: Apr 2013
 Reputation: 
179
 | 
			| RE: area for teleport.. 
 
				In the callback that causes you to fall. Think of it as a sequence:
 Break plank > start fade out > fall down > hit ground when screen is black > change map.
 
 You might need to tweak the fade out speed to accommodate your fall's height.
 
 |  |  
	| 06-27-2014, 12:22 PM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: area for teleport.. 
 
				void BoardCreak(string&in asParent, string &in asChild, int alState){
 PlaySoundAtEntity("WoodCreaking", "CREAKINGNOISE.snt", "BreakingArea", 0.5f, false);
 AddTimer("ImFaaaalling", 0.60f, "StartFalling");
 }
 
so i must place the fade out...
 
EDIT : or by the Hittheground ?
 
 
This is my script :
 void OnLeave(){
 
 }
 
 void OnStart()
 {
 AddUseItemCallback("", "sleutel1", "deur1", "UsedKeyOnDoor", true);
 AddEntityCollideCallback("Player", "BreakingArea", "BoardCreak", true, 1);
 AddEntityCollideCallback("Player", "Hittheground", "Teleport", true, 1);
 }
 
 void UsedKeyOnDoor (string &in asItem, string &in asEntity)
 {
 SetSwingDoorLocked("deur1", false, true);
 PlaySoundAtEntity("", "unlock_door.snt", "deur1", 0, false);
 RemoveItem("sleutel1");
 }
 
 void BoardCreak(string&in asParent, string &in asChild, int alState)
 {
 PlaySoundAtEntity("WoodCreaking", "CREAKINGNOISE.snt", "BreakingArea", 0.5f, false);
 AddTimer("ImFaaaalling", 0.60f, "StartFalling");
 }
 
 void StartFalling(string &in asTimer)
 {
 SetPropHealth("Board", 0);
 }
 
 void Teleport(string &in asParent, string &in asChild, int alState)
 {
 ChangeMap("dream.map", "PlayerStartArea_dream" , "", "");
 }
 
is it good ?
			 
				
(This post was last modified: 06-27-2014, 12:39 PM by Amnesiaplayer.)
 |  |  
	| 06-27-2014, 12:25 PM |  |  
	
		| DnALANGE  Banned
 
 Posts: 1,549
 Threads: 73
 Joined: Jan 2012
 | 
			| RE: area for teleport.. 
 
				void StartFalling(string &in asTimer){
 SetPropHealth("Board", 0);
 FadeOut(3);//3 is the speed, so this is 3 seconds till black.
 }
 --
 Add the FadeOut there and you should be good.
 BE AWARE!!!
 On void OnLeave add this : FadeIn(1);
 If you do NOT the enxt map will be pitchblack.
 Or add it on the new map : void OnStart or OnEnter.
 I Always do it on the OnLeave.
 
				
(This post was last modified: 06-27-2014, 12:43 PM by DnALANGE.)
 |  |  
	| 06-27-2014, 12:41 PM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: area for teleport.. 
 
				thanks , but the teleport thing doesn't work..
			 |  |  
	| 06-27-2014, 12:43 PM |  |  
	
		| DnALANGE  Banned
 
 Posts: 1,549
 Threads: 73
 Joined: Jan 2012
 | 
			| RE: area for teleport.. 
 
				It looks good so far.You might have done something like namewing something wrong in the editor?
 Does the playuer toutch the area?
 |  |  
	| 06-27-2014, 12:44 PM |  |  |