The Ruins Mod 2.0 deprecated


This mod is now deprecated and merged with `AbandonedRuins_updated_fork`.

Content
a month ago
2.0
3.15K
Environment

b [FIXED] expression_parsing.lua:49: bad argument #2 of 3 to 'index' (string expected, got nil)

6 months ago

The mod The Ruins Mod 2.0 (1.1.9) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event AbandonedRuins20::on_tick (ID 0)
AbandonedRuins20/lua/expression_parsing.lua:49: bad argument #2 of 3 to 'index' (string expected, got nil)
stack traceback:
[C]: in function '__index'
__AbandonedRuins20
/lua/expression_parsing.lua:49: in function '?'
AbandonedRuins20/lua/expression_parsing.lua:77: in function 'entity'
AbandonedRuins20/lua/spawning.lua:24: in function 'spawn_entity'
AbandonedRuins20/lua/spawning.lua:94: in function 'spawn_entities'
AbandonedRuins20/lua/spawning.lua:172: in function 'spawn_ruin'
AbandonedRuins20/lua/spawning.lua:184: in function 'spawn_random_ruin'
AbandonedRuins20/control.lua:58: in function <AbandonedRuins20/control.lua:53>

6 months ago

1.1.10 is up, I guess I have to ignore first part (mostly key or index) from pairs() function?

6 months ago

ty

6 months ago
(updated 6 months ago)

Here some new crash
This one seems to be a repeat of https://mods.factorio.com/mod/AbandonedRuins20/discussion/67a7781679ab9cd57eb83e5a

The mod The Ruins Mod 2.0 (1.1.10) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event AbandonedRuins20::on_tick (ID 0)
LuaPrototypes doesn't contain key tree.
stack traceback:
[C]: in function 'index'
__AbandonedRuins20
/lua/expression_parsing.lua:49: in function '?'
AbandonedRuins20/lua/expression_parsing.lua:77: in function 'entity'
AbandonedRuins20/lua/spawning.lua:134: in function 'parse_variables'
AbandonedRuins20/lua/spawning.lua:171: in function 'spawn_ruin'
AbandonedRuins20/lua/spawning.lua:184: in function 'spawn_random_ruin'
AbandonedRuins20/control.lua:58: in function <AbandonedRuins20/control.lua:53>

6 months ago

Sorry, I don't know how to fix it. The old code used a function game.get_filtered_entity_prototypes() but that is no longer available and I currently don't know how to replace it. Have to go to work.

6 months ago

Oh this issue seems to be trying to generate the old tree Entity and mentioned in the error LuaPrototypes doesn't contain key tree. i think that would be one of the issues.

6 months ago

I have updated this mod to 1.1.11, does this fix it for you? You might see some (more?) debug messages. The fix actually more feels like a workaround: https://mods.factorio.com/mod/AbandonedRuins20/discussion/67ab8a4cd76ea0b3a7b6b750

6 months ago
(updated 6 months ago)

Sorry, I don't know how to fix it. The old code used a function game.get_filtered_entity_prototypes() but that is no longer available and I currently don't know how to replace it. Have to go to work.

That function was replaced with:
https://lua-api.factorio.com/stable/classes/LuaPrototypes.html#get_entity_filtered
so: prototypes.get_entity_filtered()

6 months ago

249.557 Error MainLoop.cpp:1435: Exception at tick 1: Мод The Ruins Mod 2.0 (1.1.11) вызвал неустранимую ошибку.
Пожалуйста, сообщите об этой ошибке автору мода.

Error while running event AbandonedRuins20::on_tick (ID 0)
LuaPrototypes doesn't contain key tree.
stack traceback:
[C]: in function 'index'
__AbandonedRuins20
/lua/expression_parsing.lua:49: in function '?'
AbandonedRuins20/lua/expression_parsing.lua:77: in function 'entity'
AbandonedRuins20/lua/spawning.lua:138: in function 'parse_variables'
AbandonedRuins20/lua/spawning.lua:175: in function 'spawn_ruin'
AbandonedRuins20/lua/spawning.lua:188: in function 'spawn_random_ruin'
AbandonedRuins20/control.lua:58: in function <AbandonedRuins20/control.lua:53>
278.883 Info AppManager.cpp:342: Deleting active scenario.

6 months ago
(updated 6 months ago)

Sorry, I don't know how to fix it. The old code used a function game.get_filtered_entity_prototypes() but that is no longer available and I currently don't know how to replace it. Have to go to work.

That function was replaced with:
https://lua-api.factorio.com/stable/classes/LuaPrototypes.html#get_entity_filtered
so: prototypes.get_entity_filtered()

Ah, thank you! So do I need to replace the code recommended by @Samael25 in `lua/express_parsing.lua?

6 months ago

249.557 Error MainLoop.cpp:1435: Exception at tick 1: Мод The Ruins Mod 2.0 (1.1.11) вызвал неустранимую ошибку.
Пожалуйста, сообщите об этой ошибке автору мода.

Error while running event AbandonedRuins20::on_tick (ID 0)
LuaPrototypes doesn't contain key tree.
stack traceback:
[C]: in function 'index'
__AbandonedRuins20
/lua/expression_parsing.lua:49: in function '?'
AbandonedRuins20/lua/expression_parsing.lua:77: in function 'entity'
AbandonedRuins20/lua/spawning.lua:138: in function 'parse_variables'
AbandonedRuins20/lua/spawning.lua:175: in function 'spawn_ruin'
AbandonedRuins20/lua/spawning.lua:188: in function 'spawn_random_ruin'
AbandonedRuins20/control.lua:58: in function <AbandonedRuins20/control.lua:53>
278.883 Info AppManager.cpp:342: Deleting active scenario.

That is a duplicate.

6 months ago
(updated 6 months ago)

Sorry, I don't know how to fix it. The old code used a function game.get_filtered_entity_prototypes() but that is no longer available and I currently don't know how to replace it. Have to go to work.

That function was replaced with:
https://lua-api.factorio.com/stable/classes/LuaPrototypes.html#get_entity_filtered
so: prototypes.get_entity_filtered()

Ah, thank you! So do I need to replace the code recommended by @Samael25 in `lua/express_parsing.lua?

I don't know what are you referring to about Samael. But in the file you stated replace line 49 with
for entity in pairs(prototypes.get_entity_filtered({{filter = "type", type = t.entity_type}})) do
which is the line you commented out 1 line above but with replaced function

6 months ago

I don't know what are you referring to about Samael. But in the file you stated replace line 49 with
for entity in pairs(prototypes.get_entity_filtered({{filter = "type", type = t.entity_type}})) do
which is the line you commented out 1 line above but with replaced function

I mean the code in lua/spawning.lua, line 26-29.

6 months ago

1.1.12 is up now.

6 months ago

I mean the code in lua/spawning.lua, line 26-29.

I think you mean line 75-78
That one is supposed to be a sanity check for items in ruin sets that don't exist. It probably doesn't actually work because it seems to check against the list of entities instead of the list of items. Also it might not be needed since the insert function used later is handling that anyways by just skipping over said item

6 months ago

Yes, that is an identical line, written by original author.

This thread has been locked.