CROWBAR ON DOOR HELP
ok so I followed the frictional games wiki tutorial and I checked my script a bunch of times and it all looks fine and the script areas are named the same as in the tutorial. Script area 1 tall and skinny next to door, script area 2 short and chubby on ground like in the pictures. The problem is when I try to open the door, I click the crowbar to the door, and then the crowbar just disappears, and the crowbar joint doesn't appear so that I can pull it and open the door. I seriously don't know what the problem is.
main crowbar to open door: crowbar_1
joint: crowbar_joint_1
door using crowbar on: castle_1
The script areas are the same as tutorial
SCRIPT**:
void OnStart()
{
AddUseItemCallback("", "Key5", "castle_3", "UsedKeyOnDoor3", true);
AddUseItemCallback("", "crowbar_1", "castle_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}
void UsedKeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_3", false, false);
PlaySoundAtEntity("", "unlock_door", "castle_3", 0, false);
RemoveItem("Key5");
}
void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}
void TimerSwitchShovel(string &in asTimer)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("castle_1", false, true);
AddPropImpulse("castle_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("castle_1", true);
SetSwingDoorClosed("castle_1", false, false);
SetMoveObjectState("castle_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_3", false, false);
PlaySoundAtEntity("", "unlock_door", "castle_2", 0, false);
RemoveItem("Key5");
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_2", false, false);
PlaySoundAtEntity("", "unlock_door", "castle_2", 0, false);
RemoveItem("Key5");
}
void OnEnter()
{
}
void OnLeave()
{
}
|