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
#1
Level door issue

Hey everyone!

As I was scripting and doing the last touches on my map, I wanted to create a level door to my next map.

*Le Twitchez does a some searches and finds out he has to go to the level door, enter the "Entity" tab and just
enter the .map file he wanted it to lead to. It would be easy they said, just do that and add the Player_start areas they said...

Well it almost worked out. I have a fully functional "UsedKeyOnDoor" function as I heard people here describe it. But after I try to click it when I unlocked my door, it just doesnt work. If you have any things that could explain this (expect that I "misspelled" the other maps name), please write Smile

// Best Regards,
Twitchez
03-25-2012, 02:35 PM
Find
pandasFTW Offline
Member

Posts: 71
Threads: 21
Joined: Feb 2012
Reputation: 2
#2
RE: Level door issue

there could be quite some problems with what you described there, can you send me your .hps file, either in PM or over this topic? then i,ll try my best to help Smile
03-25-2012, 02:48 PM
Find
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
pandasFTW Offline
Member

Posts: 71
Threads: 21
Joined: Feb 2012
Reputation: 2
#4
RE: Level door issue

ah i found the problem, it was a LEVELdoor you wanted to unlock with a key wasnt it? if it was, then it shouldent be
"setswingdoorlocked"
when its a level door, it is supposed to be

"SetLevelDoorLocked"
Big Grin you are welcome to reply back if this didnt work, but keep in mind, the " setswingdoorclosed " is right, for standard doors, the " SetLevelDoorLocked" is only for level doors Smile


(03-25-2012, 02:57 PM)pandasFTW Wrote: ah i found the problem, it was a LEVELdoor you wanted to unlock with a key wasnt it? if it was, then it shouldent be
"setswingdoorlocked"
when its a level door, it is supposed to be

"SetLevelDoorLocked"
Big Grin you are welcome to reply back if this didnt work, but keep in mind, the " setswingdoorclosed " is right, for standard doors, the " SetLevelDoorLocked" is only for level doors Smile

lol i made a typo, it was suppsed to be
" keep in mind the " setswingdoorlocked "
haha sorry Big Grin
(This post was last modified: 03-25-2012, 03:05 PM by pandasFTW.)
03-25-2012, 02:57 PM
Find
Twitchez Offline
Member

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

Thanks man Smile Really helped me out!

//Thread closed
03-25-2012, 03:54 PM
Find




Users browsing this thread: 2 Guest(s)