- Joined
- Jun 11, 2017
- Messages
- 988
Thank you @Uncle, but I managed to create an empty map and re-add all content step by step from the crashing map. During adding I checked for save & load and after loading all content new map works fine for now. Probably crashing map was corrupted somehow.Doubt they changed much besides Art related stuff, trying forcing everything back to SD graphics in-game and in the editor.
Pls, can you explain more this? Because I'm having the same issue with my map.UPD:
THey had added new field for each unit - selecting unit portrait. It seems that touching that field will corrupt/cause crashes again. Don't touch it for now.
I tried to apply any portrait I wanted, but then I copied "No portrait" from any basic unit with such field, which seems to work for now.Pls, can you explain more this? Because I'm having the same issue with my map.
And where is that? I can't find it.I tried to apply any portrait I wanted, but then I copied "No portrait" from any basic unit with such field, which seems to work for now.
For some strange reason I could only see that option if I have the game in English (mine is Spanish LA).
Probably it is not localized and called WESTRING_portrait_etc.For some strange reason I could only see that option if I have the game in English (mine is Spanish LA).
Ah, I see, that was only option that was translated, the rest is still in English lol.Probably it is not localized and called WESTRING_portrait_etc.
Now, it's hard to guess—maybe custom UI. Someone reported that games with 6 vs. 6 teams could crash on the restart and other things...I removed every portrait from the units and still crashing the game, does someone have any other ideas?
if Debug then Debug.beginFile("GetMainSelectedUnit") end
OnInit("GetMainSelectedUnit", function ()
---Returns the local current main selected unit, using it in a sync gamestate relevant manner breaks the game.
---@return unit
function GetMainSelectedUnitEx()
return GetMainSelectedUnit(GetSelectedUnitIndex())
end
local containerFrame
local frames = {}
local group
local units = {}
local filter = Filter(function()
local unit = GetFilterUnit()
local prio = BlzGetUnitRealField(unit, UNIT_RF_PRIORITY)
local found = false
-- compare the current unit with allready found, to place it in the right slot
for index, value in ipairs(units) do
-- higher prio than this take it's slot
if BlzGetUnitRealField(value, UNIT_RF_PRIORITY) < prio then
table.insert(units, index, unit)
found = true
break
-- equal prio and better colisions Value
elseif BlzGetUnitRealField(value, UNIT_RF_PRIORITY) == prio and GetUnitOrderValue(value) > GetUnitOrderValue(unit) then
table.insert( units, index, unit)
found = true
break
end
end
-- not found add it at the end
if not found then
table.insert(units, unit)
end
unit = nil
return false
end)
---@return integer | nil
function GetSelectedUnitIndex()
-- local player is in group selection?
if BlzFrameIsVisible(containerFrame) then
-- find the first visible yellow Background Frame
for int = 0, #frames do
if BlzFrameIsVisible(frames[int]) then
return int
end
end
end
return nil
end
---@param unit unit
---@return integer
function GetUnitOrderValue(unit)
--heroes use the handleId
if IsUnitType(unit, UNIT_TYPE_HERO) then
return GetHandleId(unit)
else
--units use unitCode
return GetUnitTypeId(unit)
end
end
---@param index integer | nil
---@return unit
function GetMainSelectedUnit(index)
if index then
GroupEnumUnitsSelected(group, GetLocalPlayer(), filter)
local unit = units[index + 1]
--clear table
repeat until not table.remove(units)
return unit
else
GroupEnumUnitsSelected(group, GetLocalPlayer(), nil)
return FirstOfGroup(group)
end
end
--init
local console = BlzGetFrameByName("ConsoleUI", 0)
local bottomUI = BlzFrameGetChild(console, 1)
local groupframe = BlzFrameGetChild(bottomUI, 5)
--globals
containerFrame = BlzFrameGetChild(groupframe, 0)
group = CreateGroup()
-- give this frames a handleId
for int = 0, BlzFrameGetChildrenCount(containerFrame) - 1 do
local buttonContainer = BlzFrameGetChild(containerFrame, int)
frames[int] = BlzFrameGetChild(buttonContainer, 0)
end
end)
if Debug then Debug.endFile() end
Yes, people in HIVE discord reported that currently Taysen libs are bugged. I suggest you turn them off and wait for a fix or continue without it.Ok, at least this script causes the crash, why could it be? Is a bit edited for me system of @Tasyen
Lua:if Debug then Debug.beginFile("GetMainSelectedUnit") end OnInit("GetMainSelectedUnit", function () ---Returns the local current main selected unit, using it in a sync gamestate relevant manner breaks the game. ---@return unit function GetMainSelectedUnitEx() return GetMainSelectedUnit(GetSelectedUnitIndex()) end local containerFrame local frames = {} local group local units = {} local filter = Filter(function() local unit = GetFilterUnit() local prio = BlzGetUnitRealField(unit, UNIT_RF_PRIORITY) local found = false -- compare the current unit with allready found, to place it in the right slot for index, value in ipairs(units) do -- higher prio than this take it's slot if BlzGetUnitRealField(value, UNIT_RF_PRIORITY) < prio then table.insert(units, index, unit) found = true break -- equal prio and better colisions Value elseif BlzGetUnitRealField(value, UNIT_RF_PRIORITY) == prio and GetUnitOrderValue(value) > GetUnitOrderValue(unit) then table.insert( units, index, unit) found = true break end end -- not found add it at the end if not found then table.insert(units, unit) end unit = nil return false end) ---@return integer | nil function GetSelectedUnitIndex() -- local player is in group selection? if BlzFrameIsVisible(containerFrame) then -- find the first visible yellow Background Frame for int = 0, #frames do if BlzFrameIsVisible(frames[int]) then return int end end end return nil end ---@param unit unit ---@return integer function GetUnitOrderValue(unit) --heroes use the handleId if IsUnitType(unit, UNIT_TYPE_HERO) then return GetHandleId(unit) else --units use unitCode return GetUnitTypeId(unit) end end ---@param index integer | nil ---@return unit function GetMainSelectedUnit(index) if index then GroupEnumUnitsSelected(group, GetLocalPlayer(), filter) local unit = units[index + 1] --clear table repeat until not table.remove(units) return unit else GroupEnumUnitsSelected(group, GetLocalPlayer(), nil) return FirstOfGroup(group) end end --init local console = BlzGetFrameByName("ConsoleUI", 0) local bottomUI = BlzFrameGetChild(console, 1) local groupframe = BlzFrameGetChild(bottomUI, 5) --globals containerFrame = BlzFrameGetChild(groupframe, 0) group = CreateGroup() -- give this frames a handleId for int = 0, BlzFrameGetChildrenCount(containerFrame) - 1 do local buttonContainer = BlzFrameGetChild(containerFrame, int) frames[int] = BlzFrameGetChild(buttonContainer, 0) end end) if Debug then Debug.endFile() end
I can't believe that this was the only reason that my map crashed the game.Ok, at least this script causes the crash, why could it be? Is a bit edited for me system of @Tasyen
Lua:if Debug then Debug.beginFile("GetMainSelectedUnit") end OnInit("GetMainSelectedUnit", function () ---Returns the local current main selected unit, using it in a sync gamestate relevant manner breaks the game. ---@return unit function GetMainSelectedUnitEx() return GetMainSelectedUnit(GetSelectedUnitIndex()) end local containerFrame local frames = {} local group local units = {} local filter = Filter(function() local unit = GetFilterUnit() local prio = BlzGetUnitRealField(unit, UNIT_RF_PRIORITY) local found = false -- compare the current unit with allready found, to place it in the right slot for index, value in ipairs(units) do -- higher prio than this take it's slot if BlzGetUnitRealField(value, UNIT_RF_PRIORITY) < prio then table.insert(units, index, unit) found = true break -- equal prio and better colisions Value elseif BlzGetUnitRealField(value, UNIT_RF_PRIORITY) == prio and GetUnitOrderValue(value) > GetUnitOrderValue(unit) then table.insert( units, index, unit) found = true break end end -- not found add it at the end if not found then table.insert(units, unit) end unit = nil return false end) ---@return integer | nil function GetSelectedUnitIndex() -- local player is in group selection? if BlzFrameIsVisible(containerFrame) then -- find the first visible yellow Background Frame for int = 0, #frames do if BlzFrameIsVisible(frames[int]) then return int end end end return nil end ---@param unit unit ---@return integer function GetUnitOrderValue(unit) --heroes use the handleId if IsUnitType(unit, UNIT_TYPE_HERO) then return GetHandleId(unit) else --units use unitCode return GetUnitTypeId(unit) end end ---@param index integer | nil ---@return unit function GetMainSelectedUnit(index) if index then GroupEnumUnitsSelected(group, GetLocalPlayer(), filter) local unit = units[index + 1] --clear table repeat until not table.remove(units) return unit else GroupEnumUnitsSelected(group, GetLocalPlayer(), nil) return FirstOfGroup(group) end end --init local console = BlzGetFrameByName("ConsoleUI", 0) local bottomUI = BlzFrameGetChild(console, 1) local groupframe = BlzFrameGetChild(bottomUI, 5) --globals containerFrame = BlzFrameGetChild(groupframe, 0) group = CreateGroup() -- give this frames a handleId for int = 0, BlzFrameGetChildrenCount(containerFrame) - 1 do local buttonContainer = BlzFrameGetChild(containerFrame, int) frames[int] = BlzFrameGetChild(buttonContainer, 0) end end) if Debug then Debug.endFile() end