Raised This Month: $4 Target: $400
 1% 

[L4D2 & CS:GO] VScript File Replacer (1.9) [30-Sep-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6676
Plugin Version:
1.9
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    11 
    Plugin Description:
    Replaces any VScript file with a custom one. Modify lines or the whole file.
    Old 08-09-2019 , 20:00   [L4D2 & CS:GO] VScript File Replacer (1.9) [30-Sep-2020]
    Reply With Quote #1

    About:
    • Provides a config to specify which VScript files to override.
    • You can replace the whole script or search and replace specific strings.
    • Supports RegEx matching for filenames and for matching strings within the VScripts.
    • Currently supports: CS:GO and L4D2. Can be extended to other games which use VScripts. Please request if required.
    • Some games or maps will have embedded and possibly encrypted scripts preventing any reasonable method to modify them. This plugin makes that happen.



    Thanks:
    • "Peace-Maker" - Fixing dHooks SetParamString.
    • "Lux" - Testing
    • "Dragokas" - Testing
    • "Mr. Man" - Testing



    Admin Commands:
    • Requires "z" - ADMFLAG_ROOT flag
    PHP Code:
    sm_vs_dump       // Dumps all found VScripts from the servers /scripts/vscripts/ file system to /scripts/vscripts/vscripts_dump/. Automatically decodes if required.
    sm_vs_encrypt    // Usage: sm_vs_encrpt <filename.nut>. Encode the specified script, must be inside the servers /scripts/vscripts/ folder, include the extension.
    sm_vs_exec       // Usage: sm_vs_exec <filename>. Executes a VScript file. This is a wrapper to the script_execute command. Can recompile plugin to use logic_script instead.
    sm_vs_file       // Usage: sm_vs_file <filename>. Extracts the specified VScript from the Valve file system to the servers /scripts/vscripts/vscripts_dump/ folder. Automatically decodes if required.
    sm_vs_list       // Show data config tree of modified scripts for the current map.
    sm_vs_listen     // Toggle printing to server console the names of scripts being executed.
    sm_vs_reload     // Reloads the data config. This also replaces files in the override folder. 


    ConVars:
    PHP Code:
    // VScript File Replacer plugin version.
    vscript_replacer_version 



    Forward for developers:
    Spoiler




    Config:
    • Plugin data config saved to \addons\sourcemod\data\vscripts_override.cfg.

      Here is an example demonstrating various features and techniques.
      Spoiler



    Changes:
    Code:
    1.9 (30-Sep-2020)
        - Increased MAX_BUFFER size to support largest known VScript file sizes.
    
    1.8 (20-Jul-2020)
        - Fixed overrides not working. Not sure why this went undetected for so long.
    
    1.7 (10-May-2020)
        - Various changes to tidy up code.
        - Various optimizations and fixes.
    
    1.6 (05-May-2020)
        - Added forward "OnVScriptExecuted" to notify plugins when a script is executed (allows blocking or changing).
        - Changed script names to be case insensitive.
        - Fixed leaking handle when searching through directories.
        - Various small changes.
    
    1.5 (03-Feb-2020)
        - Fixed previous update breaking support for scripts within folders. Thanks to "Marttt" for reporting.
    
    1.4 (27-Jan-2020)
        - Updated "data/vscript_replacer.cfg" with Helms Deep new additions.
    
    1.4 (22-Jan-2020)
        - Added RegEx support for matching multiple script names.
        - Updated "data/vscript_replacer.cfg" to fix Helms Deep patches. All working now.
    
    1.3 (18-Jan-2020)
        - Changed command "sm_vs_exec" to use a logic_script instead, due to script_execute requiring sv_cheats.
        - Fixed not loading scripts where the filename is matched using regex. Thanks to "dustinandband" for reporting.
        - Fixed error when reporting duplicate keys in config.
        - Updated "data/vscript_replacer.cfg" to fix Helms Deep patches and added various critical cvars being changed.
    
    1.2 (16-Jan-2020)
        - Added command "sm_vs_exec" to execute a VScript file. This is a wrapper to the function "script_execute".
        - Fixed not using the specified "override" filename. Thanks to "xZk" for reporting.
    
    1.1b (11-Nov-2019)
        - Edited "data/vscripts_override.cfg" data config adding more Helms Deep fixes.
        - No plugin changes.
    
    1.1 (01-Nov-2019)
        - Added command "sm_vs_listen" to print to server console the names of scripts being executed.
        - Fixed command "sm_vs_dump" from copying files from the dump folder.
    
    1.0 (10-Aug-2019)
        - Initial release.


    Requirements:

    Installation:
    1. Download the .zip and extract the files to their respective folders in your servers \addons\sourcemod\ folder.
    Attached Files
    File Type: zip vscript_replacer.zip (31.3 KB, 115 views)
    __________________

    Last edited by Silvers; 09-30-2020 at 02:01.
    Silvers is offline
    xZk
    Senior Member
    Join Date: Nov 2017
    Location: cl
    Old 08-09-2019 , 23:47   Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
    Reply With Quote #2

    Amazing!, could this also apply to the final campaigns?
    https://developer.valvesoftware.com/.../Custom_Finale
    xZk is offline
    zipcore
    Veteran Member
    Join Date: Mar 2010
    Location: m_flZipcore
    Old 08-10-2019 , 08:44   Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
    Reply With Quote #3

    Awesome stuff
    __________________
    zipcore is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 08-10-2019 , 13:10   Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
    Reply With Quote #4

    Quote:
    Originally Posted by xZk View Post
    Amazing!, could this also apply to the final campaigns?
    https://developer.valvesoftware.com/.../Custom_Finale
    Yep
    __________________
    Silvers is offline
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 09-07-2019 , 07:22   Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
    Reply With Quote #5

    This is awesome, very nice work.
    __________________
    asherkin is offline
    joyist
    Member
    Join Date: Apr 2018
    Old 09-08-2019 , 21:34   Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
    Reply With Quote #6

    Good job
    __________________
    http://chdong.top/motd

    L4D2 CN CloudsSky Server group。
    My WebLabWebOS
    joyist is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 10-31-2019 , 23:36   Re: [L4D2 & CS:GO] VScript File Replacer (1.1) [01-Nov-2019]
    Reply With Quote #7

    Quote:
    Originally Posted by asherkin View Post
    This is awesome, very nice work.
    Quote:
    Originally Posted by joyist View Post
    Good job
    Thank you


    Code:
    1.1 (01-Nov-2019)
        - Added command "sm_vs_listen" to print to server console the names of scripts being executed.
        - Fixed command "sm_vs_dump" from copying files from the dump folder.
    __________________
    Silvers is offline
    xZk
    Senior Member
    Join Date: Nov 2017
    Location: cl
    Old 01-15-2020 , 19:32   Re: [L4D2 & CS:GO] VScript File Replacer (1.1) [01-Nov-2019]
    Reply With Quote #8

    Hi Silvers, What would it be like to overwrite a finale vscript?.
    for example, I added this in the cfg file:
    PHP Code:
      "c1m4_atrium"
        
    {
            
    // VScript filename to override, searches the Valve file system and gamedir.
            // This matches the script "some_vscript_file".
            
    "c1m4_atrium_finale"
            
    {
                
    // The "override" key is reserved for replacing the whole VScript file with a custom one, if both files exist.
                // The specified value must point to a filename in your servers /scripts/vscripts/vscripts_custom/ folder.
                // The file is copied to the your servers /scripts/vscripts/vscripts_override/ folder.
                
    "override"                                "c1m4_atrium_finale_custom"

                
    // Can still use other keys to find and replace strings within the override file.
                //"some_random_var = false;"                "some_random_var = true;"
            
    }
        } 
    i used the same file(c1m4_atrium_finale) obtained from the vscripts_dump folder, copied this to vscripts_custom folder and and rename it with "c1m4_atrium_finale_custom". But when the finale is activated it is as if the rescue arrived, will I have been wrong about something?
    pd: i tested this with sm1.9/1.10 on windows
    Attached Files
    File Type: cfg vscripts_override.cfg (4.3 KB, 136 views)

    Last edited by xZk; 01-15-2020 at 19:35.
    xZk is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 01-15-2020 , 19:36   Re: [L4D2 & CS:GO] VScript File Replacer (1.1) [01-Nov-2019]
    Reply With Quote #9

    Should work fine. Is there a problem?
    __________________
    Silvers is offline
    xZk
    Senior Member
    Join Date: Nov 2017
    Location: cl
    Old 01-15-2020 , 22:41   Re: [L4D2 & CS:GO] VScript File Replacer (1.1) [01-Nov-2019]
    Reply With Quote #10

    the problem is that the finale is buged when it's override, I just tried it with the finale of the concert and start the helicopter arrives immediately... it is as if the vscript does not read :/
    xZk is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 13:48.


    Powered by vBulletin®
    Copyright ©2000 - 2020, vBulletin Solutions, Inc.
    Theme made by Freecode