Left 4 Dead 2

Left 4 Dead 2

No Survivor Complaining When On High Temp Health
Nescius 2023 年 10 月 20 日 下午 7:41
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);
最后由 Nescius 编辑于; 2023 年 10 月 21 日 上午 2:49
< >
正在显示第 1 - 2 条,共 2 条留言
ChamoChimi  [开发者] 2023 年 10 月 21 日 上午 4:13 
I haven't had any issues with mutation while using the old version but I'll take your word for it.
Nescius 2023 年 10 月 21 日 上午 7:29 
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 } }
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50