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

Improved companion order failure reporting somewhat #76193

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

PatrikLundell
Copy link
Contributor

Summary

None

Purpose of change

Try to improve feedback on companion activity failure reasons.

Describe the solution

Split "SKIP_LOCATION" generic failure result on attempts to perform companion activities into several variants to indicate the reason for the failure and than use that result to generate a feedback message.
The reason the reports aren't generated inside the operation is that it's inside a loop where potentially a large number of variants can be checked, which can potentially clutter the log.
One of these failures is then selected for the report if none of the attempts succeeded.

Describe alternatives you've considered

  • Somehow build more detailed error reports inside the operation, feed those back, and have logic to keep one as the "best" failure report to be the one printed if none of the attempts succeeds. That would probably have to be done to be able to produce useful error reports that would say what's missing rather than providing a broad indication (I'm thinking of things like Skill X at level Y, 3 Planks, tool providing the Z capability, etc.). As it currently stands, the only additional info available at the lower level is a potential zone name (and those reports remain inside and are duplicated in the log).
  • Prettify the reports by setting up a translation array indexed by the activities containing UI oriented strings representing the activities rather than using the string version directly.
  • Debate whether reports always should be generated or only when the PC can see the companion. I went for the "always" option, as you'd want to know your companion has failed to perform a task after walking out of view (and from a realism perspective, the companion could have shouted the result to you).

Testing

Much less than I'd like, because I've failed to arrange for most of the error situations.
Failure to reach a construction zone at a roof was produced (and I also found the companion can't use ladders, but will use stairs).
Failure to find a zone was also arranged (dismantle vehicles when the zone doesn't have any vehicle in it).

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Sep 4, 2024
Copy link
Contributor

github-actions bot commented Sep 4, 2024

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • %1$s failed to perform the %2$s activity because of unsufficient skills.

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

Hints for adding a new word to the dictionary
  • If the word is normally in all lowercase, such as the noun word or the verb does, add it in its lower-case form; if the word is a proper noun, such as the surname George, add it in its initial-caps form; if the word is an acronym or has special letter case, such as the acronym CDDA or the unit mW, add it by preserving the case of all the letters. A word in the dictionary will also match its initial-caps form (if the word is in all lowercase) and all-uppercase form, so a word should be added to the dictionary in its normal letter case even if used in a different letter case in a sentence.
  • For a word to be added to the dictionary, it should either be a real, properly-spelled modern American English word, a foreign loan word (including romanized foreign names), or a foreign or made-up word that is used consistently and commonly enough in the game. Intentional misspelling (including eye dialect) of a word should not be added unless it has become a common terminology in the game, because while someone may have a legitimate use for it, another person may spell it that way accidentally.

src/activity_item_handling.cpp Outdated Show resolved Hide resolved
src/activity_item_handling.cpp Outdated Show resolved Hide resolved
src/activity_item_handling.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Sep 4, 2024
@Maleclypse Maleclypse merged commit 28a0a06 into CleverRaven:master Sep 4, 2024
22 of 26 checks passed
@PatrikLundell PatrikLundell deleted the report_failure branch September 4, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants