Follow-up to the previous XP report — still reproduces in 2.4.0 on PZ 42.20.4, Single Player.
The trigger
Sandbox option MultiplierConfig.GlobalToggle set to off (per-skill XP multipliers instead of
one global one). Its default is true, which is why this doesn't show up with default settings.
What happens
Any action wrapped by ExpActions.WrapUpdate throws on every update() tick — 500–1000 errors per
action:
Lua((MOD:The Only Cure)).action(ExpActions.lua:87)
Lua((MOD:The Only Cure)).IterateTOCXp(ExpActions.lua:29)
Lua((MOD:The Only Cure)).AddTOCXp(ExpActions.lua:86)
Lua((MOD:The Only Cure)).update(ExpActions.lua:123)
java.lang.NullPointerException: Cannot invoke "zombie.SandboxOptions$SandboxOption.asConfigOption()" because the return value of "zombie.SandboxOptions.getOptionByName(String)" is null
at zombie.characters.IsoGameCharacter$XP.AddXP(IsoGameCharacter.java:14269)
Why
With the global toggle off, AddXP looks up a per-skill multiplier by name:
xp *= Float.parseFloat(SandboxOptions.instance
.getOptionByName("MultiplierConfig." + perk.getType()) // perk.toString() == perk id
.asConfigOption().getValueAsString());
MultiplierConfig.* options exist only for the 36 vanilla skills. Side_L, Side_R and
ProstFamiliarity have none, so the lookup returns null.
This can't be fixed on the Lua side: addXp has a single 3-arg overload, and AddXPNoMultiplier
just calls back into the same code path. The option has to exist.
Fix
Add to 42/media/sandbox-options.txt (vanilla values are 0.0 / 1000.0 / 1.0):
option MultiplierConfig.Side_L
{
type = double,
min = 0.0,
max = 1000.0,
default = 1.0,
page = MultiplierConfig,
translation = TOC_MultiplierSide_L,
}
same for Side_R and ProstFamiliarity, plus the Sandbox_TOC_Multiplier* translation keys.
Follow-up to the previous XP report — still reproduces in 2.4.0 on PZ
42.20.4, Single Player.The trigger
Sandbox option
MultiplierConfig.GlobalToggleset to off (per-skill XP multipliers instead ofone global one). Its default is
true, which is why this doesn't show up with default settings.What happens
Any action wrapped by
ExpActions.WrapUpdatethrows on everyupdate()tick — 500–1000 errors peraction:
Why
With the global toggle off,
AddXPlooks up a per-skill multiplier by name:MultiplierConfig.*options exist only for the 36 vanilla skills.Side_L,Side_RandProstFamiliarityhave none, so the lookup returnsnull.This can't be fixed on the Lua side:
addXphas a single 3-arg overload, andAddXPNoMultiplierjust calls back into the same code path. The option has to exist.
Fix
Add to
42/media/sandbox-options.txt(vanilla values are0.0 / 1000.0 / 1.0):same for
Side_RandProstFamiliarity, plus theSandbox_TOC_Multiplier*translation keys.