raiguard / EditorExtensions

Extends the Factorio map editor with new features, testing tools, and other utilities to aid with sandbox play and scenario creation.
https://mods.factorio.com/mod/EditorExtensions
Other
26 stars 6 forks source link

Crash when loading a map in the map editor #145

Closed FlyingRatBull closed 12 months ago

FlyingRatBull commented 1 year ago

Description

When loading a map in the editor from the main menu, the mod crashes with the following message:

Error while running event EditorExtensions::on_player_toggled_map_editor (ID 123)
__EditorExtensions__/scripts/inventory-filters.lua:230: attempt to index field 'applied_default_filters' (a nil value)
stack traceback:
    __EditorExtensions__/scripts/inventory-filters.lua:230: in function 'handler'
    __core__/lualib/event_handler.lua:47: in function <__core__/lualib/event_handler.lua:45>

Reproduction

  1. Load a map in the editor saved with a previous version
raiguard commented 1 year ago

Are you using the Map editor option from the main menu? If so, Editor Extensions (and mods as a whole) will not function properly there. Please start a regular freeplay game and use /editor instead.

FlyingRatBull commented 1 year ago

Yes I am which is too bad because that worked like a charm for years. I will try using your method and reply. Thank you!

FlyingRatBull commented 1 year ago

When starting a new game with from the same scenario I now get the following error:

Error while running event EditorExtensions::on_nth_tick(1)
__EditorExtensions__/scripts/infinity-pipe.lua:765: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
    [C]: in function 'pairs'
    __EditorExtensions__/scripts/infinity-pipe.lua:765: in function 'handler'
    __core__/lualib/event_handler.lua:56: in function <__core__/luali/event_handler.lua:54>
raiguard commented 12 months ago

Again, custom scenarios don't really work all that well. I recommend removing EE, re-saving your scenario, then loading it from the new game window after re-enabling EE. Otherwise you will get weird crashes like this.