Jump to content

Music module sanity aura range exceeds the maximum sanity aura search range


hoxi
  • Pending

The music sanity aura range can up to 24, but the player sanity aura search range only goes up to 20.

This might've been accounted for and might be intentional, but I'm pointing it out just in case.

 

Maybe something like this could be done if you want to make sure works as needed, without increasing the search range more than needed?

--NOTE: this is the max of all entities that have custom deploy_extra_spacing
--      see EntityScript:SetDeployExtraSpacing(spacing)
local DEPLOY_EXTRA_SPACING = 0
function Map:RegisterDeployExtraSpacing(spacing)
    DEPLOY_EXTRA_SPACING = math.max(spacing, DEPLOY_EXTRA_SPACING)
end

--NOTE: this merge the max of this into DEPLOY_EXTRA_SPACING
--		see EntityScript:SetDeploySmartRadius(radius)
function Map:RegisterDeploySmartRadius(radius)
	DEPLOY_EXTRA_SPACING = math.max(radius + DEPLOYSPACING_RADIUS[DEPLOYSPACING.LARGE] / 2, DEPLOY_EXTRA_SPACING)
end

But given that sanity aura searching updates on every tick, maybe increasing it isn't the best idea.

 

So otherwise, you could just tune the values for the music sanity aura so that it doesn't go past the search range, and probably add a print warning or assert or so when going past it.

 

 

Slightly related.. wouldn't it make more sense to use SourceModifierList for these?

wx.components.sanity:SetMax(wx.components.sanity.max + TEST_LESS_SANITY2_BOOST)

wx.components.sanity.dapperness = wx.components.sanity.dapperness + TUNING.WX78_MUSIC_DAPPERNESS

wx.components.health.maxhealth = wx.components.health.maxhealth + amount

wx.components.hunger:SetMax(wx.components.hunger.max + amount)

wx.components.temperature.mintemp = wx.components.temperature.mintemp + TUNING.WX78_MINTEMPCHANGEPERMODULE
wx.components.temperature.maxtemp = wx.components.temperature.maxtemp + TUNING.WX78_MINTEMPCHANGEPERMODULE

wx.components.moisture.maxDryingRate = wx.components.moisture.maxDryingRate + EXTRA_DRYRATE
wx.components.moisture.baseDryingRate = wx.components.moisture.baseDryingRate + EXTRA_DRYRATE

wx.components.health.fire_damage_scale = wx.components.health.fire_damage_scale - TUNING.SKILLS.WX78.HEAT_FIRE_DAMAGE_SCALE

It would inherently add better modding support for all of these mechanics, but also just overall would probably be cleaner than directly modifying the base stats.

Since when deactivating the effects, the reverse of all of these cases is applied, but what if something else also modified those values? Something that could also probably happen in the first place due to a lack of a SourceModifierList to handle external modifiers for the base stats more properly. Could lead to some weird/bad scenarios.


Steps to Reproduce

Self-explanatory.

  • Like 1



User Feedback


There are no comments to display.



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...