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
Script with doors
SLAMnesia Offline
Member

Posts: 99
Threads: 39
Joined: May 2011
Reputation: 0
#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
Nye Offline
Senior Member

Posts: 250
Threads: 8
Joined: Jan 2011
Reputation: 2
#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
Kurton Offline
Senior Member

Posts: 533
Threads: 8
Joined: Oct 2010
Reputation: 16
#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
SLAMnesia Offline
Member

Posts: 99
Threads: 39
Joined: May 2011
Reputation: 0
#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
rojkish Offline
Junior Member

Posts: 45
Threads: 0
Joined: Jun 2011
Reputation: 0
#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
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#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
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#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
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#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
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#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
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#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




Users browsing this thread: 2 Guest(s)