Frictional Games Forum (read-only)

Full Version: area for teleport..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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)
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"true1); 
-
PHP Code:
    void ThiswillchangeMap(string &in asParentstring &in asChildint alState)
{
ChangeMap("YOURNEWMAPNAME.map""PlayerStartArea_???" """");

but i'm not gonna fall on ground.. it's just black air...
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.
but where on my script must i type That fadeout ??
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.
PHP Code:
void BoardCreak(string&in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("WoodCreaking""CREAKINGNOISE.snt""BreakingArea"0.5ffalse);
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"true1);
AddEntityCollideCallback("Player""Hittheground""Teleport"true1); 
}

void UsedKeyOnDoor (string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("deur1"falsetrue); 
PlaySoundAtEntity("""unlock_door.snt""deur1"0false);
RemoveItem("sleutel1");


void BoardCreak(string&in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("WoodCreaking""CREAKINGNOISE.snt""BreakingArea"0.5ffalse);
AddTimer("ImFaaaalling"0.60f"StartFalling");
}

void StartFalling(string &in asTimer)
{
SetPropHealth("Board"0);


void Teleport(string &in asParentstring &in asChildint alState)
{
ChangeMap("dream.map""PlayerStartArea_dream" """");

is it good ?
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.
thanks , but the teleport thing doesn't work..
It looks good so far.
You might have done something like namewing something wrong in the editor?
Does the playuer toutch the area?
Pages: 1 2