A fix for 99% of demo errors (including voice and sgm models)

Discussion in 'TTT Discussion' started by iii, Nov 12, 2020.

  1. iii

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

    So I've discovered in the past few hours that it's possible to actually fix most demo errors, instead of just patching them by remaking the voice boxes (like these previous ones: [1] and [2]) and then optionally hiding the errors in some ways (like filtering the console and editing the lua file that draws the errors).

    What I found, and made, is something to get the original voice boxes working, without the voice related errors, and if you aren't subscribed to the SGM addons (and therefore custom models and textures are errors in demos) how to get those to automatically work like they do in the server normally as well.

    Here's a video of the fix in action:


    There may or may not already have been a fix like this, though it doesn't seem that it was shared on the forums, so I am sharing mine. This is the script for anyone curious:


    I've uploaded the script(without the code comments) to dropbox and it can be downloaded here:
    https://www.dropbox.com/s/md213yxlb9jcp9c/fix_demo.lua

    The process to use it is the same as the previous fixes:
    1. Download the file and put it on Garry's Mod's lua folder, which by default (on Windows) if your gmod isn't installed somewhere else, you can get there by putting one of these links in your windows search bar:
      • for 64-bits PCs:
        • %PROGRAMFILES(x86)%\Steam\steamapps\common\GarrysMod\garrysmod\lua
      • for 32-bits PCs:
        • %PROGRAMFILES%\Steam\steamapps\common\GarrysMod\garrysmod\lua
    2. In Garry's Mod, in the menu, open the console and make sure you have sv_cheats set to 1 (by typing sv_cheats or sv_cheats 1).
      • sv_cheats should stay on 1 for most of the time even if you close/reopen GMod, but I've had it randomly change to 0 again.
    3. Open the demo you want to watch(with the playdemo command or the demo menu), I recommend typing demoui in console before you open it so that you can quickly pause it when it loads and run the script.
      • if you are playing demos with the playdemo command you can do both by typing something like this: playdemo "hacker123";demoui
    4. Go back to the console and run the script using this command: lua_openscript_cl fix_demo.lua
      • you might need to close the demoui menu to access the console.
      • if you are using the playdemo demoname;demoui method you can side-step this problem by pressing key to open the console while the demo is loading.

    edit: fixed a error I made while editing, if you already downloaded the script please download it again in like, 2 minutes.
    edit 2: file reuploaded.
    edit 3: actually please download it AGAIN (hopefully no one did yet), because my brain is fried and I didn't actually fix it in the file, typed the wrong thing like a dumbass :cry:.
    Actually tested it this time, sorry for making such a mess of this.
    edit 4: added a video of the script working.
     
    Last edited: Nov 12, 2020
    • Like Like x 3
  2. iii

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

    This doesn't seem to be working anymore... I'll update it if I figure out what the problem is
    [​IMG]

    Line 25, the last line of the code (the code with the comments at least), that calls the InitPostEntity hook (and therefore fixed all the problems by actually initializing things that hadn't been initialized) is generating an error internally...

    What that error is, I don't know, just that it has something to do with DPropertySheet, which might be related to the similarly named "makepropertysheet" in the middle section.

    Also if anyone knows how to fix this and wants to share, you're welcome to.
     
    • Like Like x 3