[0.16.36] Crash changing map_gen_settings in on_chunk_genera

This subforum contains all the issues which we already resolved.
justarandomgeek
Filter Inserter
Filter Inserter
Posts: 304
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

[0.16.36] Crash changing map_gen_settings in on_chunk_genera

Post by justarandomgeek »

With the following event handler in a scenario, or entered in game on the command line:

Code: Select all

script.on_event(defines.events.on_chunk_generated, function(event)
  local surface = event.surface
  if surface.name == "nauvis" then
    local mgs = surface.map_gen_settings
    mgs.seed = mgs.seed+1
    surface.map_gen_settings = mgs
  end
end)
Attachments
factorio-current.log
(10.98 KiB) Downloaded 74 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 16049
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.36] Crash changing map_gen_settings in on_chunk_genera

Post by Rseding91 »

Thanks for the report however in this case you simply can't do that.

Changing map_gen_settings requires all chunks being generated are finished immediately which fires the chunk_generated event which recursively repeats.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”