[0.17.64] force.add_chart_tag not working at the start

Bugs that are actually features.
Post Reply
TheFunnySide
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat Jun 08, 2019 1:19 pm
Contact:

[0.17.64] force.add_chart_tag not working at the start

Post by TheFunnySide »

i am using force.add_chart_tag in an on_chunk_generated event. And the tags i place before the game has rendered the first frame arent visible/not existant.
The tags which are placed later by on_chunk are visible. I placed some log() and they tell me that the code is being executed like it is supposed to be.

function add_chart_tag_for_all_forces(surface, position, text)
log("tag_all")
for i, force in pairs(game.forces) do
log("tag")
log(force.name)
log(text)
force.add_chart_tag(surface, {position = position, text = text})
end
end
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:104: tag_all
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:106: tag
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:107: player
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:108: Leocord Reef
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:106: tag
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:107: enemy
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:108: Leocord Reef
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:106: tag
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:107: neutral
9363.713 Script @__Annotorio__/prototypes/map/island_naming.lua:108: Leocord Reef

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.64] force.add_chart_tag not working at the start

Post by Rseding91 »

Thanks for the report. You need to wait for the chunk to be charted before you can add tags to it. The tags are stored on the charting for that chunk so when it's first generated it has no chart data.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”