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
Level door issue
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#3
RE: Level door issue

Sure Smile Here you go, included everything just to be sure of no collision.


////////////////////////////
// Run first time starting map
void OnStart()
{
wakeUp();
PlayGuiSound("break_wood1.ogg", 1);
PlayGuiSound("general_thunder1.ogg", 1);
SetPlayerLampOil(0);
PlayMusic("react_breath1",false,100.0f,0.0f,1,false);
AddUseItemCallback("", "key_classroom_1", "classroom_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_out1", "level_wood_1", "KeyOnDoor_1", true);
AddEntityCollideCallback("Player", "Screamarea_1", "Get_Scared", true, 1);
AddEntityCollideCallback("Player", "Screamarea_2", "Stop_Scared", true, 1);
SetEntityPlayerInteractCallback("key_classroom_1", "func_slam", true);
SetPlayerSanity(15);
}

void TimerDoneLookAt(string &in asTimer)
{
StopPlayerLookAt();
}

void DoorLockedPlayer(string &in entity)
{
SetMessage("Messages", "msgname", 0);
}

void DoorLockedPlayer_1(string &in entity)
{
SetMessage("Messages", "msgname_1", 0);
}

void func_slam(string &in asEntity)
{
SetSwingDoorClosed("classroom_2", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void Get_Scared(string &in asParent, string &in asChild, int alState)
{
PlayMusic("00_laugh.ogg", false, 3.0, 0.0, 0, true);
SetPlayerActive(false);
StartPlayerLookAt("AreaLookAt", 2, 2, "");
AddTimer("look01", 2.5f, "AreaLookAt");
SetPlayerActive(true);
}

void Stop_Scared(string &in asParent, string &in asChild, int alState)
{
StopPlayerLookAt();
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("classroom_1", false, true);
PlaySoundAtEntity("", "unlock_door", "classroom_1", 0, false);
RemoveItem("key_classroom_1");
}

void KeyOnDoor_1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_wood_1", false, true);
PlaySoundAtEntity("", "unlock_door", "level_wood_1", 0, false);
RemoveItem("key_out1");
}


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

void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("09_amb_safe.ogg", true, 0.7f, 1, 0, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
03-25-2012, 02:53 PM
Find


Messages In This Thread
Level door issue - by Twitchez - 03-25-2012, 02:35 PM
RE: Level door issue - by pandasFTW - 03-25-2012, 02:48 PM
RE: Level door issue - by Twitchez - 03-25-2012, 02:53 PM
RE: Level door issue - by pandasFTW - 03-25-2012, 02:57 PM
RE: Level door issue - by Twitchez - 03-25-2012, 03:54 PM



Users browsing this thread: 2 Guest(s)