ZwerOxotnik / rpg_items

[Factorio mod] 63 items, 30 effects, lots of fun!
3 stars 3 forks source link

[FIXED?] Crash when click RPG mod GUI button #2

Open malomaster opened 2 years ago

malomaster commented 2 years ago

Usually any information is enough to fix a bug, but, please, consider to provide more information now or later.

Please drop the factorio-current.log file or factorio-previous.log here

Describe the bug Found a conflict with an https://mods.factorio.com/mod/RPG mod from Gerkiz. When you try to click RPG GUI button on top of the screen, it opens RPG GUI as expected, but in the next second RPG Items will crash with this error:

_Мод RPG предметы (0.21.2) вызвал неустранимую ошибку. Пожалуйста, сообщите об этой ошибке автору мода. Error while running event m-rpg_items::on_nth_tick(60) __m-rpg_items__/control.lua:523: attempt to index field 'rpgitems_item_gui' (a nil value) stack traceback: __m-rpg_items__/control.lua:523: in function <__m-rpg_items__/control.lua:499>_

Steps to reproduce

  1. Install both mods.
  2. Load game or create new map.
  3. Click on [RPG] button on top bar.
  4. Got crash message.
ZwerOxotnik commented 2 years ago

Hm, I'll check later, but it seems like a GuiElement was deleted. (Perhaps, "RPG" did something with it)

malomaster commented 2 years ago

Yeah, it is possible because RPG mod have his own GUI generated by script, and there are GuiElement calls. I'm not a programmer and know about coding only enough to copy one item/recipe, rename it and edit some stats to make new, not more, but I tried to read the code and saw there some GUI-related functions. Maybe you need to add some check in your function started on 499 line? Smth like: If mods["RPG"] AND NOT «click on RPG GUI button» (I don't know how to properly write it) THEN and then your function execute, else just ends function. Or functions and scripting will not work in that way?

ZwerOxotnik commented 2 years ago

https://mods.factorio.com/mod/m-rpg_items/discussion/62fd102e546c4c6a02fd7337

ZwerOxotnik commented 1 year ago

I made a new fix for it, It should work now. https://mods.factorio.com/mod/m-rpg_items/downloads

ZwerOxotnik commented 1 year ago

@malomaster