Page 1 of 1

[wheybags] [0.17.34] Map Editor + NPE: soft crash "level::on_player_changed_position(ID81)"

Posted: Wed May 01, 2019 1:14 pm
by boskid
Steps to reproduce:
- run factorio
- "map editor"
- "load scenario"
- "Introduction/level-01"
- "Load"
- after loading, press arrow left (for example)

Result:

Code: Select all

Error while running event level::on_player_changed_position (ID 81)
__base__/lualib/player_tracker.lua:6: attempt to index field 'behaviors' (a nil value)
stack traceback:
	__base__/lualib/player_tracker.lua:6: in function 'log_behavior'
	__base__/lualib/player_tracker.lua:175: in function '?'
	__base__/lualib/event_handler.lua:7: in function <__base__/lualib/event_handler.lua:4>

Feels like minor issue, almost like "wont fix". Not posting in "Campaign / Scenario issues" as it feels like issue of map editor (executing scripts when not expecting scripts to run in map editor). If it is more like issue of scripting, feel free to move to "Campaign / Scenario issues"

-- edit:

Ref? 58702

Also by choosing time control and unpausing, there will be other soft crash:

Code: Select all

Error while running event level::on_tick (ID 0)
__base__/lualib/popup.lua:108: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
	[C]: in function 'pairs'
	__base__/lualib/popup.lua:108: in function '?'
	__base__/lualib/event_handler.lua:7: in function <__base__/lualib/event_handler.lua:4>
-- edit:

Other possible crashes:
- by building

Code: Select all

Error while running event level::on_built_entity (ID 6)
__base__/lualib/player_tracker.lua:6: attempt to index field 'behaviors' (a nil value)
stack traceback:
	__base__/lualib/player_tracker.lua:6: in function 'log_behavior'
	__base__/lualib/player_tracker.lua:245: in function '?'
	__base__/lualib/event_handler.lua:7: in function <__base__/lualib/event_handler.lua:4>
- by destroying (after switching to "template" layer)

Code: Select all

Error while running event level::on_player_mined_entity (ID 65)
__base__/lualib/player_tracker.lua:6: attempt to index field 'behaviors' (a nil value)
stack traceback:
	__base__/lualib/player_tracker.lua:6: in function 'log_behavior'
	__base__/lualib/player_tracker.lua:227: in function '?'
	__base__/lualib/event_handler.lua:7: in function <__base__/lualib/event_handler.lua:4>

Re: [wheybags] [0.17.34] Map Editor + NPE: soft crash "level::on_player_changed_position(ID81)"

Posted: Wed May 01, 2019 2:13 pm
by wheybags
Yes, the scenario lua runs in the editor, and the code is not written to be safe in the editor, as that would be too much work.
If you want to edit the map, you can copy the blueprint.zip out and back in (that's what we do :p)