Power switch

Cynder loves Portal

L420: High Member
Jan 9, 2016
434
103
I'm trying to make a power switch.

The logic is already in place and working.

I just can't seem to make the switch rotate. I can make it go straight down though.

I tried using a func_button_rotate but no joy.
I'm currently using a func_button to do the power lever.

I'm trying to make it ]/ to ]\

I've tried 45 -90 0 on the direction settings.

I put the centre circle on the breaker end of the switch but it won't rotate.

Can you guys please point me in the right direction.


Thanks
 

Box Of Paper

L3: Member
Jul 15, 2019
111
143
func_rot_button doesn't seem to respond when damaged (ent_messages_draw doesn't even show the output happening).
However the "Press", "PressIn" and "PressOut" inputs work.
I've attached a .vmf with two examples of power switches, I hope they help.

01.jpg 10.jpg

Summed up the logic consists in hitting a func_button (invisible because of the Block Bullets texture) which triggers two logic_relays and toggles them from enbled to disabled and vice versa.
The relays turn on and off the light and rotate the power switch as well.

Note: One of the two relays has to start disabled, make sure that the func_button's output are set up in the correct order (the outputs trigger starting from the bottom and going up if they have the same delay).
Also make sure that the func_rot_button's "Toggle" flag is set.
 

Attachments

  • PowerSwitch.vmf
    40.9 KB · Views: 97
Last edited:

Cynder loves Portal

L420: High Member
Jan 9, 2016
434
103
DTNF324_1329642060__76652.1459284773.960.960.jpg


I'm trying for something like this.
The vmf in the post above will hopefully point me in the right direction.
 
Last edited:

Box Of Paper

L3: Member
Jul 15, 2019
111
143
I tried recreating one.
 

Attachments

  • SafetySwitch.vmf
    47 KB · Views: 96

Cynder loves Portal

L420: High Member
Jan 9, 2016
434
103
That recreation has pointed my in the right direction and it works perfectly!

Thanks for pointing me in the right direction!
 

Cynder loves Portal

L420: High Member
Jan 9, 2016
434
103
gm_construct_cdlp_remix20001.jpg


What do you think?
 

Box Of Paper

L3: Member
Jul 15, 2019
111
143
Looking good!
But the red texture looks more like wood than plastic/metal.
Also isn't it possible to make the High Voltage sign an overlay? (so that it doesn't stretch the whole width of the brush)
 

Cynder loves Portal

L420: High Member
Jan 9, 2016
434
103
I'm not very good with overlays.
 

Box Of Paper

L3: Member
Jul 15, 2019
111
143
Oh but they are easy, just know that they can only be placed on world geometry or func_detail, and if you need to resize them just place their center (the info_overlay entity origin) where you want and with SmartEdit change the 4 points (uv0, uv1, uv2, uv3) to the coordinates you want.
The overlay must have a brush face selected, you can "Pick..." one if you aren't using SmartEdit.

To avoid complications I simply place it where I need, then with SmartEdit I set the 4 points to either a square or a rectangle depending on the material.

If the overlay disappears its probably because the selected brush faces have changed ID (It happens if the brush is clipped*), just set them back up.
*if you need to change the brush shape use the Vertex Tool.

Useless stuff:
-The UV coordinates are relative to the entity origin (BasisOrigin):
uv0 is the top right point
uv1 is the bottom right point
uv2 is the bottom left point
uv3 is the top left point
-Hammer's UV axis is weird:
HammerUVaxis.png
-BasisNormal, BasisU, and BasisV are the plane's angles.
-StartU, EndU, StartV, and EndV are basicly the texture's scale, use these if you want to mirror the material.
-You can actually set more than one face (Format: "Brush faces | 12 14 16", where the numbers are the faces ID), the overlay will be spread on the surfaces as if projected using the BasisU/V/Normal angles.
front.jpg notfront.jpg
 
Last edited: