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
#21
RE: Basic Elevator

(06-23-2012, 08:35 PM)CrazyArts Wrote: Where do i put

SetEntityPlayerInteractCallback("NAME OF THE BUTTON", "Interaction", false);
I put it already on it's right position, but you need to change the buttons name.
(The button -> when you press it, the player fades out and teleports)

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

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

The script is fixed, i guess, but i can't test it out cause i get this fatal error: unexpected token {

it's under void Interaction(string &in entity);

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

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

You even pasted the error xD
the function name line shouldn't have a finishing ;
06-23-2012, 08:46 PM
Find
Unearthlybrutal Offline
Posting Freak

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

Now it should work Smile

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);


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

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

void FadeInFunction(string &in asParent, string &in asChild, int alState)
{
FadeIn(20);
}
// (string &in asEntity) instead of (string &in entity)
void Interaction(string &in asEntity)
{
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
(This post was last modified: 06-23-2012, 08:48 PM by Unearthlybrutal.)
06-23-2012, 08:48 PM
Website Find
MaZiCUT Offline
Senior Member

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

I still get the same error, i really appreciate everyone trying to help me but i don't know what's causing this random fatal error!!?!?!! THIS IS MADNESS (lol)


Anyways the { token under the function has no reason to be unexpected.. damn Sad

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

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

Heck, paste the whole script again, I have no idea what you have fixed by now Tongue
06-23-2012, 08:52 PM
Find
MaZiCUT Offline
Senior Member

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

The whole script as of now:


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);
SetEntityPlayerInteractCallback("ButtonTeleport", "Interaction", false);
}

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

void FadeInFunction(string &in asParent, string &in asChild, int alState)
{
FadeIn(20);
}

void Interaction(string &in asEntity);
{
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()
{

}

Hi.
06-23-2012, 08:54 PM
Website Find
Unearthlybrutal Offline
Posting Freak

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

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);
SetEntityPlayerInteractCallback("ButtonTeleport", "Interaction", false);
}

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

void FadeInFunction(string &in asParent, string &in asChild, int alState)
{
FadeIn(20);
}

void Interaction(string &in asEntity)
{
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()
{

}

Working?

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

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

This one should work. Basically, I changed some function syntaxes, and most importantly, you got a ; at 1 of the function name lines, which shouldn't be there. I'll just paste the whole thing again:
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);
SetEntityPlayerInteractCallback("ButtonTeleport", "Interaction", false);
}

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

void FadeInFunction(string &in asParent, string &in asChild, int alState)
{
FadeIn(20);
}

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

void FadeInElevator(string &in AsTimer)
{
FadeIn(3);
}
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 asItem, string &in asEntity)
{
SetSwingDoorLocked("RoomDoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "RoomDoor", 0, false);
RemoveItem("Room_Key");
}

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

void OnEnter()
{

}
void OnLeave()
{
}
(This post was last modified: 06-23-2012, 09:06 PM by Cruzore.)
06-23-2012, 09:00 PM
Find
MaZiCUT Offline
Senior Member

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

Oh my god i don't know how you did it but you did it!!!

(I used Unearthlybrutals fixed one)


Now the only problem is, everything's working but when i press that above button that's going to teleport me: i hear the sound i put there and all and he fades out as should, but he never fades in for some reason.

Hi.
(This post was last modified: 06-23-2012, 09:02 PM by MaZiCUT.)
06-23-2012, 09:02 PM
Website Find




Users browsing this thread: 1 Guest(s)