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 ON DOOR HELP
megsb927 Offline
Junior Member

Posts: 30
Threads: 10
Joined: Feb 2013
Reputation: 0
#1
Rainbow  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()
{

}
04-13-2013, 02:55 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: CROWBAR ON DOOR HELP

Your TimerSwitchShovel had the wrong perimeters. Replace it with this;
PHP Code: (Select All)
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt"""0false);
SetEntityActive("crowbar_joint_1"true);


EDIT:
I'mma ninja!

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 04-13-2013, 04:31 AM by PutraenusAlivius.)
04-13-2013, 04:22 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#3
RE: CROWBAR ON DOOR HELP

Edit: once again, JustAnotherPlayer beats me to it xD though I would have been a while testing it

Well, the first thing I would do is add Debug Messages to your code, so you can find out exactly where the stuff is going wrong. I'll run this code and test it myself in my CS, coz I need it now anyways Tongue

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 04-13-2013, 04:25 AM by Romulator.)
04-13-2013, 04:25 AM
Find




Users browsing this thread: 1 Guest(s)