Author Topic: [DONE] [Suggestion] obsolete tag (ability to block/remove research paths)  (Read 12827 times)

Offline Varana

  • Captain
  • ***
  • Posts: 52
    • View Profile
Re: obsolete tag
« Reply #15 on: June 04, 2017, 12:37:38 am »
That's too late, isn't it?

I thought of it as a notifier, so nobody should wonder where his tech has gone. Or why the scientists are idle. To avoid stupid bug reports.  ;)

If a modder wants to inform the players before they start the research, the modder could do it with the normal UP info of the tech before.
For example the Laser tech info could contain a sentence, that it will be replaced by better designs once they are researched. Or the containment info could include a sentence, that it might get impossible to live in peace with a tortured alien race...
« Last Edit: June 04, 2017, 12:40:09 am by Varana »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: obsolete tag
« Reply #16 on: June 04, 2017, 01:02:26 am »
Yeah, but it won't always be possible, or elegant, and it's additional work. :P

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Ability to block research topics/paths
« Reply #17 on: June 27, 2017, 11:08:21 am »
EDIT: definitely not this weekend... there are complications... trying to find a solution, which doesn't require rewrite of research code is not easy... I almost had it, but almost is not enough... I'll keep trying

So, the research code is rewritten... it should be relatively easy now to add this feature.

Offline drages

  • Colonel
  • ****
  • Posts: 150
    • View Profile
Re: obsolete tag
« Reply #18 on: June 28, 2017, 12:35:52 am »
I can imagine using this for straight up upgrades to tech. Make laser rifles MKII that are a bit better than normal ones but take the same resources. No point of keeping old versions in manufacturing list because it's just clutter at this point. Or you could use it to outsource tech to civilian companies meaning that after selling the contract you can't build it anymore, but can buy it for same or less money.

This is a good point and I was thinking to ask same thing.

This is a problem with items with many updates. I done the MK thing, at my huge Xenonauts mod. Xenonauts got a command at research code named "replace", this replaces some item to the other item. But it's not good enough and sadly it's only works right at infinity items. With numbered items, only the items in storage replaces and the ones at soldier inventory just disappears. This became huge problems if the item is something important. And the manufacture code gets problem because the manufacture still try to manufacture the old one.

This is mostly for UI problems. You can keep the old version but this means you will have it everywhere even you would never use it. For example you got a weapon tier with 10 weapon inside it. When you want "2" more update to that weapon with all the manufacture and everything will be same but the weapon only will get some buffs, you will have 20 weapons (as MK1 and MK2) without any reason to stay in the game.

Xenonauts does not have different ammo for same weapon, which is one of the worst thing of that game. So you need to update the weapon itself for any kind of buff, you need to make a totally new weapon. So OpenXcom got ammos to help about that but it can't buff all the weapon stats like fire types.

So for that reason, a soft replace code could be usefull. With this code, when you replace the ID, it will replace it at everywhere.. from researches to manufactures.. so you will update the weapon only when you won't need the old one anymore.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Ability to block research topics/paths
« Reply #19 on: August 05, 2017, 03:29:42 pm »
So, the research code is rewritten... it should be relatively easy now to add this feature.

Code: [Select]
extraStrings:
  - type: en-US
    strings:
      STR_DISABLED_BY: "Disabled by:"
      STR_DISABLES: "Disables:"

Code: [Select]
research:
  - name: STR_NEW_TOPIC
    cost: 500
    disables:
      - STR_OLD_TOPIC1
      - STR_OLD_TOPIC2

When STR_NEW_TOPIC is researched (or more specifically when it's added to "discovered" list):
1. STR_OLD_TOPIC1 and STR_OLD_TOPIC2 are removed from "discovered" list, i.e. un-researched/revoked
2. STR_OLD_TOPIC1 and STR_OLD_TOPIC2 are removed from "currently being researched" list, in all bases
3. STR_OLD_TOPIC1 and STR_OLD_TOPIC2 are marked as "NEVER allow research of this topic again", which means:
 a/ they won't be available in the New Research GUI ever again
 b/ they won't be given to you for free via getOneFree/getOneFreeProtected
 c/ they won't be given to you for free via zero-cost unlocks
 d/ they won't be given to you for free via mission bounty
 e/ if they are getOneFree or zero-cost unlock for some other topic, they will be ignored
    - e.g. if Alien Infiltration is disabled and it's the only remaining undiscovered getOneFree for Sectoid Navigator, Sectoid Navigator will not be researchable... since you can't get Alien Infiltration anyway

Additionally keep in mind that:
4. any topics that were (previously) directly or indirectly unlocked via STR_OLD_TOPIC1 or STR_OLD_TOPIC2 remain untouched
   - we disable/revoke only those 2 topics... not everything else that depended on them somehow
5. this whole concept will be completely ignored in the "New Battle" simulator

There are two possible uses of this feature I can think of right now:

A) Ability to make things obsolete (e.g. hide all small guns when big guns are researched)

Code: [Select]
research:
  - name: STR_PLASMA_WEAPONS
    disables:
      - STR_LASER_WEAPONS       # no need for small guns when you have big guns... no matter what modders say/think :P

B) Ability to choose a path in the research tree and block other paths

Code: [Select]
research:
  - name: STR_RED_PILL
    dependencies:
      - STR_MEET_MORPHEUS
    disables:
      - STR_BLUE_PILL           # after taking the red pill, can't take the blue pill anymore
      - STR_NORMAL_FOOD         # no more steaks for you Neo... reality sucks!
    unlocks:
      - STR_SUPERPOWERS         # booyeah!
  - name: STR_BLUE_PILL
    dependencies:
      - STR_MEET_MORPHEUS
    disables:
      - STR_RED_PILL            # after taking the blue pill, can't take the red pill anymore
      - STR_LOVE                # steaks are better than Trinity anyway, no?

Disclaimer #1:
---------------
List of permanently disabled topics is saved in the save file.
That means if you (as a modder) change your decision what disables what between mod versions... the changes won't be applied retrospectively when the player upgrades the mod during a campaign.

So think twice before you start disabling things randomly!

Disclaimer #2:
---------------
The game can't check everything, you can create inconsistent situations... try to keep it simple!
For example:
a/ if topic A gives topic B for free... don't put topic B into "disables" of topic A... makes no sense, right? In this case, the game will actually give you topic B, because getOneFree topic is always processed before the core topic
b/ if topic A gives topic B for free... don't put topic A into "disables" of topic B... this makes even less sense... and in this case after researching topic A, you will get the free topic B, but you will NOT get the core topic A (because it will already be disabled after processing topic B)

So again... use... not abuse!

Offline Varana

  • Captain
  • ***
  • Posts: 52
    • View Profile
Re: obsolete tag
« Reply #20 on: August 10, 2017, 01:31:44 am »
 :-\ "steaks are better than Trinity anyway"  ;D ;D ;D

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: [DONE] [Suggestion] obsolete tag (ability to block/remove research paths)
« Reply #21 on: January 09, 2021, 02:40:06 pm »
It is now possible to re-enable already disabled research using "reenables" attribute.

Example:

Code: [Select]
research:
  - name: STR_TRUMP
    disables:
      - STR_SOMETHING
  - name: STR_BIDEN
    reenables:
      - STR_SOMETHING