Flat-Badger-1971 / ArchiveHelper

0 stars 1 forks source link

Feature suggestion: help in the hidden level Treacherous Crossing #14

Closed Stemuweb closed 5 months ago

Stemuweb commented 5 months ago

I have noticed that the Treacherous Crossing has only a few different possibilities. Maybe players would be happy to have a slash command such as /ah crossing that would list the different combinations. Or /ah crossing 1 would list the combinations beginning by the first switch (from left to right).

So far, here are the combinations I've noticed:

1  5  4 2L 3  6
2  5  1 4  3
3R 1  4 6  5L 2
3  5  1 4  2L 6
5  1  4 2  3
5  1  4 2  3  6
5  2L 6 4  3R 1 
5R 3  4 1  2  6

L or R means turning left or right at a fork in the road. I don't know if it widely known or not but it would probably be a good helper ;)

Stemuweb commented 5 months ago

Still no luck tonight. No Treacherous crossing but so many goat levels (over 10 since yesterday!)

We switched to debug mode and tested with the / command. It works well overall (data sharing, drop-downs disabled for the non-leader, change of leader detected).

However, can you confirm that it's not possible to visually update the drop-down lists programmatically when data is received?

This leads to a small bug in this case:

  1. The group leader (A) chooses [5] [1] [..] (start of the path and 2nd step)
  2. Both players see 2 solutions but the other player B still sees his (disabled) drop-downs boxes as empty: [..] [..] [..]
  3. A transfers leadership to B (we've kept our panels open. I don't know if this would also happen with closed panels)
  4. B selects the value 3 as the end of the path. The only solution appears in both players' panels but B only sees [..] [..] [3] in his drop-downs, and has to guess what values A has send. This is very confusing (the logic values are taken into account but it doesn't match what is visible).

Ideally, the drop-downs boxes should be visually updated, but you'd probably have done that already if it were possible.

To avoid this confusion, you'd at least have to reset both players' drop-downs when the lead changes. I hope this is at least technically possible.

Otherwise, as a last resort, close the panels to force a rebuild... (I say this having no idea how the UI works in this game).

I admit it's a case that should only happen exceptionally, but one of the players might prefer to be the one handling the drop-downs while the other inspects the switches, and they'll want to pass the lead to each other, so it would be better to make sure it doesn't look buggy.

Otherwise, apart from this detail, the functionality will be good for a release. Great work!

Flat-Badger-1971 commented 5 months ago

The dropdowns should be updating, I'll look into this

Stemuweb commented 5 months ago

https://github.com/Flat-Badger-1971/ArchiveHelper/issues/14#issuecomment-2028514157

As seen in my first draft of the UI (a long time ago!), I had in mind to highlight the elements of the path that correspond to the values in the drop-down lists. I didn't want to bother you with that at the moment, so I tried it out to see if it was feasible.

See branch 'crossing-colour-solution'

I tested the blue colour used by "possible paths" but in the end I preferred the yellow, which balances out the title at the top and the drop-down lists in the middle.

I'll let you try it out and see what you think visually. No problem if you don't like it, it's only an 'embellishment' and I could do without it. Otherwise, you can probably rewrite it in a more optimal way (the number conversions are already done above for the "test" variable, there might be a way to store and reuse them, etc).

Stemuweb commented 5 months ago

Also (and it will be my last enhancement for the helper): since french needs 4 lines of text and I have room for a few more words, I suggest to add this at the end of the instructions: ", until only one solution remains." I just want to be the clearer possible so that no one has difficulty understanding the how and why.

L(
    AH .. "CROSSING_INSTRUCTIONS",
    "Find the switch corresponding to the start of the path and select it in the dropdown below (1 is the leftmost switch, 6 the rightmost)." ..
        " Then, if necessary, find the 2nd step or the end of the path, until only one solution remains."
)
L(
    AH .. "CROSSING_INSTRUCTIONS",
    "Trouvez l'interrupteur correspondant au début du chemin et sélectionnez-le dans la liste déroulante ci-dessous (1 est le plus à gauche, 6 le plus à droite)." ..
        " Puis, si nécessaire, trouvez la 2ème étape ou la fin du chemin, jusqu'à ce qu'il ne reste qu'une solution."
)

I checked the length in both languages and it fits. The german translation is not set yet (but a fifth line of text will not overlap with the content below instructions anyway).

A translation by deepl has just one word too many. A real person could certainly write it more naturally and perhaps shorten it too:


