Page 1 of 1
[1487]Automatically add mk1 eyeball to every unit after saving the scenario.
Posted: Wed Oct 30, 2024 11:36 am
by stepbackjumper2
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
Re: [1487]Automatically add mk1 eyeball to every unit after saving the scenario.
Posted: Wed Oct 30, 2024 5:26 pm
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.
Re: [1487]Automatically add mk1 eyeball to every unit after saving the scenario.
Posted: Thu Oct 31, 2024 4:56 pm
by Quark73
Ive noticed that copying a unit moves or removes Mk1 Eyeball in Sensors window. Is it fixed too or an extra issue?
Re: [1487]Automatically add mk1 eyeball to every unit after saving the scenario.
Posted: Thu Oct 31, 2024 11:05 pm
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?
Re: [1487]Automatically add mk1 eyeball to every unit after saving the scenario.
Posted: Fri Nov 01, 2024 9:38 am
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.