[2.0.69] on_chart_tag_modified not raised for changed text/icon
Posted: Sat Oct 04, 2025 4:45 pm
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)