L(
    AH .. "CROSSING_INSTRUCTIONS",
    "Suchen Sie den Schalter, der dem Anfang des Pfades entspricht, und wählen Sie ihn in der Dropdown-Liste unten aus (1 ist der Schalter ganz links, 6 der ganz rechts)." ..
        " Suchen Sie dann ggf. den 2. Schritt oder das Ende des Weges, bis nur noch eine Lösung übrig bleibt."
)
Stemuweb commented 5 months ago

The helper works well! Two small points:

  1. the keybind should close it even if you are not in the Treacherous crossing (but there's no need to do it because of point 2)
  2. the panel should close when leaving the crossing anyway (or better when detecting the success or fail message?)
Flat-Badger-1971 commented 5 months ago
  1. You're correct - I'll sort that
  2. It should automatically close when you succeed for fail at the crossing based on the following values appearing in your screen announcements - they are currently missing from the French (and German) translations:

L(AH .. "CROSSING_FAIL", "Locked")

L(AH .. "CROSSING_SUCCESS", "Solved")

There's also a bug on line 199 of events.lua which is supposed to act as a failsafe - it should be AH.CrossingHelperFrame, not AH.CrossingHelper

Stemuweb commented 5 months ago

Thank you. I'll update them as soon as I can.

Edit: No luck this evening, I didn't manage to reach the treacherous level despite numerous attempts.

From memory, it should be: L(AH .. "CROSSING_FAIL", "verrouillé") L(AH .. "CROSSING_SUCCESS", "résolu")

I'm currently playing in german. I should get both french and german translation if I'm luckier tomorrow.

Have you seen my previous comment (https://github.com/Flat-Badger-1971/ArchiveHelper/issues/14#issuecomment-2051725940)? I added a few lines of code to colour the path steps coming from the drop-downs.

Flat-Badger-1971 commented 5 months ago

Yep, saw 14 and implemented it almost verbatim.

Stemuweb commented 5 months ago

Almost done Now done. I have bundled these translations into a PR (I've also removed the rest of the commit comments, and ensured that the line numbers corresponded in the 3 languages). See the PR text about the german strings that may need a human verification.

English

Just adding the reference message, because I came across in a gameplay video

L(AH .. "CROSSING_FAIL", "Failed")
L(AH .. "CROSSING_SUCCESS", "Solved") -- You Solved the Corridor Puzzle

French

L(AH .. "CROSSING_FAIL", "verrouillés") -- Les leviers sont verrouillés. Personne ne peut passer.
L(AH .. "CROSSING_SUCCESS", "résolu") -- Vous avez résolu l'énigme du couloir

L(AH .. "OPTIONAL_LIBS_CHAT", "Archive Helper fonctionne mieux si LibChatMessage est installé.")
L(AH .. "OPTIONAL_LIBS_SHARE", "Pour que le mode Duo fonctionne correctement, veuillez installer LibDataShare.")

German

L(AH .. "CROSSING_FAIL", "gesperrt") -- Die Hebel sind gesperrt. Keiner kommt weiter.
L(AH .. "CROSSING_SUCCESS", "gelöst") -- Ihr habt des Rätsel der Gänge gelöst

For next release

Be sure to remove debug mode

Stemuweb commented 5 months ago

I'll do a final test on this translated branch that include all your latest code. I'll remove the debug mode.

If you want to do a release on minion, better not change anything at the last minute (except translation corrections of course)

And remove debug mode in the release ;D (so subtle...)

Edit: also check the reopened issue about missing library warnings in settings panel (not an important issue, only cosmetic)

Flat-Badger-1971 commented 5 months ago

Added your translations. I'll ask the guy who did the original German translations to double check, but he doesn't seem to be on much.

Also, if you see lines like this: ``-- luacheck: ignore 631

Could you make sure they stay where they are in the file please? They don't affect functionality, but they do stop VS Code complaining about things like 'line too long' in the translations. I use LuaCheck for linting and find it very handy.

Stemuweb commented 5 months ago

Could you make sure they stay where they are in the file please? They don't affect functionality, but they do stop VS Code complaining about things like 'line too long' in the translations. I use LuaCheck for linting and find it very handy.

Oh, thank you for explain this to me, I thought it was put by github. I'll make sure to keep them from now on.

If you have a good vscode add-on for lua, I would be interested to know which one.

Flat-Badger-1971 commented 5 months ago

I installed luacheck from here: https://github.com/mpeterv/luacheck Then I use it in conjuction with the vscode-lua extension and an ever-evolving .luacheckrc file