1 Player screen overlay

Discussion in 'Mapping Questions & Discussion' started by KaidemonLP, Aug 1, 2017.

  1. KaidemonLP

    KaidemonLP L4: Comfortable Member

    Messages:
    195
    Positive Ratings:
    33
    What i mean by this is that i would like that when a player activates a trigger that that exaact player gets a overlay.

    If i need to be specific id like to add the water overlay.
     
  2. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    779
    Positive Ratings:
    226
    It can be done via a point_clientcommand. Assuming you are using a trigger_multiple for your trigger, give it the following outputs:
    Code:
    OnStartTouch | [point_clientcommand] | Command | r_screenoverlay <overlay texture> | 0.00
    OnStartTouch | [point_clientcommand] | Command | r_screenoverlay overlays/ | 5.00
    The 2nd output will make the displayed overlay disappear by replacing it with an invalid material.

    You will also need to make sure your overlay has some transparency to it so players aren't completely blinded while it's on screen, and using "UnlitGeneric" as it's not part of the physical map so won't receive any lighting info. Like so:
    Code:
    "UnlitGeneric"
    {
       "$basetexture" "<your texture here>"
       "$translucent" "1"
    }
    The important thing to note here is that point_clientcommand is locked behind the 'sv_allow_point_servercommand' cvar, meaning any servers running your map will need to set the cvar to 'allow' in order for it to work.
    EDIT: The 'sv_allow_point_servercommand' isn't needed as the 'r_screenoverlay' command is allowed by default.
     
    • Thanks Thanks x 2
    • Like Like x 1
    Last edited: Aug 1, 2017
  3. Lampenpam

    aa Lampenpam

    Messages:
    1,019
    Positive Ratings:
    337
    Does sv_allow_point_servercommand 0 also prevent point_clientcommands from working?
     
  4. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    779
    Positive Ratings:
    226
    'sv_allow_point_servercommand' isn't an on/off cvar, so doesn't use 1/0 inputs. It's available inputs are:
    • "disallow" - Always disallows.
    • "official" - Allowed for valve maps only. (Default setting)
    • "always" - Allow for all maps.
    But yes, that cvar controls both point_servercommand and point_clientcommand entities.
     
  5. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    182
    Positive Ratings:
    37
    You sure? In my experience, that command has never affected point_clientcommand entities. In fact, I just went on a map of mine which forces the player to slot3 using a point_clientcommand. I had sv_allow_point_servercommand set to never and it still switched me to slot3.

    Most commands don't work with a point_clientcommand and you can find all the ones that the server can execute by typing this into console:
    Code:
    findflags server_can_execute
    Those commands should always work, regardless of what sv_allow_point_servercommand is set to.

    just a side note, a point_clientcommand will usually ignore server_can_execute if you're running the map on a listen server.
     
  6. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    779
    Positive Ratings:
    226
    I stand corrected, the cvar isn't needed. I was fairly certain that 'r_screenoverlay' would get blocked because an admin could blind players or at least obstruct their view with a malicious texture.

    But for anyone else who wants to know, here's that list:
    Code:
    ] findflags server_can_execute
    "cl_soundscape_flush"
    client cheat server_can_execute
    - Flushes the client side soundscapes
    "thirdperson"
    client cheat server_can_execute
    - Switch to thirdperson camera.
    "firstperson"
    client server_can_execute
    - Switch to firstperson camera.
    "playgamesound"
    client server_can_execute clientcmd_can_execute
    - Play a sound from the game sounds txt file
    "r_screenoverlay"
    client cheat server_can_execute
    - Draw specified material as an overlay
    "slot1"
    client server_can_execute
    "slot2"
    client server_can_execute
    "slot3"
    client server_can_execute
    "slot4"
    client server_can_execute
    "slot5"
    client server_can_execute
    "slot6"
    client server_can_execute
    "slot7"
    client server_can_execute
    "slot8"
    client server_can_execute
    "slot9"
    client server_can_execute
    "slot0"
    client server_can_execute
    "slot10"
    client server_can_execute
    "cancelselect"
    client server_can_execute
    "invnext"
    client server_can_execute
    "invprev"
    client server_can_execute
    "lastinv"
    client server_can_execute
    "cl_spec_mode" = "5" ( def. "1" )
    client archive server_can_execute
    - spectator mode
    "+inspect"
    client server_can_execute
    "-inspect"
    client server_can_execute
    "slot11"
    client server_can_execute
    "slot12"
    client server_can_execute
    "play"
    server_can_execute
    - Play a sound.
    "sndplaydelay"
    server_can_execute
    - Usage:  sndplaydelay delay_in_sec (negative to skip ahead) soundname
    "dsp_player" = "0"
    server_can_execute
    "name" = "[GmT] Werewolf [GB/UK]" ( def. "unnamed" )
    archive server_can_execute
    - Current user name
    "retry"
    server_can_execute clientcmd_can_execute
    - Retry connection to last server.
    "redirect"
    server_can_execute
    - Redirect client to specified server.
    "r_cleardecals"
    server_can_execute clientcmd_can_execute
    - Usage r_cleardecals <permanent>.
    "echo"
    server_can_execute
    - Echo text to console.
    "soundfade"
    server_can_execute
    - Fade client volume.
    
     
    • Like Like x 1
  7. Fragancia

    Fragancia L2: Junior Member

    Messages:
    85
    Positive Ratings:
    29
    Hang on, I thought r_screenoverlay was locked behind sv_cheats?
    Findflags even says it's a cheat?
     
  8. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    182
    Positive Ratings:
    37
    Yeah, it's still a cheat command. I suppose server_can_execute only shows you literally what the server can execute whether it's with cheats on or off.

    I tried making a test map for it and, although it did work, console told me I needed cheats enabled. Enabling cheats got it to work. Since you can't turn on cheats without sv_allow_point_servercommand always, it's probably a no-go.
     
  9. Fragancia

    Fragancia L2: Junior Member

    Messages:
    85
    Positive Ratings:
    29
    Definitely a no-go, turning on sv_cheats poses a great threat to security and any server operator worth their salt would never allow it to be enabled on their servers by anything.

    The way Werewolf wrote his post in response to OP's problem made me think r_screenoverlay for some reason got available for mappers to use through some recent update which prompted me to make that previous post of mine.
     
  10. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    182
    Positive Ratings:
    37
    You could always do the sv_cheats 1;hurtme -39429;sv_cheats 0 method. You can have the trigger enable and disable cheats fast enough that players can't abuse it. The only problem with that is that there is a microsecond window where players could spam a bind and possibly make it though.

    Furthermore, the server usually prints to chat anytime a change is made which warrants a change in the server tags, as sv_cheats does.

    Also, going on what I said before - thirdperson is also listed under server_can_execute, but it's a cheat command as well.
     
  11. KaidemonLP

    KaidemonLP L4: Comfortable Member

    Messages:
    195
    Positive Ratings:
    33
    Question what should the Target be?
    EDIT: Stupid question
     
    Last edited: Aug 26, 2017
  12. Startacker!

    aa Startacker! L⛧: Hell's Bells

    Messages:
    212
    Positive Ratings:
    198
    !activator
     
  13. KaidemonLP

    KaidemonLP L4: Comfortable Member

    Messages:
    195
    Positive Ratings:
    33
    Nope, the commands dont work unless it has sv_cheats 1
     
  14. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    779
    Positive Ratings:
    226
    Which commands?
     
  15. KaidemonLP

    KaidemonLP L4: Comfortable Member

    Messages:
    195
    Positive Ratings:
    33
    The r_screenoverlay.