1. Welcome to the Starbound support forums. Please check the support FAQs before posting: http://playstarbound.com/support

Bug/Issue Can't query object at X coordinate 0

Discussion in 'Starbound Support' started by Sectrix, Mar 14, 2017.

  1. Sectrix

    Sectrix Phantasmal Quasar

    What happened?
    When using world.objectQuery() with a radius of 0 and a boundMode of position, I am unable to successfully query an object placed at X-coordinate 0. Any larger radius will successfully query the object.

    Repeatable?
    This is consistent and repeatable.

    Operating system?
    Windows 7, 64-bit

    Mods?
    Only a test mod required to use world.objectQuery().

    Window mode?
    Full screen

    How to reproduce?
    Place a 1x1 tile object on the X-coordinate 0. In my testing, I used a scanner, and placed five of them: two on either side of the 0 X-coordinate, and one on the 0 X-coordinate. I tested this on a 3000 tile wide world, so the scanners had the following coordinates:
    (2998, 680), (2999, 680), (0, 680), (1, 680), (2, 680)

    Create a scripted test object mod that runs world.objectQuery() in it's init() hook. Write an objectQuery() for each object placed, and hard-code the coordinates. Use a radius of 0, and a boundMode of position. Have any results of the query printed to the log.

    Ensure the player is near the placed objects (so that the chunk is loaded), and place the test object. In the log, only the objects not on X-coordinate 0 will be found.

    I used the following mod as a test:

    Code:
    {
    "objectName" : "test",
    "rarity" : "Rare",
    "description" : "Test Object",
    "shortdescription" : "Test",
    "race" : "generic",
    
    "category" : "generic",
    "price" : 1,
    "printable" : false,
    
    "inventoryIcon" : "test.png",
    "orientations" :
        [
            {
            "image" : "test.png",
            "imagePosition" : [0, 0],
            "spaceScan" : 0.1,
            "anchors" : ["background"]
            }
        ],
     
    "scripts" : ["test.lua"],
    "scriptDelta" : 1
    }



    Code:
    function init(virtual)
        local resultList = {}
       
        resultList = world.objectQuery({2998, 680}, 0, {boundMode = "position", name = "scanner"})
        for key, val in pairs(resultList) do
            sb.logInfo("2998 - Key : " .. tostring(key) .. "  Value: " .. tostring(val))
        end
       
        resultList = world.objectQuery({2999, 680}, 0, {boundMode = "position", name = "scanner"})
        for key, val in pairs(resultList) do
            sb.logInfo("2999 - Key : " .. tostring(key) .. "  Value: " .. tostring(val))
        end
       
        resultList = world.objectQuery({0, 680}, 0, {boundMode = "position", name = "scanner"})
        for key, val in pairs(resultList) do
            sb.logInfo("0 - Key : " .. tostring(key) .. "  Value: " .. tostring(val))
        end
       
        resultList = world.objectQuery({1, 680}, 0, {boundMode = "position", name = "scanner"})
        for key, val in pairs(resultList) do
            sb.logInfo("1 - Key : " .. tostring(key) .. "  Value: " .. tostring(val))
        end
       
        resultList = world.objectQuery({2, 680}, 0, {boundMode = "position", name = "scanner"})
        for key, val in pairs(resultList) do
            sb.logInfo("2 - Key : " .. tostring(key) .. "  Value: " .. tostring(val))
        end
    end
    
    function update()
    
    end


    For which I got the following output:

    Code:
    ...
    [20:43:54.532] [Info] 2998 - Key : 1  Value: 235
    [20:43:54.532] [Info] 2999 - Key : 1  Value: 234
    [20:43:54.532] [Info] 1 - Key : 1  Value: 245
    [20:43:54.532] [Info] 2 - Key : 1  Value: 244
    ...


    There were no other errors in the log.
     

Share This Page