lua scenario restart button on error

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
User avatar
dog80
Filter Inserter
Filter Inserter
Posts: 279
Joined: Thu Dec 08, 2016 11:57 pm
Contact:

lua scenario restart button on error

Post by dog80 »

hi so what i regularly encounter is that i do some lua scenario coding and testing ingame directly, and i will make errors which results in having to press "ok"(green-button) on error confirmation, then i end up in the main-menu .... i press "play" - "scenarios" - ... i select my scenario... - "create" etc... u see its annoying...

why not add a restart button to the error confirmation, so that while this confirmation is opened and the game is paused before exit, i can fix the issue in the code, then press restart and it will load the new files with the same map gen settings etc., ...

this is the same as if i attended to fix the issue but then end up in getting an error message in the card-generator tab, there i can just then press again on the green "create" button when i have fixed the code and it will either spit out another error message or work and start the game.

idk i would like this^^

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: lua scenario restart button on error

Post by Klonan »

I would like this too :D

User avatar
WIZ4
Fast Inserter
Fast Inserter
Posts: 209
Joined: Thu Apr 07, 2016 1:36 pm
Contact:

Re: lua scenario restart button on error

Post by WIZ4 »

That would be great! Devs please!
My native language is russian. Sorry if my messages are difficult to read.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: lua scenario restart button on error

Post by eradicator »

Would also be nice for non-scenario related modding. When i do testing i go through a lot of "error -> ok -> load game -> load" loops. If there was an button to just load the latest savegame again in the error dialogue that would be great. (And possible even useful to non-modders.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

slippycheeze
Filter Inserter
Filter Inserter
Posts: 587
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: lua scenario restart button on error

Post by slippycheeze »

eradicator wrote:
Mon Jul 15, 2019 7:56 pm
Would also be nice for non-scenario related modding. When i do testing i go through a lot of "error -> ok -> load game -> load" loops. If there was an button to just load the latest savegame again in the error dialogue that would be great. (And possible even useful to non-modders.)
You may, in that context (and possible in scenarios, where I don't know the structure enough to comment), benefit from using some pcall wrappers during development. That isn't as good as the game doing it smartly, but it does let you manually catch any error that happens inside the lua call and respond before it bubbles far enough up to kill the game. YMMV on the state of the save afterwards, of course.

Post Reply

Return to “Ideas and Suggestions”