Custom Floor Buttons
How to use the instance
YOU ONLY NEED TO DO THIS ONCE! In your
steamapps folder, navigate to
common/portal2/sdk_content/maps/instances. Make a folder named
drew and extract the contents of the customfloorbuttons zip into it. You should now have some vmf's in that folder.
In hammer, create a
func_instance with the following properties:
Property Name Value Fix Up Name button1 VMF Filename instances/drew/custom_button_1.vmf (you can choose an other one included in the package)
To trigger something when the button is pressed down, in the outputs section set My Output to
instance:Pressed;OnTrigger. It can be found in the dropdown.
It's the same for unpressing, except instead of Pressed its Unpressed (
Hammer may indicate these are
invalid. Ignore it.
How it Works
Triggering the Button
The button is triggered by a
trigger_multiple, which sends an output to four relays. One handles the Button Unpressed downward animation and sound whereas another handles the upward animation and sound. The other two just send an output to the
func_instance_io_proxy as of which handles the output in the instance. The reason they are in a separate relay is because I wanted to be cautious of the fact that once a
func_instance_io_proxy is called in an output, the rest in that same entity cannot be called in that instance. Safety first!
The button animation is handled by a simple
func_movelinear brush. It's move direction is simply set to
90 0 0 (down) and the distance is set to 8, so it just touches the bottom of the button directly. It's speed is set to 50, which I think is real enough. In the next update I will add a setting so that you can change the speed of the button movement yourself.
Optional Bits you can Add
Before I tell you the custom bits you can add to a new instance, I'd just like to ask you if you could send me your modified instances and I'll drop 'em in the pack (if they're good enough of course)! Thanks!
In the antique version, you may notice that the button only supports an antique cube (you may remove it if you wish). This was done with a simple
Property Name Value Name filter Filter Model models/props_underground/underground_weighted_cube.mdl
Then set the triggers Filter Name to whatever you named your
Download & Changelog
- Click here to download the package with the custom floor buttons
- 8th May 2012 08:28: Added two new buttons, and speed parameter to all of them