Author Topic: Changing the item used by research's needItem: & destroyItem: variables?  (Read 9151 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: Changing the item used by research's needItem: & destroyItem: variables?
« Reply #15 on: December 31, 2021, 03:38:09 pm »
i'm still unsure if you understood my problem correctly. maybe i did not express myself properly. sorry, english is not my primary language.

Yes, I didn't read carefully enough. Sorry.

...
i would say that none of the soldier, leader or commander ranks from the sectoid and snakeman race should be available for research at this point.

i don't say that the game mechanics are flawed. technically, because of the fact that the research on snakeman commander itself was not completed, it is not included in the 'discovered:' list, therefore it is available as a new project.
...

Your technical explanation is correct.

A topic will appear on the list:
1. if it hasn't been researched at all yet... which is the case for your Snakeman Commander
2. or if it has been researched, but can still provide something more

...
i merely say that i would like to make my own mod that changes this behaviour to match my expectations. i'm somewhat suspicious about my find; i feel that either i'm doing something wrong or my expectations are too high. the vanilla research.rul would be complicated [beyond comprehension for people like me] if this mechanism was fixed/changed the way i expect it to work, that's why i'm trying to achieve it with a mod.

I don't think it is possible to implement your desired behavior just using the ruleset modding features.

This behavior would require changes in the OpenXcom source code.

If you want to try to make changes in the source code, this is the function that you'll need to look at: https://github.com/OpenXcom/OpenXcom/blob/master/src/Savegame/SavedGame.cpp#L1241

Offline greg77

  • Sergeant
  • **
  • Posts: 17
    • View Profile
Re: Changing the item used by research's needItem: & destroyItem: variables?
« Reply #16 on: December 31, 2021, 05:05:31 pm »
i think the best option would be to include the lists 'disables:' and 'reenables:' already developed in oxce.
another possibility is to modify the mechanism to allow 'getOneFree:' to work on zero-cost topics, and on topics granted by 'lookup:' and 'getOneFree:' itself.
changing the source code does not seem to be straightforward enough for me. as a programmer, i'm somewhat aware of my limitations and i can't even specify the solution in pseudo-code.
just for the record, my suggestion was:

make any live alien project unavailable for research as soon as all dependent projects are unlocked, in particular race+rank combos.
example: completion of sectoid non-commander + non-sectoid commander should make sectoid commander unavailable.

again thank you for looking into this phenomenon.
i wish you and everyone a happy new year.
« Last Edit: December 31, 2021, 07:50:07 pm by greg77 »