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^^
lua scenario restart button on error
Moderator: ickputzdirwech
Re: lua scenario restart button on error
I would like this too
Re: lua scenario restart button on error
That would be great! Devs please!
My native language is russian. Sorry if my messages are difficult to read.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: lua scenario restart button on error
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.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Filter Inserter
- Posts: 587
- Joined: Sun Jun 09, 2019 10:40 pm
- Contact:
Re: lua scenario restart button on error
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.eradicator wrote: ↑Mon Jul 15, 2019 7:56 pmWould 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.)