Author Topic: How to unlock multiply projects using getOneFree?  (Read 2087 times)

Offline Shiroi Bara

  • Colonel
  • ****
  • Posts: 310
    • View Profile
How to unlock multiply projects using getOneFree?
« on: May 30, 2022, 02:25:39 pm »
According wiki getOneFree  unlocks "bonus" research projects that may be granted when completing this project. I want some cheating - researching live aquatoid medic  could give deep one autopsy but not unlock aqua plastics with it. Can I change list of "bonuses"  to unlock autopsy and plastic together? I'm tried item section and putting there aqua plastic depends on corpse it works, but if I add another lines with same item only first working. So I stuck here. Is it even possible? Some examples what I mean:
Case 1:
Code: [Select]
getOneFree:
      - STR_DEEP_ONE_AUTOPSY
      unlocks:
      - STR_AQUA_PLASTICS
Not working.

Case 2 with ',' separator:
Code: [Select]
getOneFree:
      - STR_DEEP_ONE_AUTOPSY, - STR_AQUA_PLASTICS
Not working.

Modifying item section:
Code: [Select]
- name: STR_AQUA_PLASTICS
    cost: 120
    points: 20
    listOrder: 327
    dependencies:
      -  STR_DEEP_ONE_AUTOPSY

- name: STR_AQUA_PLASTICS
    cost: 120
    points: 20
    listOrder: 327
    dependencies:
      - STR_XARQUID_AUTOPSY
Working only on deep one but ignores xarquid.
Any suggestions?

Offline Yankes

  • Commander
  • *****
  • Posts: 2872
    • View Profile
Re: How to unlock multiply projects using getOneFree?
« Reply #1 on: May 30, 2022, 02:53:09 pm »
First of all, do not make your own syntax in yaml, this will never work, only thing that are show on wiki will work.

Second if I understand correctly you "have cake and eat cake", this mean same research can give you somting and do not give same thing if used in different context. As engine developer I can answer that situation like this should be never permitted because will make only mess in code and make bugs and corner cases.

For your problem, one solution is simply split autopsy to two parts, one that give info about alien and another about plastics.
Like:
STR_DEEP_ONE_AUTOPSY
STR_DEEP_ONE_AUTOPSY_INFO

Medic give only STR_DEEP_ONE_AUTOPSY_INFO that do not grant plastic.
STR_DEEP_ONE_AUTOPSY give for free STR_DEEP_ONE_AUTOPSY_INFO and unlock plastic.

Offline Shiroi Bara

  • Colonel
  • ****
  • Posts: 310
    • View Profile
Re: How to unlock multiply projects using getOneFree?
« Reply #2 on: May 30, 2022, 04:45:15 pm »
Thank you for reply and apologies for my terrible English. Sorry, but your solution not what I want. I want unlock aqua plastics (message: we can now research aqua plastics) in research list together with deep one or xarquid autopsy info given for free by medic. But seems you are right - multiply unlocks produce chaos and bugs in mod code.

Offline pWWWa

  • Sergeant
  • **
  • Posts: 30
    • View Profile
Re: How to unlock multiply projects using getOneFree?
« Reply #3 on: July 14, 2022, 03:22:53 am »
Thank you for reply and apologies for my terrible English. Sorry, but your solution not what I want. I want unlock aqua plastics (message: we can now research aqua plastics) in research list together with deep one or xarquid autopsy info given for free by medic. But seems you are right - multiply unlocks produce chaos and bugs in mod code.

Dear Shiroi Bara, please, notice that any medic reseach just unlock STR_DEEP_ONE_AUTOPSY (ufopaedia topic), but STR_DEEP_ONE_CORPSE reseach unlocks STR_DEEP_ONE_AUTOPSY (ufopaedia topic) and STR_AQUA_PLASTICS (via unlock property).

Solutions:
1)  use STR_DEEP_ONE_CORPSE instead of STR_DEEP_ONE_AUTOPSY in Medic`s GetOneFree list;
2) replace STR_DEEP_ONE_CORPSE with STR_DEEP_ONE_AUTOPSY in STR_AQUA_PLASTICS research topic (dependencies section).
« Last Edit: July 19, 2022, 07:05:02 pm by pWWWa »