Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to start in 0.18.27 #28

Closed
DidierLoiseau opened this issue May 26, 2020 · 6 comments
Closed

Fails to start in 0.18.27 #28

DidierLoiseau opened this issue May 26, 2020 · 6 comments

Comments

@DidierLoiseau
Copy link

When running on Factorio 0.18.27 (released today), the game fails to start with the following error:

Factorio failed to load creative-mod

@DidierLoiseau
Copy link
Author

It seems search_button was indeed removed from style.lua.

I tried to replace it with frame_action_button (note: I have no idea what I am doing, I have never worked on mods, but it seems to be a similar style), but then I get the following error with:
Parent style not found

Mods to disable:Failed to load mods: Error while loading gui-style prototype "default" (gui-style): Parent style not found: creative_mode_magic_wand_popup_ghost_slot_button_style.
Modifications: core › Creative Mod

It seems the parent of the parent (slot_with_filter_button) was actually removed. I tried replacing it with blue_slot… next

Mods to disable:Failed to load mods: Error while loading gui-style prototype "default" (gui-style): Parent style not found: creative_mode_tile_slot_selected_style.

Similar thing with selected_logistic_slot_button. I used logistic_slot_button instead. Then the game managed to start.

I loaded a save, then clicked Creative Mode > Modding > Events, and it crashed with:

Error while running event creative-mod::on_gui_click (ID 1)
Unknown style search_button
stack traceback:
	__creative-mod__/scripts/gui-menu-modding.lua:378: in function 'create_or_destroy_events_menu_for_player'
	__creative-mod__/scripts/gui-menu-modding.lua:1034: in function 'on_gui_click'
	__creative-mod__/scripts/gui-menu.lua:328: in function 'on_gui_click'
	__creative-mod__/scripts/gui.lua:283: in function 'on_gui_click'
	__creative-mod__/scripts/events.lua:513: in function '?'
	__creative-mod__/scripts/events.lua:1154: in function <__creative-mod__/scripts/events.lua:1083>
stack traceback:
	[C]: in function 'add'
	__creative-mod__/scripts/gui-menu-modding.lua:378: in function 'create_or_destroy_events_menu_for_player'
	__creative-mod__/scripts/gui-menu-modding.lua:1034: in function 'on_gui_click'
	__creative-mod__/scripts/gui-menu.lua:328: in function 'on_gui_click'
	__creative-mod__/scripts/gui.lua:283: in function 'on_gui_click'
	__creative-mod__/scripts/events.lua:513: in function '?'
	__creative-mod__/scripts/events.lua:1154: in function <__creative-mod__/scripts/events.lua:1083>

I thus changed

	frame_caption_button = "frame_action_button",

in defines.lua (only had replaced search_button it in styles.lua previously) and that fixed it (although the search button is black instead of grey, which is probably wrong).

@jodli
Copy link
Owner

jodli commented May 27, 2020

I fixed it exactly as you've described and pushed it to the mod portal.

But after testing it together with other mods (which apparently are not updated for 0.18.27 themselves) we have some mod incompatibilities. :(

But thank you very much for your help debugging this problem... I'm kind of lost in moving houses so every help to support the mod is appreciated! <3

@DidierLoiseau
Copy link
Author

I fixed it exactly as you've described and pushed it to the mod portal.
Thanks for the update! As I said, however, I have no idea whether those changes were correct. They just allowed the game to start…

When I first started the game after updating, I had some strange tool-tips on GUI items, showing their technical details, could it be due to the mod? After disabling/enabling it again this was gone but I also messed a bit with the F4 menu so I am not sure what fixed it.

@DidierLoiseau
Copy link
Author

Ok so I hadn't tested it much after that (just went quickly through the menus), I hit another crash when trying to use the Deconstruction Planner:

Error MainLoop.cpp:1205: Exception at tick 227942: The mod Creative Mod (1.4.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event creative-mod::on_tick (ID 0)
on_robot_pre_mined (ID 15) (15) can't be raised through script.
stack traceback:
	__creative-mod__/scripts/util.lua:161: in function 'raise_event'
	__creative-mod__/scripts/util.lua:305: in function 'destroy_entity_and_raise_event'
	__creative-mod__/scripts/cheats.lua:2836: in function 'tick'
	__creative-mod__/scripts/events.lua:185: in function <__creative-mod__/scripts/events.lua:154>
stack traceback:
	[C]: in function 'raise_event'
	__creative-mod__/scripts/util.lua:161: in function 'raise_event'
	__creative-mod__/scripts/util.lua:305: in function 'destroy_entity_and_raise_event'
	__creative-mod__/scripts/cheats.lua:2836: in function 'tick'
	__creative-mod__/scripts/events.lua:185: in function <__creative-mod__/scripts/events.lua:154>

and of course when trying to place a blueprint:

Error MainLoop.cpp:1205: Exception at tick 225556: The mod Creative Mod (1.4.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event creative-mod::on_tick (ID 0)
on_robot_built_entity (ID 14) (14) can't be raised through script.
stack traceback:
	__creative-mod__/scripts/util.lua:161: in function 'raise_event'
	__creative-mod__/scripts/util.lua:229: in function 'revive_entity_ghost_and_raise_event'
	__creative-mod__/scripts/cheats.lua:2765: in function 'tick'
	__creative-mod__/scripts/events.lua:185: in function <__creative-mod__/scripts/events.lua:154>
stack traceback:
	[C]: in function 'raise_event'
	__creative-mod__/scripts/util.lua:161: in function 'raise_event'
	__creative-mod__/scripts/util.lua:229: in function 'revive_entity_ghost_and_raise_event'
	__creative-mod__/scripts/cheats.lua:2765: in function 'tick'
	__creative-mod__/scripts/events.lua:185: in function <__creative-mod__/scripts/events.lua:154>

This breaks some of the key features of this mod 😐

@DidierLoiseau
Copy link
Author

DidierLoiseau commented May 27, 2020

Ok, so those event breaking changes are documented here (and the GUI changes are documented here but I didn't read it).

I could fix the first one by simply removing that raise_event(on_robot_pre_mined) call. AFAICT scripts should not raise this event, and the recommended alternative is already raised thanks to the raise_event flag passed to entity.destroy(). Note that this makes the destroyer_player parameter unused.

The second one I also fixed by removing the raise_event(on_robot_built_entity) call and passing raise_event to entity_ghost.revive().

This fixes the above problems, but there should be more changes required. There are 2 more on_robot_* events in util.lua that should be removed/replaced, and then the get_fake_robot_param() won't be used anymore.

There are also 2 calls to raise_event() that should be reviewed in the magic wand code where it raises on_built_entity and on_player_built_tile.

The custom events in remote-interface.lua should be fine.

Appart from that, regarding:

When I first started the game after updating, I had some strange tool-tips on GUI items, showing their technical details, could it be due to the mod? After disabling/enabling it again this was gone but I also messed a bit with the F4 menu so I am not sure what fixed it.

Could it come from this line:

if mods["debugadapter"] then require('__debugadapter__/debugadapter.lua') end

present in both data-final-fixes.lua and control.lua in the published release but not on GitHub?

@jodli
Copy link
Owner

jodli commented May 28, 2020

Apparently I forgot to remove the debugadapter stuff before packaging the mod :(

I've added a new version 1.4.2 with lots of changes regarding the raise script built/revive/destroy stuff.

Thank you so much for your work here! 😍

@jodli jodli closed this as completed Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants