Static redircetion cubes on elevators (SOLVED)
Quote from Superrodan on June 4, 2011, 11:21 pmHey there,
I am working on a map where you use elevators to lift and lower redirection cubes. These cubes need to redirect lasers to specific spots so I need to be able to orient them in the editor correctly.
Currently I have the cubes set to dynamic overrides with the redirection cube model because that was how I was taught to make things move with elevators, but that isn't working. They don't redirect anything!
Is my problem something to do with how I am orienting the cube? Is there a specific side the laser needs to enter? Or is it a problem with having the object set to a prop_dynamic_override instead of a physics object?
If the problem is that they aren't physics models, is there some kind of setting combination I can use to get the cubes statically attached to the elevator without risk of them moving due to physics? (they will be behind glass so there is no risk of the player getting to them)
Thanks!
Hey there,
I am working on a map where you use elevators to lift and lower redirection cubes. These cubes need to redirect lasers to specific spots so I need to be able to orient them in the editor correctly.
Currently I have the cubes set to dynamic overrides with the redirection cube model because that was how I was taught to make things move with elevators, but that isn't working. They don't redirect anything!
Is my problem something to do with how I am orienting the cube? Is there a specific side the laser needs to enter? Or is it a problem with having the object set to a prop_dynamic_override instead of a physics object?
If the problem is that they aren't physics models, is there some kind of setting combination I can use to get the cubes statically attached to the elevator without risk of them moving due to physics? (they will be behind glass so there is no risk of the player getting to them)
Thanks!
Quote from WinstonSmith on June 4, 2011, 11:24 pmUse a prop_weighted_cube with CubeType set to Reflective, and set the prop_weighted_cube's parent to whatever entity you're using for the elevator. Parenting it should disable physics/movement; if it doesn't you can always check the "Motion Disabled" in the prop_weighted_cube's keyflags.
Use a prop_weighted_cube with CubeType set to Reflective, and set the prop_weighted_cube's parent to whatever entity you're using for the elevator. Parenting it should disable physics/movement; if it doesn't you can always check the "Motion Disabled" in the prop_weighted_cube's keyflags.
Quote from Superrodan on June 4, 2011, 11:38 pmI'm a pretty big noob to all of this so I'm going to have to ask for some clarification.
Since when I set the object to a cube I don't see a field for parent in the properties, does this mean I will need to use a logic_auto entity to set the cube's parent at the beginning of the level?
I also don't know how to get to a cube's keyflags... or even how to use keyflags. I opened properties and went to the "flags" tab but there is nothing there. Is there a tutorial about keyflags on the wiki somewhere?
Thanks for the quick response time!
I'm a pretty big noob to all of this so I'm going to have to ask for some clarification.
Since when I set the object to a cube I don't see a field for parent in the properties, does this mean I will need to use a logic_auto entity to set the cube's parent at the beginning of the level?
I also don't know how to get to a cube's keyflags... or even how to use keyflags. I opened properties and went to the "flags" tab but there is nothing there. Is there a tutorial about keyflags on the wiki somewhere?
Thanks for the quick response time!
Quote from WinstonSmith on June 4, 2011, 11:57 pmMy apologies, I haven't taken that close a look at the prop_weighted_cube and I'd assumed its properties were similar to that of a prop_physics.
Anyway, you're right. The Parent field doesn't exist in Hammer and neither does the Disable Motion keyflag (and for the record, when people say keyflags they do mean what's in the Flags tab). However, you'll want to first name the cube. Then create a logic_auto (basically a logic_relay that runs when the map starts) and create the following output in it:
- Code: Select all
OnMapSpawn-->[cube name here]-->SetParent-->[elevator entity name here]-->0.00
That should work.
My apologies, I haven't taken that close a look at the prop_weighted_cube and I'd assumed its properties were similar to that of a prop_physics.
Anyway, you're right. The Parent field doesn't exist in Hammer and neither does the Disable Motion keyflag (and for the record, when people say keyflags they do mean what's in the Flags tab). However, you'll want to first name the cube. Then create a logic_auto (basically a logic_relay that runs when the map starts) and create the following output in it:
- Code: Select all
OnMapSpawn-->[cube name here]-->SetParent-->[elevator entity name here]-->0.00
That should work.

Quote from ChickenMobile on June 5, 2011, 1:05 amCan weighted cubes be parented? If there was no option to set it's parent then there probably is a good reason.
Can weighted cubes be parented? If there was no option to set it's parent then there probably is a good reason.
Quote from Superrodan on June 5, 2011, 4:03 amOk, the parenting is working, and the cube shoots a laser. Sorry it took so long for me to get back to this topic and tell you that was working, I had an urgent issue to take care of.
I have one more problem with this whole setup...
I might be doing elevators wrong, but I'm using a tanktrain and a path. Because my path is upwards, the elevator is flipped sideways when I run.
I already counteracted this by rotating my elevator 90 degrees in the editor so now when I run, it looks normal. Because the cube parents the elevator only once the map loads, it is REALLY hard to line this up so that it is on the elevator where I need it to be since it begins by falling for a second
Is there any way to either
A) Start the cube out as something with no physics, parent it to the elevator, then change it into a cube.
B) Move the cube to a specific position on top of the elevator before I parent it?
C) Force the already parented cube to have a certain offeset from the elevator's center point?
Ok, the parenting is working, and the cube shoots a laser. Sorry it took so long for me to get back to this topic and tell you that was working, I had an urgent issue to take care of.
I have one more problem with this whole setup...
I might be doing elevators wrong, but I'm using a tanktrain and a path. Because my path is upwards, the elevator is flipped sideways when I run.
I already counteracted this by rotating my elevator 90 degrees in the editor so now when I run, it looks normal. Because the cube parents the elevator only once the map loads, it is REALLY hard to line this up so that it is on the elevator where I need it to be since it begins by falling for a second
Is there any way to either
A) Start the cube out as something with no physics, parent it to the elevator, then change it into a cube.
B) Move the cube to a specific position on top of the elevator before I parent it?
C) Force the already parented cube to have a certain offeset from the elevator's center point?
Quote from WinstonSmith on June 5, 2011, 1:31 pmchickenmobile wrote:Can weighted cubes be parented? If there was no option to set it's parent then there probably is a good reason.No good reason, VALVe just left it out of the FGD. My guess is probably because storage cubes and the like are so seldom parented to things.
Anyway, if you can try to not use a func_tracktrain for the elevator. If at all possible, try to use a func_door or func_movelinear, as this will eliminate the issue caused by the fact that the side of a func_tracktrain facing the X axis in Hammer will always rotate to face the next path_track ingame. I'm trying to think of another solution, but is there any chance you can avoid the func_tracktrain?
EDIT: Nevermind that, you can use it. Just build it as you want it to appear ingame and check the "Fixed Orientation" flag on the func_tracktrain. That way it won't rotate.
No good reason, VALVe just left it out of the FGD. My guess is probably because storage cubes and the like are so seldom parented to things.
Anyway, if you can try to not use a func_tracktrain for the elevator. If at all possible, try to use a func_door or func_movelinear, as this will eliminate the issue caused by the fact that the side of a func_tracktrain facing the X axis in Hammer will always rotate to face the next path_track ingame. I'm trying to think of another solution, but is there any chance you can avoid the func_tracktrain?
EDIT: Nevermind that, you can use it. Just build it as you want it to appear ingame and check the "Fixed Orientation" flag on the func_tracktrain. That way it won't rotate.
Quote from Superrodan on June 5, 2011, 5:56 pmI found that flag earlier but when I checked it it didn't seem to work...
I am not in front of my mapping computer at the moment but I will try again when I get there just in case I forgot to hit apply or something.
In the meantime, is there any workaround if that doesn't work? Like I said, I will not be in front of my map until later so if it doesn't work to set that flag or if I am doing it wrong, then I want to have a backup... (even though I don't think I can win I set a goal for myself to learn how to make a portal map and enter it by the time the contest ends)
For example, is there a way to switch a prop_static into a weighted cube entity? Or a way to swap the map location of two objects? If I could swap two objects then I can put my cube in a small hidden room and then on map start switch it out with something that I can place in the editor that has no physics...
By the way, you've all been very helpful. Thanks for that!
I found that flag earlier but when I checked it it didn't seem to work...
I am not in front of my mapping computer at the moment but I will try again when I get there just in case I forgot to hit apply or something.
In the meantime, is there any workaround if that doesn't work? Like I said, I will not be in front of my map until later so if it doesn't work to set that flag or if I am doing it wrong, then I want to have a backup... (even though I don't think I can win I set a goal for myself to learn how to make a portal map and enter it by the time the contest ends)
For example, is there a way to switch a prop_static into a weighted cube entity? Or a way to swap the map location of two objects? If I could swap two objects then I can put my cube in a small hidden room and then on map start switch it out with something that I can place in the editor that has no physics...
By the way, you've all been very helpful. Thanks for that!
Quote from WinstonSmith on June 5, 2011, 6:36 pmMy advice would be to try to construct the elevator with a func_door/func_movelinear or something similar (if at all possible), which would eliminate the rotation problem altogether.
My advice would be to try to construct the elevator with a func_door/func_movelinear or something similar (if at all possible), which would eliminate the rotation problem altogether.
Quote from Another Bad Pun on June 5, 2011, 6:41 pmYou could be sneaky and have the prop_static enabled at the start of the map and the cube disabled and then disable the prop_static and enable the cube at the same time.
OR
You could use a teleport. Here's a good tutorial on them:
http://www.youtube.com/watch?v=y0H_MDsjcK0]
You could be sneaky and have the prop_static enabled at the start of the map and the cube disabled and then disable the prop_static and enable the cube at the same time.
OR
You could use a teleport. Here's a good tutorial on them:
http://www.youtube.com/watch?v=y0H_MDsjcK0]