Sorry, we don't support your browser.  Install a modern browser
This post is closed.

getObjectsWithTag stops working after having more then 63 tags#1718

When there are more than 63 active tags in a save file, getObjectsWithTag doesn’t work correctly anymore. When the function is used with a tag value for which currently no object exists, instead of returning an empty table, it always returns the objects that have the 64th tag assigned to them.

The attached save file contains an example of the bug. Executing getObjectsWithTag("NotExistingTag") will return the HandZone in the save game, as it has the 64th tag (“63”) attached to it.

A workaround for this, might be to “patch” this function in every script that uses it, e.g. with doing something like this:

_G.getObjectsWithTag = function(tag)
  local res = {}

  for _, obj in ipairs(getObjects()) do
    if obj.hasTag(tag) then
      table.insert(res, obj)
    end
  end

  return res
end
2 years ago
Changed the status to
Planned
2 years ago
Changed the status to
In Progress
2 years ago
Changed the status to
Completed
2 years ago