Raised This Month: $12 Target: $400
 3% 

[L4D2/CS:GO/TF2/NMRiH] VScript File Replacer (1.17) [28-Jan-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6676
Plugin Version:
1.17
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    52 
    Plugin Description:
    Replaces any VScript file with a custom one. Modify lines or the whole file.
    Old 08-09-2019 , 19:00   [L4D2/CS:GO/TF2/NMRiH] VScript File Replacer (1.17) [28-Jan-2024]
    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.
    • Some games or maps will have embedded and possibly encrypted scripts preventing any reasonable method to modify them. This plugin makes that happen.



    Supported Games:
    • CS:GO
    • L4D2
    • NMRiH
    • TF2
    • Can be extended to other games which use VScripts. Please request if required.



    Related Plugins:


    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:

    Saved to vscript_replacer.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Off. 1=Print to server. 2=Print to chat. 4=Verbose logging. Add numbers together.
    vscript_replacer_debug "0"

    // 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.17 (28-Jan-2024)
        - Fixed memory leak caused by clearing StringMap/ArrayList data instead of deleting.
    
    1.16 (10-Mar-2023)
        - Changed command "sm_vs_dump" to display the number of scripts dumped.
        - Fixed error when no VScript files or directories exist. Thanks to "Sreaper" for reporting.
    
    1.15 (20-Dec-2022)
        - Added support for Team Fortress 2.
        - GameData file and plugin updated.
    
    1.14 (15-Oct-2022)
        - Added an include file for other plugins to require this plugin.
        - Added registering the plugin library as "vscript_replacer" for plugins to detect.
    
    1.13 (15-Jul-2022)
        - Increased buffer size. Thanks to "Psyk0tik" for reporting.
    
    1.12 (03-Jun-2022)
        - Added support for "NMRiH" game. Thanks to "Dysphie" for the signatures.
        - GameData file and plugin updated.
    
    1.11 (07-Oct-2021)
        - Fixed compile errors on SourcecMod version 1.11. Thanks to "Hajitek Majitek" for reporting.
        - Thanks to "asherkin" for helping fix.
    
    1.10a (10-Apr-2021)
        - Minor change to "vscript_replacer.cfg" for demonstrating regex in map names. Thanks to "Tonblader" for reporting.
    
    1.10 (04-Mar-2021)
        - Added ConVar "vscript_replacer_debug" to enable debugging with options for verbose debugging and printing to chat or server.
        - ConVar config is saved as "vscript_replacer.cfg" filename in your servers standard "cfg/sourcemods" folder.
    
    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 (35.3 KB, 63 views)
    __________________

    Last edited by Silvers; 01-28-2024 at 02:35.
    Silvers is offline
    xZk
    Senior Member
    Join Date: Nov 2017
    Location: cl
    Old 08-09-2019 , 22: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
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 08-10-2019 , 12:10   Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
    Reply With Quote #3

    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
    zipcore
    Veteran Member
    Join Date: Mar 2010
    Location: m_flZipcore
    Old 08-10-2019 , 07:44   Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
    Reply With Quote #4

    Awesome stuff
    __________________
    zipcore is offline
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 09-07-2019 , 06: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 , 20: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
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 10-31-2019 , 22: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 , 18: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, 449 views)

    Last edited by xZk; 01-15-2020 at 18:35.
    xZk is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 01-15-2020 , 18: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 , 21: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 17:26.


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