Portal 2: Hammer Help!

Avatar
kyleprotecX
116 Posts
Posted Jul 17, 2014
I need some help with Hammer i want to create a button with a custom model that triggers with "e" Just like the button in the campaign that has online and offline a pedastel button. Thanks
Advertisement
Registered users don't see ads! Register now!
Avatar
TeamSpen210
608 Posts
Posted Jul 17, 2014
Replied 51 minutes later
If you mean the BTS button, you need 3 prop_dynamics and a func_button.
Prop_dynamics:
"models/props_bts/push_button_stand.mdl", the actual stand with 2 skins for the "online" and "ready" display.
"models/props_gameplay/push_button_base.mdl", the housing for the button with 2 skins as well for some red/green lights. Put this on the empty spot on the stand.
"models/props_gameplay/push_button_knob.mdl", the knob itself. Parent it to the func_button, and place inside the housing.

The func_button is made of nodraw and is the thing players "press" (put it around where the knob is). Set the "movement direction" to match the direction the knob should move. Set "lip" to be 1 less than the distance along the axis the button moves (if it moves left/right on the top view, use the width; if it moves up/down then use the height. You probably won't have a button on the floor). Set "delay before reset" and "speed" to whatever looks good (I've used 0.1s delay and a speed of 4). In flags make sure only "use activates" is checked.

You'll also want an ambient_generic with the sound "World.LightPowerOnMd".

For outputs (all from the func_button):
- "OnIn" set the base + stand Skin to 1.
- "OnOut" set the base+stand Skin to 0.
- "OnPressed" "PlaySound" the ambient_generic.
- "OnPressed" trigger whatever you want the button to do.

Avatar
kyleprotecX
116 Posts
Posted Jul 17, 2014
Replied 37 minutes later

TeamSpen210 wrote:
If you mean the BTS button, you need 3 prop_dynamics and a func_button.
Prop_dynamics:
"models/props_bts/push_button_stand.mdl", the actual stand with 2 skins for the "online" and "ready" display.
"models/props_gameplay/push_button_base.mdl", the housing for the button with 2 skins as well for some red/green lights. Put this on the empty spot on the stand.
"models/props_gameplay/push_button_knob.mdl", the knob itself. Parent it to the func_button, and place inside the housing.

The func_button is made of nodraw and is the thing players "press" (put it around where the knob is). Set the "movement direction" to match the direction the knob should move. Set "lip" to be 1 less than the distance along the axis the button moves (if it moves left/right on the top view, use the width; if it moves up/down then use the height. You probably won't have a button on the floor). Set "delay before reset" and "speed" to whatever looks good (I've used 0.1s delay and a speed of 4). In flags make sure only "use activates" is checked.

You'll also want an ambient_generic with the sound "World.LightPowerOnMd".

For outputs (all from the func_button):
- "OnIn" set the base + stand Skin to 1.
- "OnOut" set the base+stand Skin to 0.
- "OnPressed" "PlaySound" the ambient_generic.
- "OnPressed" trigger whatever you want the button to do.

There is no func_button for me Where do i find it?

Avatar
TeamSpen210
608 Posts
Posted Jul 17, 2014
Replied 1 hour later
Func_buttons are brush entities, press control-t when selecting a world brush to convert it.
Avatar
Arachnaphob
412 Posts
Posted Jul 17, 2014
Replied 1 minute later
It's a brush entity, so while the invisible/nodraw brush is selected, press CTRL+T and it will make it a func_detail. From there, change it to a func_button. It's very similar to the method to create triggers.
Advertisement
Registered users don't see ads! Register now!
Avatar
kyleprotecX
116 Posts
Posted Jul 18, 2014
Replied 1 day later
Thanks for your help guys