Left 4 Dead 2

Left 4 Dead 2

[VScript] More Infected Over Time
Nescius 29 Jul, 2024 @ 8:16pm
script improvement
Improved your script to be little more compatible with other modes and not break finale music. Left some comments in there too. Hopefully I made no errors

//don't overwrite the whole DirectorOptions because there are important options that need to stay there DirectorOptions.CommonLimit <- 30; DirectorOptions.MegaMobSize <- 50; DirectorOptions.MobMinSize <- 10; DirectorOptions.MobMaxSize <- 30; DirectorOptions.MobMaxPending <- 30; DirectorOptions.PreTankMobMax <- 50; DirectorOptions.BileMobSize <- 30; DirectorOptions.MaxSpecials <- 2; // as local variables you can access these anywhere below their definition in this file local okkg_last_set = 0; local okkg_randomint = 0; local okkg_isatmax = false; local okkg_leftsaferoom = false; // always put game events in your own scope for compatibility with other mods okkg_MIOT_scope <- { //no need for additional checks here it fires when survivor leave function OnGameEvent_player_left_safe_area(params) { okkg_leftsaferoom = true; } } __CollectGameEventCallbacks(okkg_MIOT_scope); // needed to register game events in okkg_MIOT_scope scope // using function named Update is fine inside mutation scripts but in generic script you risk conflict and breaking stuff function okkg_MIOT_Update() { if(Time() >= okkg_last_set + 15 && okkg_isatmax == false && okkg_leftsaferoom == true) { DirectorScript.DirectorOptions.CommonLimit++; DirectorScript.DirectorOptions.MegaMobSize++; DirectorScript.DirectorOptions.MobMinSize++; DirectorScript.DirectorOptions.MobMaxSize++; DirectorScript.DirectorOptions.MobMaxPending++; DirectorScript.DirectorOptions.PreTankMobMax++; DirectorScript.DirectorOptions.BileMobSize++; printl("CommonLimit is " + DirectorScript.DirectorOptions.CommonLimit); if(okkg_randomint == 4 && DirectorScript.DirectorOptions.MaxSpecials != 4) { DirectorScript.DirectorOptions.MaxSpecials++; printl("MaxSpecials is " + DirectorScript.DirectorOptions.MaxSpecials); okkg_randomint = 0; } okkg_last_set = Time(); okkg_randomint++; if(DirectorScript.DirectorOptions.CommonLimit == 60) { okkg_isatmax = true; } } } // There is by default an Update function defined and this registers your update function to be called too g_MapScript.ScriptedMode_AddUpdate(okkg_MIOT_Update);
< >
Showing 1-7 of 7 comments
multoghost 29 Jul, 2024 @ 8:57pm 
i really wanted to use this mod but without the finale music is a huge downside, but damn thank you for fixing it
Megatron  [developer] 29 Jul, 2024 @ 9:19pm 
Thank you for improving it, didnt even know half of this lol, can I replace the old code in the mod with this?
Nescius 29 Jul, 2024 @ 11:37pm 
yes
multoghost 30 Jul, 2024 @ 10:43pm 
huh the finale music is still broken, i played some finales and i still cant hear both the tank finale and finale beginning music
Last edited by multoghost; 30 Jul, 2024 @ 10:46pm
Nescius 31 Jul, 2024 @ 12:53am 
Are you sure this addon is the culprit ? Did a quick test and tank music in finales was working. Which finales have you tested ?
multoghost 31 Jul, 2024 @ 12:55am 
i tested swamp fever, no mercy and deathtoll finales and couldnt hear anything no tank music or finale start music
Nescius 31 Jul, 2024 @ 12:58am 
Are you sure you don't have an old version of this or some other addon causing it ?
< >
Showing 1-7 of 7 comments
Per page: 1530 50