Jump to content

Withered flower in the cave


Recommended Posts

local FINDLIGHT_MUST_TAGS = { "daylight", "lightsource" }
local function DieInDarkness(inst)
    local x,y,z = inst.Transform:GetWorldPosition()
    local ents = TheSim:FindEntities(x,0,z, TUNING.DAYLIGHT_SEARCH_RANGE, FINDLIGHT_MUST_TAGS)
    for i,v in ipairs(ents) do
        local lightrad = v.Light:GetCalculatedRadius() * .7
        if v:GetDistanceSqToPoint(x,y,z) < lightrad * lightrad then
            --found light
            return
        end
    end
    --in darkness
    inst:Remove()
    SpawnPrefab("flower_withered").Transform:SetPosition(x,y,z)
end

local function OnIsCaveDay(inst, isday)
    if isday then
        inst:DoTaskInTime(5.0 + math.random()*5.0, DieInDarkness)
    end
end

Flowers do wither if they don't detect any nearby natural light source in the first 5-10 seconds after a new day starts and your flowers shouldn't wither in this case because there's a natural light source right above the flowers which "always" provides light once a new day starts.

But you have an equipped Enlightened Crown which means that you (most likely) did fight Celestial Champion. To summon him and to obtain the crown, you need to start the Lunar event which changes the current state of the Day-Night Cycle from 'Any' to 'Night' (Full Moon) and at the end of the Lunar event, the Day-Night Cycle changes again from 'Any' to 'Night' (New Moon).

If you start or end the Lunar Event in the first 10s of the beginning of the day, then the Day-Night Cycle on surface and in caves (which depends on surface) becomes 'Night' just before your flowers do their daily check for a vaild light source. The light source which prevents your flowers from withering was not available right at that moment because it was 'Night' during that time.

And since your flowers didn't have any nearby light source at the beginning of the day, they did wither.

Hope that answers your question.

Link to comment
Share on other sites

1 hour ago, Frosty_Mentos said:

Unfortunate that shadow lights from the ruins don't provide sustenance for flowers.
Though I wonder - do evil flowers also decay underground?

As far as I remember evil flowers can survive in complete darkness. We used to put 3 or 4 bee boxes in small patches of light and surround the dark areas with evil flowers, and it used to work.
Haven't used this in a long time though.

Link to comment
Share on other sites

4 hours ago, Frosty_Mentos said:

Unfortunate that shadow lights from the ruins don't provide sustenance for flowers.
Though I wonder - do evil flowers also decay underground?

I currently have a ruins base with a patch of evil flowers, this mechanic is still working. Evil flowers do not decay in the underground without sunlight.

Link to comment
Share on other sites

2 hours ago, gusal said:

Thanks for everyone's sincere replies. One more question, I wonder why some flowers wither and some flowers are normal.

It depends on where you plant the flowers. Flowers planted inside areas exposed to sunlight will not wither, and flowers planted slightly near the edge of the areas will wither because the game deems that these areas don't receive sunlight.

Link to comment
Share on other sites

16 hours ago, Frosty_Mentos said:

Unfortunate that shadow lights from the ruins don't provide sustenance for flowers.
Though I wonder - do evil flowers also decay underground?

Evil flowers don't wither yes, you can have them anywhere. However for the bees to produce honey you still need to cast a star around or they won't come out. 

Link to comment
Share on other sites

19 hours ago, axxel said:

Dumb question: Any way to create a Devil Flower garden alone?

A bunch of life giving amulets and monster meat.

Or ask someone to hop in the server with you for a while so they can afk while you haunt the flowers.

Link to comment
Share on other sites

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.

×
  • Create New...