Jump to content

Strength XP degradation spams level up sound


Tykvesh

Recommended Posts

  • 41.65
  • Singleplayer
  • No mods

 

My strength periodically loses 1 xp, soon after I gain it back from regular activities (level up jingle plays each time this occurs)

It seems to be purely random, but usually this happens during/after waking up or eating.

 

screenshot_04-01-2022_10-10-14.jpg.21688d2deb1d1c6e2c9c7600ca64d11e.jpg

 

Edit: I think this code is the cause; I would suggest skipping players with max strength as the constant level up sound is annoying:

xpUpdate.everyTenMinutes = function()
	for playerIndex=0,getNumActivePlayers()-1 do
		local playerObj = getSpecificPlayer(playerIndex)
		if playerObj and not playerObj:isDead() then
			local modData = xpUpdate.getModData(playerObj)
			-- strength stuff
			modData.strengthUpTimer = modData.strengthUpTimer + 10;

			-- if we've been lazy for too long, we start losing xp, every 1200 tick we lose 1 xp
			if modData.strengthUpTimer > 20000 and modData.strengthMod ~= math.floor(modData.strengthUpTimer / 1200) then
				modData.strengthMod = math.floor(modData.strengthUpTimer / 1200);
				if playerObj:getXp():getXP(Perks.Strength) > 0 then
					playerObj:getXp():AddXP(Perks.Strength, -1);
				end
				xpUpdate.checkForLosingLevel(playerObj, Perks.Strength);
			end
			if modData.strengthUpTimer > 31000 then -- it's caped to a 30000 timer, so if you've been lazy for a lot of days, it's not so long to get in shape again
				modData.strengthUpTimer = 0;
			end
			-- fitness stuff
			modData.fitnessUpTimer = modData.fitnessUpTimer + 10;
			-- if we've been lazy for too long, we start losing xp, every 1200 tick we lose 1 xp
			if modData.fitnessUpTimer > 20000 and modData.fitnessMod ~= math.floor(modData.fitnessUpTimer / 1200) then
				modData.fitnessMod = math.floor(modData.fitnessUpTimer / 1200);
				if playerObj:getXp():getXP(Perks.Fitness) > 0 then
					playerObj:getXp():AddXP(Perks.Fitness, -1);
				end
			end
			if modData.fitnessUpTimer > 31000 then -- it's caped to a 30000 timer, so if you've been lazy for a lot of days, it's not so long to get in shape again
				modData.fitnessUpTimer = 0;
			end
		end
    end
end
Edited by Tykvesh
Link to comment
Share on other sites

  • Tykvesh changed the title to Strength XP degradation spams level up sound
  • 2 months later...

I'm also having this issue even though I'm making sure to exercise every game day it still lowers by one exp and the raises again with multiple level up sounds for no reason even when there is no apparent change to strength levels. This is happening in 41.66.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...