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 01-31-2020 12:38

Re: [L4D2 & CS:GO] VScript File Replacer (1.4) [22-Jan-2020]
 
You could try:

PHP Code:

    "c1m4_atrium"
    
{
        
"c1m4_atrium_finale"
        
{
            
"regex" "2"
            ".+CustomFinale6.+= TANK\r\n.+= 1"            "    A_CustomFinale6 = TANK\n    A_CustomFinaleValue6 = 3"
        
}
    } 

This will work, but note you have to put in the values "6" or in your case "3" because the plugin will search and replace the whole matched string. So it might be easier to just override the file and make the changes you need. Also Linux might handle newlines differently so "\n" instead of "\r\n" which is a Windows thing. You can modify the config, load the map, make various changes to "data/vscripts_override.cfg" and use "sm_vs_reload" to load the new config, then check in the "scripts/vscripts_override" folder if it's actually modified correctly.

The plugin could be made more powerful by using key identifiers to surround and replace only certain parts of the string, eg "CustomFinaleValue[0-9] = {{{3}}}" and whatever is inbetween "{{{}}}" will be replaced with what you specify, but at this time it's not something I plan to add. If more people request I'll consider it. Theres also the possibility that adding such an identifier would conflict with what's written in scripts, e.g. cause false positive, however making it unique enough should suffice. Again, not a current feature and no plan to add.

Use https://regex101.com/ or other equivalent to test RegEx strings.

Marttt 02-01-2020 13:46

Re: [L4D2 & CS:GO] VScript File Replacer (1.4) [22-Jan-2020]
 
@DARG367

I did some tests with the regex that Silvers provided and I could make it work on finales (I'm using the latest version of the plugin [22-Jan-2020]).
The finale didn't bug and I could finish the map.

The snippet above will:
  • Replaces all vscripts with this config
  • Allows spawning of both witches/tanks
  • Set the required amount of 2 tanks being killed to go to next finale trigger.

Notes:
  • Tested on Windows OS
  • If you need to change the amount of tanks on finale just replace the end of the strings
    e.g.: from ...CustomFinaleValue1 = 2" to ...CustomFinaleValue1 = 3"
  • If your server has some "Tank Limit", e.g. 2, and you set it to 3, it will still spawn 2 tanks, but after the first one is dead, it will spawn another one, then the next finale trigger will not fire until have 3 tanks killed.
  • I made it from A_CustomFinale[0-51] because it seems that the c1m4_atrium map has 51 finale triggers.

Spoiler

DARG367 02-01-2020 14:19

Re: [L4D2 & CS:GO] VScript File Replacer (1.4) [22-Jan-2020]
 
Thanks, Silvers and Marttt for the information! I will definitely try these out!

Silvers 02-02-2020 20:00

Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
 
Code:

1.5 (03-Feb-2020)
    - Fixed previous update breaking support for scripts within folders. Thanks to "Marttt" for reporting.


Mi.Cura 02-05-2020 10:27

Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
 
Hello Silvers, can help please, i'm use last version.

I received this in the LOG.

L 02/05/2020 - 16:38:27: SourceMod error session started
L 02/05/2020 - 16:38:27: Info (map "c5m1_waterfront") (file "d:\tcafiles\users\34149\left4dead2\addons\so urcemod\logs\errors_20200205.log")
L 02/05/2020 - 16:38:27: [SM] Exception reported: Script execution timed out
L 02/05/2020 - 16:38:27: [SM] Blaming: vscript_replacer.smx
L 02/05/2020 - 16:38:27: [SM] Call stack trace:
L 02/05/2020 - 16:38:27: [SM] [1] Line 675, D:\Games e Programas\PLUGINS\sourcemod-1.10.0-git6460-windows\addons\sourcemod\scripting\vscript_re placer.sp::SaveFile
L 02/05/2020 - 16:38:27: [SM] [2] Line 602, D:\Games e Programas\PLUGINS\sourcemod-1.10.0-git6460-windows\addons\sourcemod\scripting\vscript_re placer.sp::ValidateFileSave
L 02/05/2020 - 16:38:27: [SM] [3] Line 575, D:\Games e Programas\PLUGINS\sourcemod-1.10.0-git6460-windows\addons\sourcemod\scripting\vscript_re placer.sp::SaveOverrides
L 02/05/2020 - 16:38:27: [SM] [4] Line 429, D:\Games e Programas\PLUGINS\sourcemod-1.10.0-git6460-windows\addons\sourcemod\scripting\vscript_re placer.sp::ResetPlugin
L 02/05/2020 - 16:38:27: [SM] [5] Line 375, D:\Games e Programas\PLUGINS\sourcemod-1.10.0-git6460-windows\addons\sourcemod\scripting\vscript_re placer.sp::VScriptServerCompileScript
L 02/05/2020 - 16:44:23: Error log file session closed.

P.S, thanks for sharing this plugin :)

