dual-universe/lua-examples

Gunner Seat Radar Issues

Deadrank opened this issue · 2 comments

Hello,

I am not sure where the issue lies here. When I apply my custom gunner seat script to my chair, I see this in the gunner periscope view.

image


However, when I apply the default PvP gun script I see this

image


I at first assumed it was the data I was sending into the radar widget (either incomplete or something else going on). But upon inspecting the json output of the radar (radar_1.getWidgetData()) from the default script and the radar data fed into the radar widget using my script, I did not find any substantial differences that would account for this behavior.

Default Data
{
    "constructsList": [
        {
            "constructId": "5741688",
            "distance": 11.509540326447041,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "CargoBox",
            "size": "XS",
            "targetThreatState": 0
        },
        {
            "constructId": "5411110",
            "distance": 10126.263601605886,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "N299 Mule the Man",
            "size": "XS",
            "targetThreatState": 0
        },
        {
            "constructId": "5719823",
            "distance": 10380.199691765596,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "PT01",
            "size": "S",
            "targetThreatState": 0
        },
        {
            "constructId": "5638631",
            "distance": 10544.990016054106,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "OMEGA",
            "size": "XS",
            "targetThreatState": 0
        },
        {
            "constructId": "5567993",
            "distance": 10649.402865996866,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "Sava Yesh II",
            "size": "S",
            "targetThreatState": 0
        },
        {
            "constructId": "5658583",
            "distance": 10926.713352488552,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "IC Navis",
            "size": "S",
            "targetThreatState": 0
        },
        {
            "constructId": "5711924",
            "distance": 10927.432673085657,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "Twintania Base",
            "size": "M",
            "targetThreatState": 0
        },
        {
            "constructId": "5690586",
            "distance": 10928.499615752093,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "IC Navis Node",
            "size": "XS",
            "targetThreatState": 0
        },
        {
            "constructId": "5277227",
            "distance": 127134.15874474417,
            "inIdentifyRange": false,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "Hope II",
            "size": "S",
            "targetThreatState": 0
        }
    ],
    "currentTargetId": "0",
    "elementId": "2753861252",
    "helperId": "radar",
    "name": "Advanced Phased-Array Space Radar s [54]",
    "properties": {
        "broken": false,
        "errorMessage": "",
        "identifiedConstructs": [],
        "identifyConstructs": {},
        "radarStatus": 1,
        "selectedConstruct": "0",
        "sortMethod": 0,
        "worksInEnvironment": true
    },
    "staticProperties": {
        "maxIdentifiedTargets": 7,
        "ranges": {
            "identify128m": 123750.0,
            "identify16m": 123750.0,
            "identify32m": 123750.0,
            "identify64m": 123750.0,
            "scan": 400000
        },
        "worksInAtmosphere": false,
        "worksInSpace": true
    },
    "type": "radar"
}

Custom Data
{
    "constructsList": [
        {
            "constructId": "5741688",
            "distance": 11.497139005740145,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[688] CargoBox",
            "size": "XS",
            "targetThreatState": 0
        },
        {
            "constructId": "5411110",
            "distance": 10099.410522447579,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[110] N299 Mule the Man",
            "size": "XS",
            "targetThreatState": 0
        },
        {
            "constructId": "5719823",
            "distance": 10353.233454707668,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[823] PT01",
            "size": "S",
            "targetThreatState": 0
        },
        {
            "constructId": "5638631",
            "distance": 10518.049976234788,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[631] OMEGA",
            "size": "XS",
            "targetThreatState": 0
        },
        {
            "constructId": "5567993",
            "distance": 10622.460439595419,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[993] Sava Yesh II",
            "size": "S",
            "targetThreatState": 0
        },
        {
            "constructId": "5658583",
            "distance": 10899.80712623914,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[583] IC Navis",
            "size": "S",
            "targetThreatState": 0
        },
        {
            "constructId": "5711924",
            "distance": 10900.499892057502,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[924] Twintania Base",
            "size": "M",
            "targetThreatState": 0
        },
        {
            "constructId": "5690586",
            "distance": 10901.593723635093,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[586] IC Navis Node",
            "size": "XS",
            "targetThreatState": 0
        },
        {
            "constructId": "5301571",
            "distance": 43194.568586788686,
            "inIdentifyRange": true,
            "info": {},
            "isIdentified": false,
            "myThreatStateToTarget": 0,
            "name": "[571] Baby Bull",
            "size": "XS",
            "targetThreatState": 0
        }
    ],
    "currentTargetId": "0",
    "elementId": "2753861252",
    "helperId": "radar",
    "name": "Advanced Phased-Array Space Radar s [54]",
    "properties": {
        "broken": false,
        "errorMessage": "All-Distance",
        "identifiedConstructs": [],
        "identifyConstructs": {},
        "radarStatus": 1,
        "selectedConstruct": "0",
        "sortMethod": 0,
        "worksInEnvironment": true
    },
    "staticProperties": {
        "maxIdentifiedTargets": 7,
        "ranges": {
            "identify128m": 123750.0,
            "identify16m": 123750.0,
            "identify32m": 123750.0,
            "identify64m": 123750.0,
            "scan": 400000
        },
        "worksInAtmosphere": false,
        "worksInSpace": true
    },
    "type": "radar"
}

Would anyone be able to assist and help me determine what is going on? My custom script is open source and I can link it if it would help with the review. I also tried using and older version of my script (from near the end of Beta) which I 100% know was working properly and it still has this same behavior.

After further investigation, the issue seems to come from using the system.updateData() function. Even when calling the function like this radarDataId,radar_1.getWidgetData() the issue appears. Furthermore, the radar widget in 3rd person does not scroll past the initial radar contacts (see below).

image

Issue indentified, we're on it.