How to show who is talking with demos

Discussion in 'TTT Discussion' started by Python~, Mar 26, 2017.

  1. Python~

    Python~ Young Bard VIP Silver Emerald

    As someone who doesn't have a computer that can handle 3rd party recording software, this was extremely helpful. I can now catch micspammers and loopholers much easier than before, and it still takes nothing to run

    First, go here
    [​IMG]

    As you can see, I have a df.lua file saved at the bottom.

    Open up a notepad and paste the following:

    Code:
    if not engine.IsPlayingDemo() then return end
    
    local function CreateVoiceVGUI()
        g_VoicePanelList = vgui.Create( "DPanel" )
    
        g_VoicePanelList:ParentToHUD()
        g_VoicePanelList:SetPos(25, 25)
        g_VoicePanelList:SetSize(200, ScrH() - 200)
        g_VoicePanelList:SetDrawBackground(false)
    
        MutedState = vgui.Create("DLabel")
        MutedState:SetPos(ScrW() - 200, ScrH() - 50)
        MutedState:SetSize(200, 50)
        MutedState:SetFont("Trebuchet18")
        MutedState:SetText("")
        MutedState:SetTextColor(Color(240, 240, 240, 250))
        MutedState:SetVisible(false)
    
        print("Created voice panel.")
    end
    
    function VOICE.Tick() end -- fix console error spam (this function previously handled voice battery; doesn't matter in demos).
    
    CreateVoiceVGUI()
    Save it under All Files and title it df.lua

    To prevent the Script Errors at the top left, go to the following:
    [​IMG]
    Open 'errors' in Notepad
    All I did was change
    Code:
    local text = "Something is creating script errors"
    to
    Code:
    local text = "i"
    This will tell you that there are errors, but won't get in the way of a person using their mic

    Next, open GMod and type "sv_allowcslua 1" in console
    Then bind a key to "lua_openscript_cl df.lua" (e.g. 'bind KP_Home "lua_openscript_cl df.lua"')

    Now, when you run a demo, press the key you bound and mics should appear

    Huge thanks to @Verified and @Agent A for these tips
     
    Last edited by a moderator: May 8, 2017
    • Informative Informative x 4
    • Like Like x 3
  2. veri

    veri Creating Order VIP Silver

    Step 3 shouldn't be needed. If you're getting script errors paste the error here and I'll modify the script to account for them.

    EDIT: Also that change will be lost when gmod updates.
     
  3. Python~

    Python~ Young Bard VIP Silver Emerald

    Easy enough fix for me, but how would you recommend getting rid of em?
     
  4. Xproplayer

    Xproplayer VIP Silver

    Why are you guys making the lua file in the root folder then manually executing it, just put it in lua autorun? It shouldn't affect gameplay on SGM as allowcslua would be disabled.
     
    • Like Like x 2
  5. veri

    veri Creating Order VIP Silver

    Lua files in autorun don't get executed in demos. (At least in my brief testing)
     
    Last edited: Mar 26, 2017
  6. Frosty

    Frosty Stay frosty! VIP

    Does this still work?
     
    • Dumb Dumb x 1
  7. iii

    iii eye-eye-eye or triple eye is fine VIP

  8. Sticky Bandit

    Sticky Bandit Never fall below your standard Banned Legendary

    Step 1) Download demovoicefix.lua (credit to Yatty, not me)
    step 2) Navigate to your garry's mod directory
    1) Right click Garry's Mod in steam and click properties
    2) Click Local Files in the menu that pops up
    3) Click browse local files
    Step 3) go to garrysmod/lua
    Step 4) put demovoicefix.lua in there
    Step 5) In Garry's Mod open your console and type
    Code:
    sv_allowcslua 1
    Step 6) Load the demo. (This can be done before step 5 but is easier if done after allowing cs lua)
    Step 7) Open your console and type
    Code:
    lua_openscript_cl demovoicefix.lua
    Then in the future, you can absolutely make this a bind.
    You will now be able to see who is speaking - it will appear in the bottom right.
    Code:
    bind <KEY> "sv_allowcslua 1;lua_openscript_cl demovoicefix.lua"
    This script moves the voice boxes from the top left (where demos get plagued with script errors) to the bottom right.
     
  9. Timo654

    Timo654 EU BEST VIP Silver

    does this also work in deathrun?
     
  10. Xproplayer

    Xproplayer VIP Silver

    After reading the lua, this would probably work in any gamemode.
     
  11. Timo654

    Timo654 EU BEST VIP Silver

    Alright, thanks. I remember some error due to mic batteries or something, can't remember what script it was with though.
     
  12. Sticky Bandit

    Sticky Bandit Never fall below your standard Banned Legendary

    This should work in all Garry's Mod gamemodes. The script just see's that some nigga is talking, then goes "ok I put that nigga the bottom right". It is independent of any custom huds or anything like that on any Garry's Mod server.
     
    • Useful Useful x 2
    • Funny Funny x 1