Silvers 02-05-2020 19:18

Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
 
Quote:

Originally Posted by Mi.Cura (Post 2682823)
Hello Silvers, can help please, i'm use last version.

Any modifications to the source? PM me your data/vscript_override.cfg.

For me it takes 0.5 seconds to dump all vscripts and make changes, so as Marttt said your RegEx maybe too complicated causing delay.

GoGetSomeSleep 03-18-2020 19:54

Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
 
<Bad Load> vscript_replacer.smx
vscript_replacer.smx: Unable to load plugin (no debug string table)

DHooks (2.2.0-detours9): Dynamic Hooks

SourceMod Version: 1.9.0.6282
SourcePawn Engine: 1.9.0.6282, jit-x86 (build 1.9.0.6282)

Silvers 03-18-2020 23:07

Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
 
Quote:

Originally Posted by GoGetSomeSleep (Post 2687537)
<Bad Load> vscript_replacer.smx
vscript_replacer.smx: Unable to load plugin (no debug string table)

DHooks (2.2.0-detours9): Dynamic Hooks

SourceMod Version: 1.9.0.6282
SourcePawn Engine: 1.9.0.6282, jit-x86 (build 1.9.0.6282)

Means plugin was compiled with 1.10. Update to 1.10 or compile yourself.

Voevoda 05-22-2020 11:02

Re: [L4D2 & CS:GO] VScript File Replacer (1.7) [10-May-2020]
 
Quote:

L 05/22/2020 - 16:10:07: SourceMod error session started
L 05/22/2020 - 16:10:07: Info (map "c9m2_lots") (file "/home/l4d2_eq_coop/serverfiles/left4dead2/addons/sourcemod/logs/errors_20200522.log")
L 05/22/2020 - 16:10:07: [vscript_replacer.smx] Failed to open file for reading: "scripts/vscripts/vscripts_custom/c9m2_lots_finale.nut"
L 05/22/2020 - 16:10:07: [vscript_replacer.smx] Missing file: Cannot find VScript "scripts/vscripts/vscripts_override/c9m2_lots_finale.nut" to override.
L 05/22/2020 - 16:31:31: Error log file session closed.
L 05/22/2020 - 17:45:34: SourceMod error session started
L 05/22/2020 - 17:45:34: Info (map "c8m5_rooftop") (file "/home/l4d2_eq_coop/serverfiles/left4dead2/addons/sourcemod/logs/errors_20200522.log")
L 05/22/2020 - 17:45:34: [vscript_replacer.smx] Failed to open file for reading: "scripts/vscripts/vscripts_custom/c8m5_rooftop_finale.nut"
L 05/22/2020 - 17:45:34: [vscript_replacer.smx] Missing file: Cannot find VScript "scripts/vscripts/vscripts_override/c8m5_rooftop_finale.nut" to override.
L 05/22/2020 - 17:52:41: [DefibFix] Player NOT FOUND. Using default engine logic.
L 05/22/2020 - 17:53:45: Error log file session closed.

help

Silvers 05-22-2020 11:15

Re: [L4D2 & CS:GO] VScript File Replacer (1.7) [10-May-2020]
 
Please read the error.
Quote:

Missing file: Cannot find VScript "scripts/vscripts/vscripts_override/c8m5_rooftop_finale.nut" to override.


All times are GMT -4. The time now is 22:26.

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