Author Topic: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled  (Read 3854 times)

Offline Xolvix

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Sometimes it's obvious why a facility can't be dismantled - if a craft occupies a hanger, if all available lab/workshop space is being used, etc. But it's not unusual (especially in mods) for facilities to be given multiple duties like providing additional storage space, maybe holding a few prisoners for research, maybe even contributing a bit of workshop space. Sometimes I get confused as to why I can't dismantle a facility, and even if I end up going through all the stats carefully it's still not entirely obvious.

So if you try to dismantle a facility and get the "Facility in use" screen, it would be nice if there was a message (multiple if needed) for why it can't so the player can do something about it. I mean the game clearly knows - make it clear to the player.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Re: [Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #1 on: March 06, 2023, 12:02:06 pm »
I mean the game clearly knows - make it clear to the player.

Sorry to disappoint you, but there are many cases where the game also doesn't "clearly" know.

There are many types of rules and some of them are so generic that they cannot be checked "individually" (for the lack of a better word).
For example all the business with required/forbidden/provided services.
In this case, the game would (temporarily) remove the facility from the base and then calculate the global impact of all remaining facilities on the base as such.
The game will know that "the base as a whole has a problem", but it will not know "which facility or facilities caused the problem" or sometimes even what particular kind of problem it is.
So the game could only tell you that "there is something wrong with the base after removing this facility"... which doesn't tell you more than "facility is in use".

That's the price to pay for having ultra-generic rules.

Now, I'm not saying all rules are as complicated as this... we could indeed improve the error messages for some of the rules... just saying we cannot do that for every single possible scenario/combination.

Offline Xolvix

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: [Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #2 on: March 07, 2023, 01:38:23 am »
You're right, that does disappoint me.  :'(

I have a feeling most suggestions are discarded but hey, gotta try sometimes. No worries.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Re: [Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #3 on: March 07, 2023, 09:07:37 am »
I didn't discard it, it's a nice suggestion. I would like to have it as a player too.

I just wanted to explain why such an "obvious" feature isn't available yet.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: [Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #4 on: March 10, 2023, 01:30:43 pm »
I suggest the first error message to be a storage space check.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Re: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #5 on: February 02, 2024, 01:07:49 pm »
Done.

https://github.com/MeridianOXC/OpenXcom/commit/254ecccacfafc3c80e2229b15c76231126cb576f

As mentioned above, it doesn't cover all possible cases, situations and combinations.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11704
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #6 on: February 02, 2024, 02:03:14 pm »
Wow, this looks super useful, thanks.

What if there are multiple reasons why you can't remove a facility? (For example, you need that manufacturing space and storage, and the facility grants both.) Will you get multiple warnings?

Offline Yankes

  • Commander
  • *****
  • Posts: 3329
    • View Profile
Re: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #7 on: February 02, 2024, 03:33:57 pm »
Only one, it would be near impossible to propagate more data than first "error".

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 180
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects
Re: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #8 on: February 08, 2024, 07:09:22 pm »
Wow, this looks super useful, thanks.

What if there are multiple reasons why you can't remove a facility? (For example, you need that manufacturing space and storage, and the facility grants both.) Will you get multiple warnings?


Only one, it would be near impossible to propagate more data than first "error".



I'm assuming if you addressed the first issue, i.e. like storage space, then try again it would give you the next issue if multiple exist, so a little tedious, but still very helpful to resolve issues vs digging through all the potential reasons for a specific one of multiple facility properties.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Re: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #9 on: February 09, 2024, 07:43:33 pm »
I'm assuming if you addressed the first issue, i.e. like storage space, then try again it would give you the next issue if multiple exist, so a little tedious, but still very helpful to resolve issues vs digging through all the potential reasons for a specific one of multiple facility properties.

You assume correctly.

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 180
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects
Re: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #10 on: March 30, 2024, 05:24:08 pm »
Done.

https://github.com/MeridianOXC/OpenXcom/commit/254ecccacfafc3c80e2229b15c76231126cb576f

As mentioned above, it doesn't cover all possible cases, situations and combinations.

I'm getting the "Facility In Use" message without any reasons when trying to remove a base facility, not build over it.  I looked at the code in the commit above and to me it looks like all the checks are for building over or a case when part of the facility would be disconnect.  I have neither of those cases in this situation, simply want to remove a facility. Is there a missing check for when just removing the facility without building over or disconnecting part of the base?

Or is it BRUTAL AI's issue since the facility I'm trying to remove is a hangar type 'garage' with hangar type 1
https://github.com/Xilmi/OpenXcom/tree/oxce-plus/Examples

Game Version:
OXCE: 7.12.2 BAI: 8.3.3 (2024-03-23)


Well I feel a little silly. I figured out the cause (I had a craft out) and although the base showed an empty hangar I was trying to remove, it was really full, that's why I got mixed up.
« Last Edit: March 30, 2024, 05:28:28 pm by 0xEBJC »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9057
    • View Profile
Re: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #11 on: March 30, 2024, 06:36:40 pm »
I'm getting the "Facility In Use" message without any reasons when trying to remove a base facility...

OXCE shows a reason, see screenshot.

If BAI doesn't, please report to BAI subforum, not here.

Offline 0xEBJC

  • Colonel
  • ****
  • Posts: 180
  • Y'all are awesome! Thankful for this community.
    • View Profile
    • My Projects
Re: [DONE][Suggestion] Show reason(s) why facility cannot be dismantled
« Reply #12 on: March 30, 2024, 10:11:34 pm »
tested, yes, it's only in BAI, I'll report there... and check next time before posting here, thanks