Power switch

Discussion in 'Mapping Questions & Discussion' started by Cynder loves Portal, Aug 20, 2019.

  1. Cynder loves Portal

    Cynder loves Portal L7: Fancy Member

    Messages:
    437
    Positive Ratings:
    54
    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
     
  2. Box Of Paper

    Box Of Paper L1: Registered

    Messages:
    14
    Positive Ratings:
    8
    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.
     

    Attached Files:

    • Thanks Thanks x 1
    • Like Like x 1
    Last edited: Sep 1, 2019
  3. Cynder loves Portal

    Cynder loves Portal L7: Fancy Member

    Messages:
    437
    Positive Ratings:
    54
    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: Aug 21, 2019
  4. Box Of Paper

    Box Of Paper L1: Registered

    Messages:
    14
    Positive Ratings:
    8
    I tried recreating one.
     

    Attached Files:

    • Thanks Thanks x 1
  5. Cynder loves Portal

    Cynder loves Portal L7: Fancy Member

    Messages:
    437
    Positive Ratings:
    54
    That recreation has pointed my in the right direction and it works perfectly!

    Thanks for pointing me in the right direction!
     
  6. Cynder loves Portal

    Cynder loves Portal L7: Fancy Member

    Messages:
    437
    Positive Ratings:
    54
    gm_construct_cdlp_remix20001.jpg

    What do you think?
     
  7. Box Of Paper

    Box Of Paper L1: Registered

    Messages:
    14
    Positive Ratings:
    8
    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)
     
  8. Cynder loves Portal

    Cynder loves Portal L7: Fancy Member

    Messages:
    437
    Positive Ratings:
    54
    I'm not very good with overlays.
     
  9. Box Of Paper

    Box Of Paper L1: Registered

    Messages:
    14
    Positive Ratings:
    8
    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: Aug 27, 2019