#4601·tiled

Objects in List Properties are Incorrectly Exported As Integers to Lua

Author: ClemapfelCreated Aug 27, 2026Updated Aug 27, 2026

Describe the bug

When adding an "object" inside a "list" property, the object with id n is incorrectly exported as n, instead of { id = n }.

Steps to reproduce

create a new map and object layer create two objects, which get the ids 1 and 2 add the following properties to object 1: object.obj: an "object" property, pointing to object 2 object.int: an "int" property, set to 2 object.list: a "list" property object.list[0]: an "object" property, pointing to object 2 object.list[1]: an int property, set to 2

Image

This map exports with the following object layer to lua:

lua
objects = {
  {
    id = 1,
    name = "",
    type = "",
    shape = "rectangle",
    x = 1.11836,
    y = 2.33686,
    width = 5.39148,
    height = 3.22153,
    rotation = 0,
    opacity = 1,
    visible = true,
    properties = {
      ["list"] = {
        2,
        2
      },
      ["obj"] = { id = 2 },
      ["int"] = 2
    }
  },

object.obj is exported as { id = 2 }, but object.list[0], which is an "object" property pointing to the same object, is exported as 2, not { id = 2 }. Because the object inside the list is exported as an integer, there is no way to distinguish an object with id n inside a list and the integer n inside a list.

Expected Behavior

The map should export as:

lua
objects = {
  {
    id = 1,
    ...
    properties = {
      ["list"] = {
        { id = 2 },
        2
      },
      ["obj"] = { id = 2 },
      ["int"] = 2
    }
  },
  ...

OS version

Windows 11

Tiled version

1.12.2