Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
area for teleport..
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#1
area for teleport..

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)
06-27-2014, 11:29 AM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
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 .
PHP Code: (Select All)
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: (Select All)
AddEntityCollideCallback("Player""Hittheground""ThiswillchangeMap"true1); 
-
PHP Code: (Select All)
    void ThiswillchangeMap(string &in asParentstring &in asChildint alState)
{
ChangeMap("YOURNEWMAPNAME.map""PlayerStartArea_???" """");

(This post was last modified: 06-27-2014, 12:02 PM by DnALANGE.)
06-27-2014, 11:56 AM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#3
RE: area for teleport..

but i'm not gonna fall on ground.. it's just black air...
06-27-2014, 12:08 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: area for teleport..

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.
(This post was last modified: 06-27-2014, 12:12 PM by DnALANGE.)
06-27-2014, 12:12 PM
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#5
RE: area for teleport..

but where on my script must i type That fadeout ??
06-27-2014, 12:18 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
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
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#7
RE: area for teleport..

PHP Code: (Select All)
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: (Select All)
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 ?
(This post was last modified: 06-27-2014, 12:39 PM by Amnesiaplayer.)
06-27-2014, 12:25 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#8
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
Find
Amnesiaplayer Offline
Senior Member

Posts: 539
Threads: 105
Joined: Jun 2014
Reputation: 0
#9
RE: area for teleport..

thanks , but the teleport thing doesn't work..
06-27-2014, 12:43 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#10
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
Find




Users browsing this thread: 4 Guest(s)