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
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 01-31-2020 , 13:38   Re: [L4D2 & CS:GO] VScript File Replacer (1.4) [22-Jan-2020]
Reply With Quote #21

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.
__________________
Silvers is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 02-01-2020 , 14:46   Re: [L4D2 & CS:GO] VScript File Replacer (1.4) [22-Jan-2020]
Reply With Quote #22

@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
__________________

Last edited by Marttt; 02-02-2020 at 07:41.
Marttt is offline
DARG367
AlliedModders Donor
Join Date: Aug 2018
Location: Vancouver, British Colum
Old 02-01-2020 , 15:19   Re: [L4D2 & CS:GO] VScript File Replacer (1.4) [22-Jan-2020]
Reply With Quote #23

Thanks, Silvers and Marttt for the information! I will definitely try these out!
__________________
DARG367 is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 02-02-2020 , 21:00   Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
Reply With Quote #24

Code:
1.5 (03-Feb-2020)
    - Fixed previous update breaking support for scripts within folders. Thanks to "Marttt" for reporting.
__________________
Silvers is offline
Mi.Cura
Senior Member
Join Date: Dec 2016
Location: Brazil
Old 02-05-2020 , 11:27   Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
Reply With Quote #25

Hello Silvers, can help please, i'm use last version.

I received this in the LOG.

L 02/05/2020 - 168:27: SourceMod error session started
L 02/05/2020 - 168:27: Info (map "c5m1_waterfront") (file "d:\tcafiles\users\34149\left4dead2\addons\so urcemod\logs\errors_20200205.log")
L 02/05/2020 - 168:27: [SM] Exception reported: Script execution timed out
L 02/05/2020 - 168:27: [SM] Blaming: vscript_replacer.smx
L 02/05/2020 - 168:27: [SM] Call stack trace:
L 02/05/2020 - 168: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 - 168: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 - 168: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 - 168: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 - 168: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
__________________

Last edited by Mi.Cura; 02-05-2020 at 15:57.
Mi.Cura is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 02-05-2020 , 20:18   Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
Reply With Quote #26

Quote:
Originally Posted by Mi.Cura View Post
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.
__________________
Silvers is offline
GoGetSomeSleep
Member
Join Date: Dec 2018
Location: Miami/Florida
Old 03-18-2020 , 20:54   Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
Reply With Quote #27

<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)

Last edited by GoGetSomeSleep; 03-18-2020 at 20:59.
GoGetSomeSleep is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 03-19-2020 , 00:07   Re: [L4D2 & CS:GO] VScript File Replacer (1.5) [03-Feb-2020]
Reply With Quote #28

Quote:
Originally Posted by GoGetSomeSleep View Post
<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.
__________________
Silvers is offline
Voevoda
Senior Member
Join Date: Aug 2016
Old 05-22-2020 , 12:02   Re: [L4D2 & CS:GO] VScript File Replacer (1.7) [10-May-2020]
Reply With Quote #29

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 - 1611: Error log file session closed.
L 05/22/2020 - 17:454: SourceMod error session started
L 05/22/2020 - 17:454: Info (map "c8m5_rooftop") (file "/home/l4d2_eq_coop/serverfiles/left4dead2/addons/sourcemod/logs/errors_20200522.log")
L 05/22/2020 - 17:454: [vscript_replacer.smx] Failed to open file for reading: "scripts/vscripts/vscripts_custom/c8m5_rooftop_finale.nut"
L 05/22/2020 - 17:454: [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
Voevoda is offline
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Old 05-22-2020 , 12:15   Re: [L4D2 & CS:GO] VScript File Replacer (1.7) [10-May-2020]
Reply With Quote #30

Please read the error.
Quote:
Missing file: Cannot find VScript "scripts/vscripts/vscripts_override/c8m5_rooftop_finale.nut" to override.
__________________
Silvers 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 14:15.


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