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
Basic Elevator
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#11
RE: Basic Elevator

void TeleportPlayer(string &in entity)
{
TeleportPlayer("StartPos2")
FadeOut(0);
}


Yes, the player fades out instantly. I edited the script a little bit. If it doesn't work, post your full script here and I will fix it Smile

When Life No Longer Exists
Full-conversion mod
(This post was last modified: 06-23-2012, 08:00 PM by Unearthlybrutal.)
06-23-2012, 08:00 PM
Website Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#12
RE: Basic Elevator

Forgot the ; at TeleportPlayer, we both made the same mistake Smile
06-23-2012, 08:03 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#13
RE: Basic Elevator

(06-23-2012, 08:03 PM)FastHunteR Wrote: Forgot the ; at TeleportPlayer, we both made the same mistake Smile
Ooops Angel

When Life No Longer Exists
Full-conversion mod
06-23-2012, 08:04 PM
Website Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#14
RE: Basic Elevator

Unexpected token { at line 40,1

Even though it seems allright..


void OnStart()
{
AddUseItemCallback("", "Room_Key", "RoomDoor", "RoomOpened", true);
AddEntityCollideCallback("Player", "ClosetShut", "ClosetShutFunc", true, 1);
AddEntityCollideCallback("Player", "EasterEggOpen", "EasterEggFunc", true, 1);
AddEntityCollideCallback("Player", "EasterEggActive", "EasterEggFunction", true, 1);
AddEntityCollideCallback("Player", "FadeIn", "FadeInFunction", true, 1);
PlayMusic("Ambient_Ghost",true,1,0,0,false);

FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last

ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

void ButtonDownMessage(string &in entity)
{
SetMessage("Messages", "ElevatorDown", 0);
}

void FadeInFunction()
{
FadeIn(20);
}

void TeleportPlayer(string &in entity);
{
TeleportPlayer("StartElevator");
FadeOut(0);
PlaySoundAtEntity("", "14_elevator_activate.snt", "Player", 0, true);
}

void EasterEggFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("EasterEggOpen", true);
}

void ClosetShutFunc(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("ExorcistCloset", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(55.0f, true);
}

void EasterEggFunc(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("EasterEggDoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
}

void RoomOpened(string &in item, string &in door)
{
SetSwingDoorLocked("RoomDoor", false, true);
PlaySoundAtEntity("", "unlock_door", "RoomDoor", 0, false);
RemoveItem("Room_Key");
}

void RoomMessage(string &in entity)
{
if(GetSwingDoorLocked("RoomDoor") == true)
{
SetMessage("Messages", "RoomMSG", 0);
}
}

void OnEnter()
{

}

void OnLeave()
{

}

By the way line 1 is void OnStart() and line 40 is {

Hi.
(This post was last modified: 06-23-2012, 08:23 PM by MaZiCUT.)
06-23-2012, 08:11 PM
Website Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#15
RE: Basic Elevator

void TeleportPlayer(string &in entity);
{
TeleportPlayer("StartElevator");
FadeOut(0);
PlaySoundAtEntity("", "14_elevator_activate.snt", "Player", 0, true);
}
a ; at the initiation of the function where there shouldn't be
06-23-2012, 08:28 PM
Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#16
RE: Basic Elevator

(06-23-2012, 08:28 PM)FastHunteR Wrote: void TeleportPlayer(string &in entity);
{
TeleportPlayer("StartElevator");
FadeOut(0);
PlaySoundAtEntity("", "14_elevator_activate.snt", "Player", 0, true);
}
a ; at the initiation of the function where there shouldn't be
i did that alredy

i'm having troubble with the fatal error

Hi.
(This post was last modified: 06-23-2012, 08:31 PM by MaZiCUT.)
06-23-2012, 08:29 PM
Website Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#17
RE: Basic Elevator

I edited and changed the script:
Spoiler below!



void OnStart()
{
AddUseItemCallback("", "Room_Key", "RoomDoor", "RoomOpened", true);
AddEntityCollideCallback("Player", "ClosetShut", "ClosetShutFunc", true, 1);
AddEntityCollideCallback("Player", "EasterEggOpen", "EasterEggFunc", true, 1);
AddEntityCollideCallback("Player", "EasterEggActive", "EasterEggFunction", true, 1);
AddEntityCollideCallback("Player", "FadeIn", "FadeInFunction", true, 1);
PlayMusic("Ambient_Ghost",true,1,0,0,false);


FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last


ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);


// Take care of this
SetEntityPlayerInteractCallback("NAME OF THE BUTTON", "Interaction", false);
}


void ButtonDownMessage(string &in entity)
{
SetMessage("Messages", "ElevatorDown", 0);
}


// You didn't have the syntax
void FadeInFunction(string &in asParent, string &in asChild, int alState)
{
FadeIn(20);
}


void Interaction(string &in entity);
{
TeleportPlayer("StartElevator");
FadeOut(0);
PlaySoundAtEntity("", "14_elevator_activate.snt", "Player", 0, true);
}


void EasterEggFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("EasterEggOpen", true);
}


void ClosetShutFunc(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("ExorcistCloset", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(55.0f, true);
}


void EasterEggFunc(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("EasterEggDoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
}


void RoomOpened(string &in item, string &in door)
{
SetSwingDoorLocked("RoomDoor", false, true);
PlaySoundAtEntity("", "unlock_door", "RoomDoor", 0, false);
RemoveItem("Room_Key");
}


void RoomMessage(string &in entity)
{
if(GetSwingDoorLocked("RoomDoor") == true)
{
SetMessage("Messages", "RoomMSG", 0);
}
}


void OnEnter()
{


}


void OnLeave()
{


}




When Life No Longer Exists
Full-conversion mod
06-23-2012, 08:31 PM
Website Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#18
RE: Basic Elevator

Where do i put

SetEntityPlayerInteractCallback("NAME OF THE BUTTON", "Interaction", false);

Hi.
06-23-2012, 08:35 PM
Website Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#19
RE: Basic Elevator

You put it nowhere, you change the name of the button, as it says.
06-23-2012, 08:37 PM
Find
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#20
RE: Basic Elevator

(06-23-2012, 08:37 PM)FastHunteR Wrote: You put it nowhere, you change the name of the button, as it says.
Why do i have to change the name of the button? Don't you mean the PlayerInteractCallback to Interaction?

Hi.
06-23-2012, 08:38 PM
Website Find




Users browsing this thread: 3 Guest(s)