Jump to content

The beargerspawner component uses an incorrect remainingdaysinseason value when the season changes to Autumn. Bearger therefore spawns earlier than intended every year.

  • Pending

During the transition from Summer to Autumn, the beargerspawner component requests the remainingdaysinseason value before it has been updated by the seasons component.  This causes Bearger to spawn way earlier than intended every Autumn.

Function in question (from the beargerspawner component):

local function SpawnBearger()

    --print("BeargerSpawner detected autumn", TheWorld.state.cycles, _numSpawned)
    local shouldSpawn = TheWorld.state.cycles > TUNING.NO_BOSS_TIME and TheWorld.state.isautumn == true and _numSpawned < _targetNum

    if shouldSpawn then 
        local spawndelay = .25 * ((TheWorld.state.remainingdaysinseason * TUNING.TOTAL_DAY_TIME) / _targetNum)
        local spawnrandom = .25 * spawndelay
        _timetospawn = GetRandomWithVariance(spawndelay, spawnrandom or 0)
        --print("Spawning Bearger ", _timetospawn)
        _timetospawn = nil


If you add a print or SystemMessage statement inside the shouldSpawn conditional (to log the remainingdaysinseason value), you will see that the beargerspawner component uses 1 as its remainingdaysinseason value whenever the season changes from Summer to Autumn (this is the value from the last day of Summer).  Instead, the function should be using 20 (which would be the value from the first day of Autumn).

Under default game settings, this causes Bearger to spawn 90 to 150 seconds (0.1875 to 0.3125 game days) into Autumn instead of the intended 1800 to 3000 seconds (3.75 to 6.25 game days) into Autumn.

Steps to Reproduce
Start a new game then LongUpdate to the last night of any Summer (i.e. the night of any day that is a multiple of 70). Make note of the timetospawn value the beargerspawner component uses when the season changes to Autumn. Repeat as necessary (but kill Bearger before using LongUpdate again). The timetospawn value will always be between 90 and 150 seconds. Moreover, if you log the remainingdaysinseason value used by the SpawnBearger function at the start of every Autumn (as mentioned in the issue description above), the value used will always be 1.
  • Like 3

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