Frictional Games Forum (read-only)
area for teleport.. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: area for teleport.. (/thread-25568.html)

Pages: 1 2


area for teleport.. - Amnesiaplayer - 06-27-2014

it worked that plank thing Big Grin 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 Sad i saw this on a custom story... (forgot name)


RE: area for teleport.. - DnALANGE - 06-27-2014

Yes that is possible.
I tell you in a small way how to do this :
Make a scriptarea where you fall .
PHP Code:
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 this when you hit the gound : :
PHP Code:
AddEntityCollideCallback("Player", "Hittheground", "ThiswillchangeMap", true, 1); 
-
PHP Code:
    void ThiswillchangeMap(string &in asParent, string &in asChild, int alState)
{
ChangeMap("YOURNEWMAPNAME.map", "PlayerStartArea_???" , "", "");
} 



RE: area for teleport.. - Amnesiaplayer - 06-27-2014

but i'm not gonna fall on ground.. it's just black air...


RE: area for teleport.. - DnALANGE - 06-27-2014

Then make the area AFTER 3 seconds (Below the floor you fall of) Tongue Just test it. make is at least 10 meters lower, just test it out.


RE: area for teleport.. - Amnesiaplayer - 06-27-2014

but where on my script must i type That fadeout ??


RE: area for teleport.. - Mudbill - 06-27-2014

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.


RE: area for teleport.. - Amnesiaplayer - 06-27-2014

PHP Code:
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 :

PHP Code:
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 ?


RE: area for teleport.. - DnALANGE - 06-27-2014

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.


RE: area for teleport.. - Amnesiaplayer - 06-27-2014

thanks , but the teleport thing doesn't work..


RE: area for teleport.. - DnALANGE - 06-27-2014

It looks good so far.
You might have done something like namewing something wrong in the editor?
Does the playuer toutch the area?