I try:Note that the API returns tags as a simple table, meaning any modifications to it will not propagate back to the game. Thus, to modify a set of tags, the whole table needs to be written back to the respective property.
Code: Select all
script.on_event(defines.events.on_built_entity, function(event)
if event.entity and event.entity.name == "signal-logger" then
local tags = event.entity.tags or {}
tags.logger_name = tags.logger_name or ""
tags.signals = tags.signals or {}
event.entity.tags = tags
game.print(event.entity.tags and "entity.tags present" or "entity.tags absent")
end
end)
What am I doing wrong?

