How to block a door with a cube properly?
Quote from Hedgehog on January 7, 2008, 11:06 amI feel stupid for asking, but I want the player to be able to block a door with a cube. At first look it seems to work by just placing the cube as player between the doors, but then I noticed the doors kept pushing the cube untill it is pushed out of the way.
I tried several workarounds, but I can't seem to get it to work properly. I tried to trigger DisableMotion on the cube, but then the door just moves through the cube. Changing the mass of the cube also had no succes, and trying to trigger some func_push brushes also had little succes.
I'm trying workarounds that are just insane, there has to be a better option, that I've overlooked. Can someone enlighten me? Because I'm spending too much time on a small problem now.
I feel stupid for asking, but I want the player to be able to block a door with a cube. At first look it seems to work by just placing the cube as player between the doors, but then I noticed the doors kept pushing the cube untill it is pushed out of the way.
I tried several workarounds, but I can't seem to get it to work properly. I tried to trigger DisableMotion on the cube, but then the door just moves through the cube. Changing the mass of the cube also had no succes, and trying to trigger some func_push brushes also had little succes.
I'm trying workarounds that are just insane, there has to be a better option, that I've overlooked. Can someone enlighten me? Because I'm spending too much time on a small problem now.
Quote from xitooner on January 7, 2008, 12:20 pmThe levels I've seen that involve blocking a door have so far always been one of:
- Pushes on block until its shot out or destroyed (fairly short timeframe, but it WILL happen).
- Immediately opens when obstruction is in the way (but I think it will keep trying, and eventually moves the cube).There is a flag for these two behaviosr; I think its "forceclosed" or something.
In my own work (I have a couple of puzzles where this might occur, and at least one where its important that it does), I've never wanted any long-term opening of the door, and am mostly interested in giving the player a small window to time to get past. . . the above was sufficient for me.
The levels I've seen that involve blocking a door have so far always been one of:
- Pushes on block until its shot out or destroyed (fairly short timeframe, but it WILL happen).
- Immediately opens when obstruction is in the way (but I think it will keep trying, and eventually moves the cube).
There is a flag for these two behaviosr; I think its "forceclosed" or something.
In my own work (I have a couple of puzzles where this might occur, and at least one where its important that it does), I've never wanted any long-term opening of the door, and am mostly interested in giving the player a small window to time to get past. . . the above was sufficient for me.
Quote from Artesia on January 7, 2008, 12:35 pmfeel like overcomplicating a door? well here's your chance!
for each side of the door actually use 2 func doors one pareneted to the other. Much like Piston lifts where the pistons expand and contract.
Lets call them Base Door and Func Door as the Base door has no models parented to it, only the Func door. The Func door has the actual door models parented to it.
Now each kind of door would move the door models a little, if you only opened the func door they would stop half opened since the actual doors are thinner than the door model.
Place a trigger in the doorway which is only triggered by the cube, make this trigger disable whatever mechanism is actually closing the Base door, so only the Func door closes, and seems to be jammed open. I usually close doors by Endtouch triggers on either side of the door, you would need to make a seperate one for the Func and Base doors in this example, then just disable one for the door to no fully close.
Hope this helps, note that this idea has not been tested but was thought of on the fly
feel like overcomplicating a door? well here's your chance!
for each side of the door actually use 2 func doors one pareneted to the other. Much like Piston lifts where the pistons expand and contract.
Lets call them Base Door and Func Door as the Base door has no models parented to it, only the Func door. The Func door has the actual door models parented to it.
Now each kind of door would move the door models a little, if you only opened the func door they would stop half opened since the actual doors are thinner than the door model.
Place a trigger in the doorway which is only triggered by the cube, make this trigger disable whatever mechanism is actually closing the Base door, so only the Func door closes, and seems to be jammed open. I usually close doors by Endtouch triggers on either side of the door, you would need to make a seperate one for the Func and Base doors in this example, then just disable one for the door to no fully close.
Hope this helps, note that this idea has not been tested but was thought of on the fly
Quote from Hurricaaane on January 7, 2008, 1:51 pmOnBlockedClosing
OnBlockedOpening
The func_door have some interesting outputs:
http://developer.valvesoftware.com/wiki/Func_doorWant to try?
OnBlockedClosing
OnBlockedOpening
The func_door have some interesting outputs:
http://developer.valvesoftware.com/wiki/Func_door
Want to try?
Author of Minecraft mods (MAtmos, Minaptics, NoteSlider) and Garry's Mod addons (Gunstrumental, SharpeYe, GarryWare, DepthHUD).
Quote from Hedgehog on January 7, 2008, 4:33 pmIt seems that this is only triggered when the player blocks the door, not a physics object..
Maybe I'm wrong, but that's what I'm starting to think.
Edit:
Oh wait, I forgot the block filter... Or no, that was Half-Life: Source only...Edit2:
Okay, the best workaround seems to be to put a disabled trigger_multiple between the doors, with a filter for the box(es). Let it set the speed of the doors to -1 and movement to Open once it's enabled (shortly after the door closes). Just speed to 0 or -1 didn't seem to work. Maybe add a little delay so it looks better. Make sure the speed is set first, before the movement is set.
It seems that this is only triggered when the player blocks the door, not a physics object..
Maybe I'm wrong, but that's what I'm starting to think.
Edit:
Oh wait, I forgot the block filter... Or no, that was Half-Life: Source only...
Edit2:
Okay, the best workaround seems to be to put a disabled trigger_multiple between the doors, with a filter for the box(es). Let it set the speed of the doors to -1 and movement to Open once it's enabled (shortly after the door closes). Just speed to 0 or -1 didn't seem to work. Maybe add a little delay so it looks better. Make sure the speed is set first, before the movement is set.