How to force doors to close?

Avatar
whupper
42 Posts
Posted Jan 18, 2008
I have a door, the normal portal round door with a left and right side. I set the Force Closed property on both of them. Yet when I put a box between them and close the door, the box prevents them from closing. Indeed, I can stand in between them myself and also prevent them from closing.

How can I force the doors to close no matter what?

Advertisement
Registered users don't see ads! Register now!
Avatar
Lorithad
240 Posts
Posted Jan 18, 2008
Replied 12 hours later
Well from what i've seen, I don't think you can force a door to close when there's a box propping it open. Though There's probably a way to get it to kill the player if it closes exactly on him.
Avatar
Beer-Me
137 Posts
Posted Jan 18, 2008
Replied 18 minutes later
Perhaps you can put a trigger in the door way and make it detect boxes, and some how push the boxes out of the doorway, not sure how sorry this is just theory.
Avatar
Nacimota
345 Posts
Posted Jan 18, 2008
Replied 47 minutes later

Lorithad wrote:
...There's probably a way to get it to kill the player if it closes exactly on him.

Yes, sir:

Avatar
Hunter
17 Posts
Posted Jan 19, 2008
Replied 6 hours later
Is 'like, a billion' a valid numerical constant in Hammer?

And while this would definitely stop the player from propping the door open, I'm pretty sure it wouldn't help with boxes. Damage only affects props that are designed to be breakable, and the Aperture Science Weighted Storage Cube is not among them. So you'll have to use the door's OnBlockedClosing output to rig up a separate solution for cubes and other physics props. Maybe you could create a fizzler in the doorway that turns on temporarily when an object needs to be removed. It's all up to you how you want the game to handle it.

Avatar
Dewin
43 Posts
Posted Jan 19, 2008
Replied 3 minutes later
I think that OnBlockedClosing's activator is the object that blocks it... so you might be able to just !activator -> Kill for physobjs.

Not sure if this works though, and it might not be the ideal solution.

Avatar
Nacimota
345 Posts
Posted Jan 19, 2008
Replied 4 hours later

Hunter wrote:
Is 'like, a billion' a valid numerical constant in Hammer?...

No, sir, it is not.

Avatar
whupper
42 Posts
Posted Jan 19, 2008
Replied 8 hours later
In this particular case, the cube is actually companion cube that the player is supposed to carry to the end. So I'm loathe to destroy it because then I have to come up with some way to create or obtain another one. Whereas I quite like the idea that you only get the one cube.
Avatar
taco
504 Posts
Posted Jan 19, 2008
Replied 3 minutes later
What if the doors blocking brushes were wedges, or angled so that when they close, the cube would get pushed and twisted - preventing it from becoming stuck.
Avatar
Hunter
17 Posts
Posted Jan 19, 2008
Replied 5 hours later

taco wrote:
What if the doors blocking brushes were wedges, or angled so that when they close, the cube would get pushed and twisted - preventing it from becoming stuck.

You know, that sounds like it should work. The problem is that I'm not sure you could make a single shape that would pop the cube out in all circumstances.

If you need the player to keep the cube, your best bet might be to go with Beerage's idea. There's something called trigger_push. Place one in the door frame, set the push direction to point toward the puzzle, and make sure the "Applies to Physics Objects" flag is checked. Then add the following outputs:

door.OnBlockedClosing = { door.Open; trigger.Enable; }
trigger.OnEndTouchAll = { door.Close; trigger.Disable; }

Avatar
Ricotez
738 Posts
Posted Jan 20, 2008
Replied 12 hours later

whupper wrote:
In this particular case, the cube is actually companion cube that the player is supposed to carry to the end. So I'm loathe to destroy it because then I have to come up with some way to create or obtain another one. Whereas I quite like the idea that you only get the one cube.

A storage or companion cube can't be destroyed, the only thing that will happen is that force is put upon it. If you would use a crate or something that's actually destructable, then it would be destroyed. But since a storage/companion cube has no gibs, and isn't programmed to be destroyed, it can't. It's all in coding.

Maybe you should try to create trigger_teleports in the doors, make the doors their parents, and let them teleport any objects (not the player) they might hit.

Avatar
msleeper
4,095 Posts
Member
Posted Jan 21, 2008
Replied 1 day later

Ricotez wrote:
But since a storage/companion cube has no gibs, and isn't programmed to be destroyed, it can't. It's all in coding.

I think you can still Kill it with I/O, it will just disappear without any sort of sign or signal. You could always have an env_explosion parented to it, and have that trigger when it is destroyed, but that's just one idea.

Avatar
Dewin
43 Posts
Posted Jan 22, 2008
Replied 22 hours later

msleeper wrote:
I think you can still Kill it with I/O, it will just disappear without any sort of sign or signal. You could always have an env_explosion parented to it, and have that trigger when it is destroyed, but that's just one idea.

Or enable a trigger_portal_cleanser OnClose and disable it OnOpen, which will fizzle the box.

(I know you can disable the 'dissolve physics objects' of a portal cleanser. Can you JUST dissolve physics objects without clearing portals?)

Avatar
msleeper
4,095 Posts
Member
Posted Jan 22, 2008
Replied 32 minutes later
Probably, try unchecking the "Clients" flag since that is what players are classified as.
Advertisement
Registered users don't see ads! Register now!
Avatar
whupper
42 Posts
Posted Jan 22, 2008
Replied 40 minutes later
Wow, lots of good ideas.

Since it's a companion cube, I'd rather not destroy it. That's just a preference, though. In another part of my map if they drop the cube in some poison water I display a message and restore them to an autosave point. So I could do the same thing if I need to.

My preference would be to have the cube fly back into the room they started in as if the pressure from the doors forced it. But I want it to come back into the first room. If it flies into the second room and the player is in room 1, then that's as bad as the cube being destroyed since they need the cube to open the door (which initiates a timer to close the door). So I'll look into those options as people suggested (such as Hunter's idea). I'm quite the newbie with Hammer, though, so it might take me a while.

Thanks for all your suggestions everyone.