Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script with doors
Author Message
SLAMnesia Offline
Member

Posts: 94
Joined: May 2011
Reputation: 0
Post: #1
Script with doors
Hey guys!

I have a door that I want to fall off its hinges when you try to open it. (you click and drag to open it but it just collapses and becomes uninteractable)

I think I'll need a new door entity file or something maybe script idk but is there a way to do so?
06-20-2011 10:56 PM
Find all posts by this user Quote this message in a reply
Nye Offline
Senior Member

Posts: 251
Joined: Jan 2011
Reputation: 2
Post: #2
RE: Script with doors
There is currently no door entity that you can pull around off hinges, so you will need to create a custom entity, and when the player interacts with the door (interact callback), run a function that will setentityactive("original_door", false); and setentityactive("new_entity_broken_door", true);

I hope this helped.

(This post was last modified: 06-21-2011 12:26 AM by Nye.)
06-21-2011 12:26 AM
Find all posts by this user Quote this message in a reply
Kurton Offline
Senior Member

Posts: 268
Joined: Oct 2010
Reputation: 5
Post: #3
RE: Script with doors
For that extra pop, maybe have some areas at the hinges that will spawn dust/dirt particles (CreateParticleSystemAtEntity), and play a wood/metal break sound (PlaySoundAtEntity).

06-21-2011 02:27 AM
Find all posts by this user Quote this message in a reply
SLAMnesia Offline
Member

Posts: 94
Joined: May 2011
Reputation: 0
Post: #4
RE: Script with doors
yeah thats what I thought I'd have to do, but idk how to do that Sad Im just givin up on that idea it isnt crucial to the story. thanks anyways
06-21-2011 03:25 AM
Find all posts by this user Quote this message in a reply
rojkish Offline
Junior Member

Posts: 45
Joined: Jun 2011
Reputation: 0
Post: #5
RE: Script with doors
You can always do a lookawaycallback, so when the player looks away you set the first entity inactive and then the second entity active with some sounds and ps_break_wood particle system
06-21-2011 07:02 PM
Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,174
Joined: Mar 2011
Reputation: 56
Post: #6
RE: Script with doors
It would be better to mimic the secret painting entities. That painting has two attach points which "click" off, so to speak. Give it a shot, see how it feels. You can move it a certain amount before the attachment point breaks.

That would give you a kind of break-door-hinges feel if you tweak it properly, and would avoid setting an entity active/inactive. That would just feel strange because it would break the player's interaction with the 'working' door and then there would just be a broken door. It would feel more "real" to have a door they can simply pull off the hinges Big Grin

06-21-2011 07:14 PM
Find all posts by this user Quote this message in a reply
Rownbear Offline
Member

Posts: 157
Joined: Apr 2011
Reputation: 2
Post: #7
RE: Script with doors
I think theres a door entity which is broken in level editor, just make it so, playerinteract -> createparticle and sounds -> swap the door with the broken door. that way it would seem like the door destroyed when you touched it, and should give alittle jump scare.

06-23-2011 03:00 AM
Find all posts by this user Quote this message in a reply
Roenlond Offline
Senior Member

Posts: 331
Joined: Apr 2011
Reputation: 0
Post: #8
RE: Script with doors
(06-23-2011 03:00 AM)Rownbear Wrote:  I think theres a door entity which is broken in level editor, just make it so, playerinteract -> createparticle and sounds -> swap the door with the broken door. that way it would seem like the door destroyed when you touched it, and should give alittle jump scare.

Though it'd be EXTREMELY unrealistic if you are able to look at the door. "Ooh a door, let's open it. Oh wow, it disappeared and popped up on the floor in an instant! :o"
06-23-2011 02:36 PM
Find all posts by this user Quote this message in a reply
Rownbear Offline
Member

Posts: 157
Joined: Apr 2011
Reputation: 2
Post: #9
RE: Script with doors
(06-23-2011 02:36 PM)Roenlond Wrote:  
(06-23-2011 03:00 AM)Rownbear Wrote:  I think theres a door entity which is broken in level editor, just make it so, playerinteract -> createparticle and sounds -> swap the door with the broken door. that way it would seem like the door destroyed when you touched it, and should give alittle jump scare.

Though it'd be EXTREMELY unrealistic if you are able to look at the door. "Ooh a door, let's open it. Oh wow, it disappeared and popped up on the floor in an instant! :o"

well the possesed monsters with claws walking around are very realistic aswell. Though ofcourse you'd have to make it fit in the story but that's one suggestion to it. Now he just have to play around with it and make it the way he want.

06-23-2011 08:44 PM
Find all posts by this user Quote this message in a reply
Apjjm Offline
Super Moderator

Posts: 444
Joined: Apr 2011
Reputation: 42
Post: #10
RE: Script with doors
Just make a non-static non-zero mass door entity with no hinge joint, set it's type as moveable object and you're done - the player will pull/push it and it will fall. If you only want this to occur when the door is in a specific state you are going to need to swap out a normal door with the entity described upon the correct state change.

(This post was last modified: 06-23-2011 08:51 PM by Apjjm.)
06-23-2011 08:50 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)