AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2/CS:GO/TF2/NMRiH] VScript File Replacer (1.17) [28-Jan-2024] (https://forums.alliedmods.net/showthread.php?t=318024)

Silvers 08-09-2019 19:00

[L4D2/CS:GO/TF2/NMRiH] VScript File Replacer (1.17) [28-Jan-2024]
 
27 Attachment(s)
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.

xZk 08-09-2019 22:47

Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
 
Amazing!, could this also apply to the final campaigns?
https://developer.valvesoftware.com/.../Custom_Finale

zipcore 08-10-2019 07:44

Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
 
Awesome stuff

Silvers 08-10-2019 12:10

Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
 
Quote:

Originally Posted by xZk (Post 2662717)
Amazing!, could this also apply to the final campaigns?
https://developer.valvesoftware.com/.../Custom_Finale

Yep

asherkin 09-07-2019 06:22

Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
 
This is awesome, very nice work.

joyist 09-08-2019 20:34

Re: [L4D2 & CS:GO] VScript File Replacer (1.0) [10-Aug-2019]
 
Good job

Silvers 10-31-2019 22:36

Re: [L4D2 & CS:GO] VScript File Replacer (1.1) [01-Nov-2019]
 
Quote:

Originally Posted by asherkin (Post 2666174)
This is awesome, very nice work.

Quote:

Originally Posted by joyist (Post 2666350)
Good job

Thank you :up:


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.


xZk 01-15-2020 18:32

Re: [L4D2 & CS:GO] VScript File Replacer (1.1) [01-Nov-2019]
 
1 Attachment(s)
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

Silvers 01-15-2020 18:36

Re: [L4D2 & CS:GO] VScript File Replacer (1.1) [01-Nov-2019]
 
Should work fine. Is there a problem?

xZk 01-15-2020 21:41

Re: [L4D2 & CS:GO] VScript File Replacer (1.1) [01-Nov-2019]
 
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 :/


All times are GMT -4. The time now is 01:03.

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