Todo List


This mod adds a todo list to the single- and multiplayer game to allow players to synchronize their work.

Utilities
1 year, 3 months ago
0.16 - 1.1
196K

b Localization issue for questlog

5 years ago

I just installed your mod. In questlog mode, I see "Unknown key: todo.quest_title_edit" as column title. Works for todo-list mode, though -- there the title is "Edit", as expected.

5 years ago

Thanks for the report.
Which language are you using?

5 years ago

https://github.com/JonasJurczok/factorio-todo-list/issues/126

I've seen the issue in the code. I wanted to release a new version shortly anyway. This will be fixed with it :)

5 years ago

English is the language I use -- translations are always weird (saying that as a translator). Thanks for putting the fix on your todo list! :-)

5 years ago

Please check the newest version. It should fix that issue :)

5 years ago

I fought with it and I'm not ready yet. After my first posting here, I switched over to the todo-list style and added some tasks. The game was saved with the todo list, then I updated your mod and changed the setting so the list is displayed in Questlog style. When I loaded my saved game again, I expected to see a questlog, but still got a todo list.

I exported my list, deactivated the mod, loaded the game without it, saved again, activated the mod again, loaded the game (synchronizing with the mods), and finally had the questlog view. Then I tried to import my exported list. This crashed the game with this error:

The mod Todo List caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Todo-List::on_gui_click (ID 1)
Todo-List/lib/base64.lua:320: attempt to perform arithmetic on field '?' (a nil value)
stack traceback:
Todo-List/lib/base64.lua:320: in function 'd64'
Todo-List/lib/base64.lua:473: in function 'decode64_with_predicate'
Todo-List/lib/base64.lua:496: in function <Todo-List/lib/base64.lua:488>
(...tail calls...)
Todo-List/todo/features/import_task.lua:21: in function 'import_tasks'
Todo-List/todo/features/import_task.lua:12: in function 'on_import_tasks_click'
Todo-List/todo/todo.lua:139: in function 'on_gui_click'
Todo-List/control.lua:20: in function <Todo-List/control.lua:19>

Perhaps both list styles (todo list/questlog) are in different formats; that would be unexpected (I thought these were just different style definitions that would display the same set of data in a different way), but it would explain why the list couldn't be loaded. However, in this case the mod should just show a warning that the data are not compatible with the current style instead of crashing the game. Could you, please, look into that?

For a completely different matter, your mod's changelog file is not parsed correctly:
Error CachedChangelog.cpp:37: Failed to parse changelog for mod Todo List: invalid changelog file, error on line 1.

Please refer to https://forums.factorio.com/viewtopic.php?f=25&t=67140 for an explanation of Factorio's special changelog file syntax. :-)

5 years ago

Thanks for that link. I didn't know they actually have a syntax.

For changing the style closing and opening the UI should be enough. On every redraw the labels are checked and generated.

The problem you experienced is different.

Can you please upload the exported string to pastebin or something? Then I can try to reproduce it.

5 years ago

I just confirmed (because 17 behaviour).
Load game -> change mod setting to questlog -> close todo list (either via button or key combination) -> reopen todo list changes all the labels.

It might make sense to automatically do that though...

https://github.com/JonasJurczok/factorio-todo-list/issues/130

and for the changelog:
https://github.com/JonasJurczok/factorio-todo-list/issues/129

5 years ago

I published a new version.
Can you please verify on your side that
- the mode switching works instantly without any need to reload mods or something
- the changelog actually looks okay (I can't verify it myself at the moment :/ )

Also if you could hand me that export string I investigate the problem.

5 years ago

Thanks, instant mode switching and changelog work now! Also, I've sent you a PM with the export string in the forums.

Another minor issue: In the new field to the right of the tool belt (where you can toggle ALT-mode, exosceleton etc.), your mod creates two new buttons (Toggle and New Task). The toggle button always has the title "Toggle Todo list", even if the mod displays quest logs.

Even more minor: Spelling is inconsistent. In the main window, you use "Quest Log"/"Todo List", the toggle button shows "Todo list", and in the mod settings, it is "Todo List" for the mod title and "Todo list"/"Questlog" for the text style.
In LaTeX, I define macros for frequently recurring strings and use the macros throughout the document. This guarantees consistent spelling -- and if I ever decide to change a string, I have to do it in only one place. I don't know Lua, but that should be possible there as well; it's just assigning and using variables, after all. :-)

5 years ago

Awesome :)

That button description is unfortunately static and can only be changed on game restart.

Redoing spelling for consistency is on my roadmap, but so far I avoided it -.-
And variables in localisation files is not really possible (as far as I know). I have to investigate this.

5 years ago

I just tried out your exported string. It works perfectly fine on my side :/

Does it still crash for you?

5 years ago

Meanwhile, I've updated Factorio to 0.17.14. I still get the same error on importing the string -- regardless of whether I load an existing game (where the todo list already contains the same entries I want to import) or whether I start a new one.

5 years ago

That is really strange. I expected the games to be consistent enough that it should either crash for everyone or not...

Meanwhile I'll add some error handling that it does not crash the game anymore.

Did importing work before?

And did you anything unusual (leading/trailing whitespace, accidentally leaving out the = in the end or something)?

5 years ago
(updated 5 years ago)

That button description is unfortunately static and can only be changed on game restart.

That is too bad. Fortunately, it is only the description that is changing, not the button graphics. So rephrasing might help:

  • "Toggle Todo list/Questlog" seems obvious, but perhaps it could be misunderstood as a switch that turns the todo list into a questlog (and vice versa).

  • Display Todo list/Questlog" would avoid that ambiguity. However, it would only make sense if it would be possible to have different images for the status (button pressed: display list manager window; button not pressed: don't display it). Would that be possible?

