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
Script Help Teleportation!
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#9
RE: Teleportation!

void OnStart()
{
AddUseItemCallback("", "key_laboratory_1", "mansion_8", "OpenDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_2", "Falling", true, 1);
AddEntityCollideCallback("Player", "MorgueInsanity", "MorgueDoorClose", true, 1);
AddEntityCollideCallback("Player", "SkullFall", "FallingSkull", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "PlaySound1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "FloorFall1", true, 1);
}




void OpenDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}
void Falling(string &in asParent, string &in asChild, int alState)
{
AddPropForce("box_1", 0, 0, -2000, "world");
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
GiveSanityDamage(6.0f, true);
}
void MorgueDoorClose(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
SetSwingDoorLocked("door_red_1", true, true);
SetSwingDoorClosed("door_red_1", true, true);
}
void FallingSkull(string &in asParent, string &in asChild, int alState)
{
AddPropForce("lab_cryo_head_1", 1800, 0, 0, "world");
SetPlayerActive(false);
GiveSanityDamage(6.0f, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
AddTimer("", 1.0f, "lookatskull");
}
void lookatskull(string &in asTimer)
{
StartPlayerLookAt("lab_cryo_head_1", 10.0f, 10.0f, "");
AddTimer("", 1.0f, "skulllook");
}
void skulllook(string &in asTimer)
{
StartPlayerLookAt("corpse_male_torso_1", 10.0f, 10.0f, "");
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
AddTimer("", 0.5f, "stoplook");
}
void stoplook(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}
void PlaySound1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "00_faint.snt", "Player", 0, false);
}
void FloorFall1(string &in asParent, string &in asChild, int alState)
{
TeleportPlayer("PlayerStartArea_2");
}
void OnEnter()
{
}

void OnLeave()
{
}

Fixed.

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-12-2013, 01:17 AM
Find


Messages In This Thread
Teleportation! - by VillainousPotato - 05-12-2013, 12:10 AM
RE: Teleportation! - by Daemian - 05-12-2013, 12:24 AM
RE: Teleportation! - by VillainousPotato - 05-12-2013, 12:30 AM
RE: Teleportation! - by Streetboat - 05-12-2013, 12:41 AM
RE: Teleportation! - by PutraenusAlivius - 05-12-2013, 12:49 AM
RE: Teleportation! - by VillainousPotato - 05-12-2013, 12:58 AM
RE: Teleportation! - by PutraenusAlivius - 05-12-2013, 01:02 AM
RE: Teleportation! - by VillainousPotato - 05-12-2013, 01:09 AM
RE: Teleportation! - by PutraenusAlivius - 05-12-2013, 01:17 AM
RE: Teleportation! - by VillainousPotato - 05-12-2013, 01:21 AM



Users browsing this thread: 1 Guest(s)