Portal 2
Community maps. For science.
Welcome to Aperture Laboratories, home of the Perpetual Testing Initiative. Easily create, share and play test chambers authored by and for the Portal 2 community. Do your part! Contribute to Science!
Konke 2 Feb 9, 2014 @ 12:13pm
[Hammer] Piston lift
I'd like to implement a piston lift in my map but I can't seem to find any tutorial showing how to do it. I know how to use animating arms with panels but this time I want a lift with a couple of pistons moving.

Any ideas? Thanks in advance!
Showing 1-10 of 10 comments
< >
TeamSpen210 13 Feb 9, 2014 @ 12:42pm 
You want to use a func_movelinear, textured with nodraw. Parent the piston models to it, and set the start/stop sounds to "World.PlatformStart" and "World.PlatformStop". Configure the move direction and distance as appropriate, then you can send Open and Close inputs to make it move. The piston models don't have collisions, so you'll want to make the func_movelinear cover the piston and top platform with two brushes.
Konke 2 Feb 10, 2014 @ 7:55am 
I'm not that advanced in Hammer but I think I managed it. At least one piston. How can I set three pistons to move one after the other, and not all at once?
Gemarakup 19 Feb 10, 2014 @ 8:45pm 
Originally posted by Konke:
I'm not that advanced in Hammer but I think I managed it. At least one piston. How can I set three pistons to move one after the other, and not all at once?
Set different delays? It's quite hard though.
Konke 2 Feb 10, 2014 @ 11:11pm 
Yeah, I managed to see how Valve does it though, and from what I can tell they use func_door and a lot of different outputs.

If I have three pistons that move I want the "idle" ones to move together with the "moving" one. That's the tricky part. The other problem is that when I use a button to trigger the pistons, it gets buggy when I turn it on and off quickly. They stop at different positions...
TeamSpen210 13 Feb 11, 2014 @ 12:40am 
If you have timed outputs, use two logic_relays. You can use the CancelPending input to make a relay cancel outputs that were triggered with a delay. You want two, with one being triggered and the other canceled after the previous. To ensure your pistons move right, you could use multiple func_movelinears/func_doors (basically work the same) parented to the previous one.
To get timings right, it's useful to know that the speed parameter in func_movelinears and doors is in hammer unit per second. (Set to 128 and it will take exactly 1 second to move 128 units, which is about how far a piston segment moves.)
Last edited by TeamSpen210; Feb 11, 2014 @ 12:41am
Konke 2 Feb 11, 2014 @ 4:51am 
I feel that my Hammer knowledge is limited, I'm not quite sure how to do the things you describe. I could really use a tutorial since it's how I've learned everything so far. I try to experiment on my own, as much as I can, but like I said: my knowledge is limited.

I know it's much to ask but if you find yourself with some extra time, would you be so kind and try to explain in simple steps how to make it right? That would be much appreciated. I will keep looking for a solution aswell. Thanks!
Gemarakup 19 Feb 11, 2014 @ 5:44am 
Unfortunately, this is complex hammer logic, and there isn't a real tut for this. What he's saying is that you need the activator for your lift to trigger a logic_relay. That relay "opens" the func_movelinears (Move across distances, unlike the func_doors that move their own distance) and the delays of the second logic_relay for lowering the lift are cancelable because of the CancelPending input. It's hard to put it into words, but the point of this is to prevent the pistons moving opposite directions. You might like to use the PTI instance. It's actually easier than creating stuff from scratch once you figure out.
Konke 2 Feb 11, 2014 @ 6:10am 
Hmm... What's the downside of using a PTI instance? Except for the lack of freedom that is?
Gemarakup 19 Feb 11, 2014 @ 9:18am 
Originally posted by Konke:
Hmm... What's the downside of using a PTI instance? Except for the lack of freedom that is?
They use a lot of entities for the flexible logic. That shouldn't matter though for now. I've used it before, so I'll be able to tell you how the keyvalues work.
TeamSpen210 13 Feb 11, 2014 @ 11:31am 
You want to make a 128 x 128 x 256 hole in the floor for the piston, and position it so it is fully down. TopLevel and BottomLevel are numbers from 0-4, they set the maximum and minimum height it moves. StartUp is true/false and sets the starting position. Set ConnectionCount to the number of input items (just one usually), then send the add input when they are turned on and the subtract input when they are turned off. Note that the PTI piston will destroy/kill players and objects that are under it as it moves down.
Showing 1-10 of 10 comments
< >
Per page: 15 30 50
Date Posted: Feb 9, 2014 @ 12:13pm
Posts: 10