Custom Floor Buttons
Custom floor buttons are quite easy to make in Portal 2. The first two released[Clarify] were created by LemonLake, and they are available for download at the bottom of the page.
How to use the instance
Setting up
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.
Creating
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)
Outputs
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 (instance:Unpressed;OnTrigger
).
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!
Button Animation
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!
Filter
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 filter_activator_model
.
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 filter_activator_model
.
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