ContainerProxy

Live proxy for reflected Unreal arrays, maps, and sets.

Reflected TArray, TMap, and TSet properties are live proxies. Mutations update the owning UObject.

Common API

OperationDescription
#containerCurrent entry count.
pairs(container)Iterate entries.
:is_valid()Whether the owner and property are valid.
:type()Returns array, map, or set.
:get(key) / :set(key, value)Read or write an entry.
:remove(key)Remove an entry.
:contains(value)Test membership.
:clear()Remove every entry.
:to_table()Create a detached Lua snapshot.

Type-specific methods

  • Arrays: :add(value), :insert(index, value); indices are 1-based.
  • Maps: :add(key, value); assigning nil removes a key.
  • Sets: :add(value); assigning false or nil removes a member.

Example

local inventory = player.Inventory

inventory:add(new_item)
inventory:insert(1, priority_item)

for index, item in pairs(inventory) do
    print(index, item)
end

Function-return containers are detached Lua tables because their native storage is temporary.

On this page