Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

Kuirem

[Gameplay] Krampus spawn less than he should

Recommended Posts

Kuirem    231

Category

Gameplay

 

Platform

Standalone

 

Do you use mods?

no


Version Number
latest (I think it's 104670 but not sure)


Issue title
 Krampus spawn less than he should


Steps to reproduce
 Spawn Krampus after 100 days


Describe your issue
 I found this one while looking in the game file kramped.lua (data\scripts\components or data\DLC0001\scripts\components). The problem come from this if/else :

if day > TUNING.KRAMPUS_INCREASE_LVL1 then    num_krampii = num_krampii + math.random(TUNING.KRAMPUS_INCREASE_RAMP)elseif day > TUNING.KRAMPUS_INCREASE_LVL2 then    num_krampii = num_krampii + 1 + math.random(TUNING.KRAMPUS_INCREASE_RAMP)end

What it should do is that after 50 day 1 to 3 Krampus can spawn and after 100 day 2 to 4 but in game you never got more than 3.

The reason is how the if/else is handled : if the second condition (day > TUNING.KRAMPUS_INCREASE_LVL2) is true, the first is also true so we will never get in the second and we always have the first result. A simple fix is to switch the 2 conditions/operations like that : 

if day > TUNING.KRAMPUS_INCREASE_LVL2 then    num_krampii = num_krampii + 1 + math.random(TUNING.KRAMPUS_INCREASE_RAMP)elseif day > TUNING.KRAMPUS_INCREASE_LVL1 then    num_krampii = num_krampii + math.random(TUNING.KRAMPUS_INCREASE_RAMP)end

Hope this will help.

Share this post


Link to post
Share on other sites