Page 1 of 1

[2.0.69] on_chart_tag_modified not raised for changed text/icon

Posted: Sat Oct 04, 2025 4:45 pm
by Pi-C
What?
According to the description, on_chart_tag_modified will be "[c]alled when a chart tag is modified by a player or by script." However, the event is only raised if tag position or tag surface have been changed – changes to icon or text are ignored.
How to reproduce
I've started a new game with only the attached mod active. This is the contents of its control.lua:

Code: Select all

script.on_event(defines.events.on_chart_tag_modified, function(event)
  log("Entered handler for on_chart_tag_modified with these data: "..serpent.block(event))
end)

script.on_event(defines.events.on_player_joined_game, function(event)
game.create_surface("ASDF")

local p = game.get_player(event.player_index)
local tag = p.force.add_chart_tag(p.surface, {position = {p.position.x + 5, p.position.y}, text = "Test", icon = {name = "car"}})

log("Changing text!")
tag.text = "New text"

log("Changing icon!")
tag.icon = {name = "tank"}

log("Changing position!")
tag.position = {p.position.x - 5, p.position.y}

log("Changing surface!")
tag.surface = "ASDF"

end)
As you can see from the attached log file, only changes to position and surface trigger the event.

Re: [2.0.69] on_chart_tag_modified not raised for changed text/icon

Posted: Sat Oct 04, 2025 4:52 pm
by Pi-C
Sorry, I forgot to mention that the event is raised when tag icon or text are changed by a player. But it won't be raised when icon or text are changed by script.

Re: [2.0.69] on_chart_tag_modified not raised for changed text/icon

Posted: Mon Oct 06, 2025 1:45 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.