How can I force the doors to close no matter what?
How to force doors to close?
Lorithad wrote:
...There's probably a way to get it to kill the player if it closes exactly on him.
Yes, sir:

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.
Not sure if this works though, and it might not be the ideal solution.
Hunter wrote:
Is 'like, a billion' a valid numerical constant in Hammer?...
No, sir, it is not.
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; }
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.
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.
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?)
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.
But since a storage/companion cube has no gibs, and isn't programmed to be destroyed, it can't. It's all in coding.