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
Crowbar/Key Script Problem
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: Crowbar/Key Script Problem

I'm going to assume that the key is not working on the door, and the crowbar is not properly prying the door open.
Regardless, this should fix your problems.

Spoiler below!

void OnStart()
{
AddUseItemCallback("", "crowbar_1", "Storage", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
AddUseItemCallback("", "Waterworks_Key", "Waterworks_Door", "UsedKeyOnDoor", true);
}

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

void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "Player", 0, false);
SetEntityActive("crowbar_joint_1", 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("Storage", false, true);
AddPropImpulse("Storage", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("Storage", true);
SetSwingDoorClosed("Storage", false, false);
SetMoveObjectState("Storage", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Waterworks_Door", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);
RemoveItem("Waterworks_Key");
}


RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
(This post was last modified: 09-12-2012, 05:48 PM by Tomato Cat.)
09-12-2012, 04:29 PM
Find


Messages In This Thread
Crowbar/Key Script Problem - by wagiwombledog - 09-12-2012, 05:42 AM
RE: Crowbar/Key Script Problem - by Tomato Cat - 09-12-2012, 04:29 PM
RE: Crowbar/Key Script Problem - by The chaser - 09-12-2012, 05:00 PM
RE: Crowbar/Key Script Problem - by Tomato Cat - 09-12-2012, 05:49 PM
RE: Crowbar/Key Script Problem - by wagiwombledog - 09-12-2012, 08:01 PM



Users browsing this thread: 1 Guest(s)