aliens

Author Topic: [DONE][Suggestion] Consistent implementation of 'disables' and 'reenables' for research  (Read 1125 times)

Offline MIK517

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Zero cost research that auto-researched when all the required researches are completed will apply its 'disabled' references, but won't apply its 'reenables'.
Those are only working for projects that are directly completed through lab/one-free/event etc.

After checking sources (SavedGame::addFinishedResearch) I'm not sure if this logic is intentional or not, since 'reenables' were added when loop with 'disables' for zero-cost projects existed, so there may be some reason why they were added outside of that loop.
Still I think this either should be fixed (with 'reenables' also preferably going after 'disables' to allow simpler repeatable projects) or difference between two properties should be documented on Wiki's Ruleset Reference to prevent confusion.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8886
    • View Profile
Original discussion is lost.
All we have is the commit: https://github.com/MeridianOXC/OpenXcom/commit/e5e7f2f7bfab12f892dea09925a901fade1884c1

I don't have any strong opinion on this.
I can allow 'reenables' also on zero cost research.
(thread moved to Suggestions)

PS: even after the change, there will still be differences between 'disables' and 'reenables', e.g. 'disables' is only applied once (when a topic is researched first time), but 'reenables' will apply each time (when a topic is researched also for the 42nd time, let's say a 42nd interrogation of a Sectoid Commander :) )

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8886
    • View Profile
Test ruleset:

Code: [Select]
research:
  - name: STR_MEDI_KIT
    cost: 210
    points: 20
    disables: [STR_MOTION_SCANNER]

  - name: STR_LEADER_PLUS
    reenables: [STR_MOTION_SCANNER]
    requires:
      - STR_ALIEN_ORIGINS
    dependencies:
      - STR_SECTOID_COMMANDER
      - STR_SECTOID_LEADER


Offline MIK517

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Thank you.

Yeah, I hadn't thought about disables on already completed topics that give one free.
But now if that logic (reapplying 'disables' after each research) is needed it can instead be achieved by moving those disables to zero-cost topic in 'unlocks' that has (already researched) 'requires' (to get `checkRelatedZeroCostTopics`) and immediately resets itself each time. Even it that sounds like quite a dirty hack.