Left 4 Dead 2

Left 4 Dead 2

No Survivor Complaining When On High Temp Health
Nescius 20 Oct, 2023 @ 7:41pm
Conflictless script
Rewrote your script to ensure it won't cause any issues. Your current script overrides Update function and that can cause issues in mutations.

Placed in director_base_addon.nut
printl("No Survivor Complaining When On High Temp Health script run") local function health_checker() { for(local player; player = Entities.FindByClassname(player, "player"); ) { if(player.IsSurvivor() && !player.IsDead() && player.GetHealth() == 1) { if( abs(player.GetHealthBuffer()) <= 38) { NetProps.SetPropInt(player, "m_isGoingToDie", 1) } else { NetProps.SetPropInt(player, "m_isGoingToDie", 0) } } } } ::NoComplainingOnHighTempHealth <- { function OnGameEvent_round_start(p) { g_MapScript.ScriptedMode_AddUpdate(health_checker); } } __CollectGameEventCallbacks(NoComplainingOnHighTempHealth);
Last edited by Nescius; 21 Oct, 2023 @ 2:49am
< >
Showing 1-2 of 2 comments
Queen Blush  [developer] 21 Oct, 2023 @ 4:13am 
I haven't had any issues with mutation while using the old version but I'll take your word for it.
Nescius 21 Oct, 2023 @ 7:29am 
This is the code of original Update function defined in scriptedmode.nut that was being rewritten. Mutations that use functions ScriptedMode_AddSlowPoll, ScriptedMode_CallNextUpdate or ScriptedMode_AddUpdate would not work properly. I was using those functions in my mutation and it was on my friend's server along with this addon and stuff wasn't working because of it.
function Update() { local frame = GetFrameCount() local defer = [] foreach (idx, val in scriptedNextUpdateCalls) { if (val.frame < frame ) val.func() else defer.append(val) } scriptedNextUpdateCalls = defer foreach (idx, val in scriptedModeUpdateFuncs) val() if ( Time() - scriptedModeLastSlowPoll > scriptedModeSlowPollInterval ) { foreach (idx, val in scriptedModeSlowPollFuncs) val() scriptedModeLastSlowPoll += scriptedModeSlowPollInterval } }
< >
Showing 1-2 of 2 comments
Per page: 1530 50