Jump to content

[0.15.7] More problems with docks - player docking


Rinart73

Recommended Posts

I guess that even stations with properly placed docking ports (that work with NPC traders) don't give true for

object:hasComponent(ComponentType.DockingPositions)

in scripts/lib/player.lua.

 

Because me and my friends almost always get "You must be closer to the object for this" instead of "You must be docked to the object for this". We need to almost hit the station with our ships to be able to transfer anything.

 

Let's look at the code:

function CheckShipDocked(faction, ship, object, errors, generic)
...
    local error
    if object:hasComponent(ComponentType.DockingPositions) then
        if not object:isDocked(ship) then
            error = errors[object.type] or generic or "You must be docked to the object for this."%_T
        end
    else
        if object:getNearestDistance(ship) > 50 then
            error = errors[object.type] or generic or "You must be closer to the object for this."%_T
        end
    end

So, if station has docks, then one error message. If not, another. And we always getting second message. Tried with different stations and mines.

Link to comment
Share on other sites

I can add, that some actions need to be close to a docking port, and other actions need to be close to the station itself.

 

"Trade Goods" neet to be docked

"Transfer Crew/Stuff" needs to be 0km from the Station itself.

 

Perhaps its a good idea to streamline it to the same mechanic.

Link to comment
Share on other sites

I can add, that some actions need to be close to a docking port, and other actions need to be close to the station itself.

"Trade Goods" neet to be docked

"Transfer Crew/Stuff" needs to be 0km from the Station itself.

 

That's because most of this checks use CheckPlayerDocked function from "scripts/lib/player.lua", but "scripts/entity/transfercrewgoods.lua" uses getNearestDistance: 20 for Crew, 2 for Cargo and Fighters.

 

I agree, this should be unified.

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