Jump to content

Glowfly Cocoons can spawn in the water


CameoAppearance
  • DLC VERSION - IMPORTANT!: Hamlet Fixed

I happened to be near the water in humid season and in between getting mauled half to death by Snaptooth Flytraps I stopped to take this screenshot of some cocoons that shouldn't have been there.

soggy_boys.png


Steps to Reproduce

1. Start a Hamlet game and wait until the end of temperate season.

2. Look for any spots where a Great Leafy Stalk spawned right next to the coast of a lake.

3. Check the lake for cocoons.

  • Like 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

Relevant codes provided to developers: (prefab files 'tree_pillar' line 14-37)

local function spawncocoons(inst)
    if math.random() < 0.4 then
        local pt = inst:GetPosition()
        local range = 5 + math.random()*10
        local angle =  math.random() * 2 * PI
        local offset = FindWalkableOffset(pt,angle, range, 10)

        if offset then
            local newpoint = pt+offset
            if GetPlayer():GetDistanceSqToPoint(newpoint) > 40*40 then
                for i=1, math.random(6,10) do
                    range = math.random()*8
                    angle =  math.random() * 2 * PI
                    local suboffset = FindWalkableOffset(newpoint,angle, range, 10)
                    local cocoon = SpawnPrefab("glowfly")
                    local spawnpt = newpoint + suboffset
                    cocoon.Physics:Teleport(spawnpt.x,spawnpt.y,spawnpt.z)                    
                    cocoon:AddTag("cocoonspawn")
                    cocoon.forceCocoon(cocoon)     
                end
            end
        end
    end
end

I suggest changing FindWalkableOffset into FindGroundOffset. And also need to check "not too near water"

Edited by KXWl1

Share this comment


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