[1487]Automatically add mk1 eyeball to every unit after saving the scenario.

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
stepbackjumper2
Posts: 25
Joined: Tue Jul 04, 2023 11:00 pm

[1487]Automatically add mk1 eyeball to every unit after saving the scenario.

Post by stepbackjumper2 »

Image

After editing my scenario more than 50 times, I found every unit had accumulated more than 50 mk1 eyeballs, causing performace issues.

Quick fix by following lua scripts:

Code: Select all

local unitsFromChina = VP_GetSide({ Side = "China" }).units
for index, u in ipairs(unitsFromChina) do
    local unit = SE_GetUnit({ guid = u.guid })
    local count = 0
    for index, sensor in ipairs(unit.sensors) do
        if sensor['sensor_dbid'] == 0 then
            count = count + 1
        end
    end

    count = count - 1
    print(count)
    for index, sensor in ipairs(unit.sensors) do
        if count >= 1 and sensor['sensor_dbid'] == 0 then
            ScenEdit_UpdateUnit({
                guid = unit.guid,
                dbid = 0,
                mode = 'remove_sensor',
                sensorId = sensor['sensor_guid']
            })
            count = count - 1
        end
    end
end
Attachments
Test for helicopters.rar
(36.22 KiB) Downloaded 5 times
User avatar
blu3s
Posts: 1091
Joined: Fri Jul 08, 2022 9:45 am

Re: [1487]Automatically add mk1 eyeball to every unit after saving the scenario.

Post by blu3s »

Thanks for this report,

It's fixed for the next release. We will also provide a Lua Script in order to clear all the additional Mk1 Eyeballs generated during the save-load process when using these lasts builds.
Quark73
Posts: 375
Joined: Fri Nov 04, 2022 2:55 pm
Location: Baltic Coast

Re: [1487]Automatically add mk1 eyeball to every unit after saving the scenario.

Post by Quark73 »

Ive noticed that copying a unit moves or removes Mk1 Eyeball in Sensors window. Is it fixed too or an extra issue?
Raptorx7_slith
Posts: 715
Joined: Fri Jul 26, 2013 10:14 pm

Re: [1487]Automatically add mk1 eyeball to every unit after saving the scenario.

Post by Raptorx7_slith »

Quark73 wrote: Thu Oct 31, 2024 4:56 pm Ive noticed that copying a unit moves or removes Mk1 Eyeball in Sensors window. Is it fixed too or an extra issue?
I'm unable to reproduce this in 1493, is it only happening in a single scenario or with a specific unit?
Quark73
Posts: 375
Joined: Fri Nov 04, 2022 2:55 pm
Location: Baltic Coast

Re: [1487]Automatically add mk1 eyeball to every unit after saving the scenario.

Post by Quark73 »

[/quote]

I'm unable to reproduce this in 1493, is it only happening in a single scenario or with a specific unit?
[/quote]

Checked it back, Copying a unit removed a redundant Eyeball sensor, so it basically fixed it.
Post Reply

Return to “Tech Support”