SLAMnesia
Member
Posts: 99
Threads: 39
Joined: May 2011
Reputation:
0
|
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 |
|
Nye
Senior Member
Posts: 250
Threads: 8
Joined: Jan 2011
Reputation:
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 |
|
Kurton
Senior Member
Posts: 533
Threads: 8
Joined: Oct 2010
Reputation:
16
|
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 |
|
SLAMnesia
Member
Posts: 99
Threads: 39
Joined: May 2011
Reputation:
0
|
RE: Script with doors
yeah thats what I thought I'd have to do, but idk how to do that Im just givin up on that idea it isnt crucial to the story. thanks anyways
|
|
06-21-2011, 03:25 AM |
|
rojkish
Junior Member
Posts: 45
Threads: 0
Joined: Jun 2011
Reputation:
0
|
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 |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
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
|
|
06-21-2011, 07:14 PM |
|
Rownbear
Member
Posts: 157
Threads: 13
Joined: Apr 2011
Reputation:
2
|
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 |
|
Roenlond
Senior Member
Posts: 331
Threads: 3
Joined: Apr 2011
Reputation:
0
|
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 |
|
Rownbear
Member
Posts: 157
Threads: 13
Joined: Apr 2011
Reputation:
2
|
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 |
|
Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
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 |
|
|