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 My locked door doesn't display a message?
KingCrimson Offline
Junior Member

Posts: 45
Threads: 14
Joined: Jul 2012
Reputation: 0
#3
RE: My locked door doesn't display a message?

You mean the map's script? If so, here it is:

Quote:////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "secret1", "door3", "unlock", true);

AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);

AddUseItemCallback("", "crowbar1", "crowdoor", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar2", "area1", "CollideAreaBreakDoor", true, 1);

SetEntityActive("crowbar_broken", true);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", 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 unlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar1");
}


void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar2", true);
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("crowdoor", false, true);
AddPropImpulse("crowdoor", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("crowdoor", true);
SetSwingDoorClosed("crowdoor", false, false);
SetMoveObjectState("crowdoor", 1);
PlaySoundAtEntity("","break_wood_metal", "area2", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "area2", false);
SetEntityActive("crowbar2", false);
SetLocalVarInt("Door", 1);
}

void lockedoor(string &in entity)

{
if(GetSwingDoorLocked("locked1") == true)
{

SetMessage("Messages", "Broken", 0);

}
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

Current Projects:
DADDY - 10%
07-08-2012, 04:36 AM
Find


Messages In This Thread
RE: My locked door doesn't display a message? - by KingCrimson - 07-08-2012, 04:36 AM



Users browsing this thread: 1 Guest(s)