Redoing spelling for consistency is on my roadmap, but so far I avoided it -.-

I understand: It really is quite tedious work, and you could waste a lot of time working on it and then having to go over it again and again because you changed something else in your mod. So it seems quite reasonable to put off unifying the strings until everything else is working as it should. Then, the act of crossing the t's and dotting the i's might even be satisfying. :-)

And variables in localisation files is not really possible (as far as I know). I have to investigate this.

Makes sense, I hadn't thought of that, I only knew that you put placeholders into your text that are replaced with the localized strings. But different variants for one string in the same locale could, indeed, be a problem.

5 years ago
(updated 5 years ago)

Meanwhile I'll add some error handling that it does not crash the game anymore.

Thanks!

Did importing work before?

I can't really tell. Actually, I just installed your mod shortly before posting my bug report. Being curious, I played around with the settings because I wanted to see the different formats before settling for one. So, I made up some example tasks and, finally, crashed the mod. :-)

And did you anything unusual (leading/trailing whitespace, accidentally leaving out the = in the end or something)?

I copied the string and immediately pasted it into an editor. Before inserting it anywhere (PM/game), I just <CTRL>+<a>-ed there and copied everything in the editor window. Just tried again now to make sure: there are no leading spaces and the cursor is placed right after the final "=". Importing the string still crashed the game.

5 years ago

On mobile, I'll answer the other things later:
Okay if this still crashes then my last guess is encoding. Does it also crash when you paste it directly into the import window without going through an editor?

If not then what system are you on and what file encoding is your editor using?

I just tried to add a test for this and couldn't even crash the library if I tried -.-

5 years ago
(updated 5 years ago)

"Toggle Todo list/Questlog" seems obvious, but perhaps it could be misunderstood as a switch that turns the todo list into a questlog (and vice versa).

Display Todo list/Questlog" would avoid that ambiguity. However, it would only make sense if it would be possible to have different images for the status (button pressed: display list manager window; button not pressed: don't display it). Would that be possible?

I can change the wording to make it clearer.
The other things are not possible I'm afraid.

I could of course remove the button and replace it with one that is described differently with a different picture.. but this would mess up the whole order of the toolbar and users would have to reconfigure it again.

Makes sense, I hadn't thought of that, I only knew that you put placeholders into your text that are replaced with the localized strings. But different variants for one string in the same locale could, indeed, be a problem.

Yeah that is unfortunately not possible.

5 years ago

Just sent you a PM in the forums again, with a verbose logfile of a complete Factorio session with a new game started. Perhaps that could help?

5 years ago

Just sent you a PM in the forums again, with a verbose logfile of a complete Factorio session with a new game started. Perhaps that could help?

Unfortunately no. It only contains the error.
But this is actually a really good idea.
Before you import can you please enable "show debug messages" in the mod settings?
Then after the crash the logfile should contain all the debug messages. Also can you please check the script-output folder for textfiles?

This reminds me that I wanted to add crash reporting of some sort....

5 years ago

Then after the crash the logfile should contain all the debug messages. Also can you please check the script-output folder for textfiles?

Where is that folder? I don't seem to have it. Now I removed my mods, save files, blueprints, achievements etc. to another location, deleted all files, unpacked the last full install file I downloaded from factorio.com, updated to 0.17.4 with the autoupdater, installed your mod (it is the only one present now), enabled debug messages, started a new game, and imported the string. There's no obviously named script-output folder anywhere, and these are the only text files below Factorio's root directory:

pc@debian:~/GOG_Games/Factorio/0.17$ find . -iname "txt"
./data/core/fonts/license IBMPlex.txt
./data/eula.txt
./data/changelog.txt
./data/base/graphics/entity/boiler/boiler-E-patch.txt
./data/base/graphics/entity/boiler/hr-boiler-E-patch.txt
./data/base/graphics/entity/assembling-machine-1/assembling-machine-0.txt
./data/licenses.txt

5 years ago

AHH you are on a Debian.
Then the paths are different.
I just tested it and unfortunately the game does not print the chat to the logfile..

I'm going to add debug output to a file next.

The script-output folder should be parallel to your mods folder.

I also have a Mac here.. I'll see if I can reproduce the problem there.

5 years ago

Just checked on the wiki. "script-output" is no generic folder name. It is set in config.ini, and in my case, it was set to:

write-data=PATH__executable/../..

That is Factorio's root directory, where folders like mods and saves are created.

Now, as log messages are not saved to the logfile, I wrote down what appeared in the chat after starting a new game. Text in brackets indicate what I did to produce the next output:

Creating Basic UI for player Pi-C
[click on Toggle Todo list]
Maximizing UI for player Pi-C
updating button label
[click on Import in mod's main window]
[click into input box in new window]
Unknown todo element name:todo_import_string_textbox
[paste string into the window]
[click on Import of mod's import window]
CRASH

5 years ago

Okay. Sorry I built the release but forgot to publish it :D

There is a new version now that should prevent the crash.
Additionally it produces more log output of what actually was in the encoded string.

Unfortunately I won't have more time today but I can maybe publish a new version tomorrow that also writes debug output to a file. Then we could investigate it further.

But for now it should at least prevent crashes.

5 years ago

Thank you, that's so much better. Also, there is no need to hurry -- enjoy your weekend! :-)

5 years ago

:) awesome

New response