Jump to content

Need help with bigfoot stepping parameters


Recommended Posts

Hello. I am currently working on an already existing mod that adds bigfoot into DST. It is old and I have been working on its bugs. On of them is the issue that Bigfoot will ignore water and act like it is land. Does anybody know any way to fix this? I can send you the code if you need it.

Link to comment
Share on other sites

Ok, here's the code I think has to do with it.

function BigFooter:IsOnScreen(pos)
    for k, v in pairs(AllPlayers) do
        if pos:Dist(v:GetPosition()) < 50 then
            return true
        end
    end
    return false
end

function BigFooter:CheckForWater(pos)
    local test = function(offset)
        local testPoint = pos + offset
        local ground = TheWorld
        local tile = ground.Map:GetTileAtPoint(testPoint.x, testPoint.y, testPoint.z)
        if tile == GROUND.IMPASSABLE then
            return true
        end
    end

    return FindValidPositionByFan(0, 4, 4, test)
end

function BigFooter:FindNearbyLand(pos)
    local test = function(offset)
        local testPoint = pos + offset
        local ground = TheWorld
        local tile = ground.Map:GetTileAtPoint(testPoint.x, testPoint.y, testPoint.z)
        if tile ~= GROUND.IMPASSABLE then
            return self:CheckForWater(testPoint) == nil
        end
    end

    return FindValidPositionByFan(0, 6, 8, test)
end

 

The issue here is that the oceans are different from their singleplayer counterpart, but it has changed now and the code doesn't work

Link to comment
Share on other sites

I think the problem is that BigFooter:CheckForWater(pos) is checking if the ground is impassable, but the water is now not impassable.

In ocean_util.lua there is a function IsLandTile, you could try to call it that to check it if it's land.

  • Like 2
Link to comment
Share on other sites

8 hours ago, Monti18 said:

I think the problem is that BigFooter:CheckForWater(pos) is checking if the ground is impassable, but the water is now not impassable.

In ocean_util.lua there is a function IsLandTile, you could try to call it that to check it if it's land.

What should I do if I find it?

Link to comment
Share on other sites

You could try changing

function BigFooter:CheckForWater(pos)
    local test = function(offset)
        local testPoint = pos + offset
        local ground = TheWorld
        local tile = ground.Map:GetTileAtPoint(testPoint.x, testPoint.y, testPoint.z)
        if tile == GROUND.IMPASSABLE then
            return true
        end
    end

    return FindValidPositionByFan(0, 4, 4, test)
end

to

function BigFooter:CheckForWater(pos)
    local test = function(offset)
        local testPoint = pos + offset
        local ground = TheWorld
        local tile = ground.Map:GetTileAtPoint(testPoint.x, testPoint.y, testPoint.z)
        if tile == GROUND.IMPASSABLE or tile == GROUND.INVALID or tile > GROUND.UNDERGROUND then
            return true
        end
    end

    return FindValidPositionByFan(0, 4, 4, test)
end

This is then checking if the tile is ocean or another tile that cannot be used. This is just the contrary of the IsLandTile function.

  • Like 2
Link to comment
Share on other sites

50 minutes ago, Monti18 said:

You could try changing


function BigFooter:CheckForWater(pos)
    local test = function(offset)
        local testPoint = pos + offset
        local ground = TheWorld
        local tile = ground.Map:GetTileAtPoint(testPoint.x, testPoint.y, testPoint.z)
        if tile == GROUND.IMPASSABLE then
            return true
        end
    end

    return FindValidPositionByFan(0, 4, 4, test)
end

to


function BigFooter:CheckForWater(pos)
    local test = function(offset)
        local testPoint = pos + offset
        local ground = TheWorld
        local tile = ground.Map:GetTileAtPoint(testPoint.x, testPoint.y, testPoint.z)
        if tile == GROUND.IMPASSABLE or tile == GROUND.INVALID or tile > GROUND.UNDERGROUND then
            return true
        end
    end

    return FindValidPositionByFan(0, 4, 4, test)
end

This is then checking if the tile is ocean or another tile that cannot be used. This is just the contrary of the IsLandTile function.

You did it. Thank you.

  • Like 1
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
 Share

×
  • Create New...