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
Breaking down door with rock
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Breaking down door with rock

I'm trying to find a way to break down a door by throwing a rock at it but can't seem to find a viable way to do it.

My first approach was to use a script area that activates when the rock enters it, with the only problem being that the script will also activate if you just touch the door with the rock.

My second approach was to reduce the health of the door very low, but even a Health of 1 doesn't affect anything. The door still remains sturdy when you slam it with a heavy rock.

03-30-2012, 02:12 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Breaking down door with rock

Doors can't be broken through force. You have to change its type to one that can.

Tutorials: From Noob to Pro
03-30-2012, 02:27 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: Breaking down door with rock

void OnStart()
{
AddEntityCollideCallback("rock, "door", "doorbrake", true, 1);
}

void doorbrake(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door', 0.0f);
}

This only applies to a door that can break.

03-30-2012, 02:52 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#4
RE: Breaking down door with rock

Like I said before, that script will also trigger if you just tap the door with the rock. I'll have to think of some other way to break down that door that doesn't involve crowbars.

03-30-2012, 03:04 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
RE: Breaking down door with rock

Hammer?

03-30-2012, 03:06 AM
Find
DaAinGame Offline
Member

Posts: 90
Threads: 11
Joined: Mar 2012
Reputation: 4
#6
RE: Breaking down door with rock

Isn't there some fancy script that also checks the speed of a prop being thrown? I remember reading somewhere that the player throws things at a speed of "2" and this can be used in an if statement. I'll dig around and see if I can't find that old thread.

Realm Of Another Chapter 1: http://www.frictionalgames.com/forum/thread-14142.html
Realm Of Another Chapter 2: Postponed
Adder Halls: 5%
03-30-2012, 03:34 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#7
RE: Breaking down door with rock

(03-30-2012, 03:34 AM)DaAinGame Wrote: Isn't there some fancy script that also checks the speed of a prop being thrown? I remember reading somewhere that the player throws things at a speed of "2" and this can be used in an if statement. I'll dig around and see if I can't find that old thread.
That's to check the Players speed.

03-30-2012, 03:38 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#8
RE: Breaking down door with rock

It's a little out of the way, but I added a large script area around the door that turns off the callback if the player enters it. It also switches the rock impact to show a message on screen instead of breaking down the door. "I should back away..." Then when the player backs away, the callback turns back on and they can throw the rock to break down the door.

Kind of a roundabout way of doing it, but I think it's better than nothing.

03-30-2012, 04:28 AM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#9
RE: Breaking down door with rock

I don't know if this will work and I'm a bit too lazy to all of the scripting and stuff but when you throw an object at another object it pushes it back.
If it's a locked door it will be pushed back a little then return back.
Maybe if there's a script area behind the door just enough so you can't push the door into it.

Then do the script.
AddEntityCollideCallback("", "mansion_1", "DoorSmash", true, 1);
}

void DoorSmash(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("mansion_1', 0);
GiveSanityBoostSmall();
}
FYI I just thought this up, I don't know if it will work.

03-30-2012, 10:00 PM
Find




Users browsing this thread: 3 Guest(s)