714
« on: December 13, 2017, 07:54:22 pm »
- name: STR_LEADER_PLUS
requires:
- STR_ALIEN_ORIGINS
dependencies:
- STR_SECTOID_COMMANDER
- STR_SECTOID_LEADER
- STR_SNAKEMAN_COMMANDER
- STR_SNAKEMAN_LEADER
- STR_ETHEREAL_COMMANDER
- STR_ETHEREAL_LEADER
- STR_FLOATER_COMMANDER
- STR_FLOATER_LEADER
- name: STR_COMMANDER_PLUS
unlocks:
- STR_CYDONIA_OR_BUST
requires:
- STR_THE_MARTIAN_SOLUTION
dependencies:
- STR_SECTOID_COMMANDER
- STR_SNAKEMAN_COMMANDER
- STR_ETHEREAL_COMMANDER
- STR_FLOATER_COMMANDER
- name: STR_SNAKEMAN_COMMANDER
cost: 192
points: 50
lookup: STR_SNAKEMAN
needItem: true
destroyItem: true
unlocks:
- STR_LEADER_PLUS
- STR_COMMANDER_PLUS
- STR_ALIEN_ORIGINS
I think I see what you're saying.
The requires: variable prevents the unlock of the research project unless prerequisite research items have already been researched.
So even though, for example, a Snakeman Commander allows the unlock of STR_ALIEN_ORIGINS, STR_LEADER_PLUS and STR_COMMANDER_PLUS it only unlocks them one at a time due to requires: and consumes the STR_SNAKEMAN_COMMANDER item each time forcing the player to acquire it again in the field before they can research the next entry in the sequence.
I'll try this immediately and post the result. ^_^
(EDIT)
I just finished coding a test mod using the above method and it is displaying some of the expected behaviors, but not all of them.
Researching STR_ITEM_A can now be done several times before it stops appearing in the research menu.
In theory this is unlocking research projects STR_RESEARCH_A then STR_RESEARCH_B followed by STR_RESEARCH_C.
However oddly STR_RESEARCH_A, STR_RESEARCH_B and STR_RESEARCH_C are not themselves appearing in the research menu after being unlocked.
Here's the code I changed in the research: variables:
research:
# Research Item A
- name: STR_TEST_A
needItem: true
destroyItem: true
unlocks:
- STR_RESEARCH_A
- STR_RESEARCH_B
- STR_RESEARCH_C
# Research Unlocks A-C
- name: STR_RESEARCH_A
dependencies:
- STR_TEST_A
- name: STR_RESEARCH_B
requires:
- STR_RESEARCH_A
- name: STR_RESEARCH_C
requires:
- STR_RESEARCH_B
I'll attach the new test mod with the updated code in it to this post as a *.zip.