Jump to content

DCS crashes if spawnGroup contains group without name


Go to solution Solved by Flappie,

Recommended Posts

Posted

DCS crashes when groupData does not contains name (or x / y ) - once I add groupData.name and x / y (not sure if it is due to missing group position or just the name). .

Test mission .miz is also attached here which reproduces the crash

 

-- Define the group structure
local groupData = 
{
    ["visible"] = false,
    ["lateActivation"] = true,
    ["tasks"] = {}, -- end of ["tasks"]
    ["uncontrollable"] = false,
    ["task"] = "Ground Nothing",
    ["hiddenOnMFD"] = true,
    ["taskSelected"] = true,
    ["route"] = 
    {
        ["spans"] = {}, -- end of ["spans"]
        ["points"] = 
        {
            [1] = 
            {
                ["alt"] = 5,
                ["type"] = "Turning Point",
                ["ETA"] = 0,
                ["alt_type"] = "BARO",
                ["formation_template"] = "",
                ["y"] = 544035.72022567,
                ["x"] = -495526.32864228,
                ["ETA_locked"] = true,
                ["speed"] = 0,
                ["action"] = "Off Road",
                ["task"] = 
                {
                    ["id"] = "ComboTask",
                    ["params"] = 
                    {
                        ["tasks"] = 
                        {
                            [1] = 
                            {
                                ["number"] = 1,
                                ["auto"] = false,
                                ["id"] = "WrappedAction",
                                ["enabled"] = true,
                                ["params"] = 
                                {
                                    ["action"] = 
                                    {
                                        ["id"] = "Option",
                                        ["params"] = 
                                        {
                                            ["value"] = 2,
                                            ["name"] = 9,
                                        }, -- end of ["params"]
                                    }, -- end of ["action"]
                                }, -- end of ["params"]
                            }, -- end of [1]
                            [2] = 
                            {
                                ["enabled"] = true,
                                ["auto"] = false,
                                ["id"] = "WrappedAction",
                                ["number"] = 2,
                                ["params"] = 
                                {
                                    ["action"] = 
                                    {
                                        ["id"] = "Option",
                                        ["params"] = 
                                        {
                                            ["value"] = false,
                                            ["name"] = 20,
                                        }, -- end of ["params"]
                                    }, -- end of ["action"]
                                }, -- end of ["params"]
                            }, -- end of [2]
                            [3] = 
                            {
                                ["enabled"] = true,
                                ["auto"] = false,
                                ["id"] = "WrappedAction",
                                ["number"] = 3,
                                ["params"] = 
                                {
                                    ["action"] = 
                                    {
                                        ["id"] = "Option",
                                        ["params"] = 
                                        {
                                            ["name"] = 24,
                                            ["value"] = 32,
                                        }, -- end of ["params"]
                                    }, -- end of ["action"]
                                }, -- end of ["params"]
                            }, -- end of [3]
                        }, -- end of ["tasks"]
                    }, -- end of ["params"]
                }, -- end of ["task"]
                ["speed_locked"] = true,
            }, -- end of [1]
        }, -- end of ["points"]
        ["routeRelativeTOT"] = true,
    }, -- end of ["route"]
    ["groupId"] = 11785,
    ["hidden"] = false,
    ["units"] = 
    {
        [1] = 
        {
            ["skill"] = "Excellent",
            ["coldAtStart"] = false,
            ["type"] = "Patriot cp",
            ["unitId"] = 19583,
            ["y"] = 544035.72022567,
            ["x"] = -495526.32864228,
            ["name"] = "BLR-16",
            ["heading"] = 3.1415926535898,
            ["playerCanDrive"] = false,
        }, -- end of [1]
    },
}

-- Function to spawn the group at the start of the mission
local function spawnGroup()
    groupData["lateActivation"] = false
    coalition.addGroup(country.id.USA, Group.Category.GROUND, groupData)
    trigger.action.outText("Group spawned: BLR-16", 10)
end

-- Schedule the group spawn function to run at the start of the mission
timer.scheduleFunction(spawnGroup, {}, timer.getTime() + 1)

 

crash.miz

  • ED Team
Posted

Hi festr, 

we will check it, but obviously usually there is a name for the group. It may mean we need to add a safeguard for this situation. 

Thank you 

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal

  • 9 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...