OpenXcom Forum

Modding => Work In Progress => Topic started by: Hedron on April 24, 2016, 03:54:24 pm

Title: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 24, 2016, 03:54:24 pm
I has encountered a problem when I tried to change Research Tree like that:
(https://openxcom.org/forum/index.php?action=dlattach;topic=4572.0;attach=21662;image)

If I try do like this:
Code: [Select]
  - name: STR_AQUATOID_SOLDIER
    cost: 192
    points: 50
    lookup: STR_AQUATOID
    needItem: true
    unlocks:
      - STR_ALIEN_ORIGINS
    dependencies:
      - STR_AQUATOID_CORPSE
      - STR_MC_READER
  - name: STR_AQUATOID_MEDIC
    cost: 192
    points: 50
    needItem: true
    getOneFree:
      - STR_CALCINITE
      - STR_HALLUCINOID
      - STR_DEEP_ONE
      - STR_XARQUID
      - STR_TENTACULAT
      - STR_BIODRONE
      - STR_TRISCENE
    dependencies:
      - STR_AQUATOID_SOLDIER
– Aquatoid Medic appears in Research List when he appears in the Alien Containment (parameter "dependencies" is ignored).

When I try use "requires":
Code: [Select]
  - name: STR_AQUATOID_SOLDIER_DEP
    cost: 0
    dependencies:
      - STR_AQUATOID_CORPSE
      - STR_MC_READER
  - name: STR_AQUATOID_SOLDIER
    cost: 192
    points: 50
    lookup: STR_AQUATOID
    needItem: true
    unlocks:
      - STR_ALIEN_ORIGINS
      - STR_AQUATOID_SQUAD_LEADER
      - STR_AQUATOID_MEDIC
      - STR_AQUATOID_TECHNICIAN
      - STR_AQUATOID_NAVIGATOR
    dependencies:
      - STR_AQUATOID_CORPSE
      - STR_MC_READER
  - name: STR_AQUATOID_MEDIC
    cost: 192
    points: 50
    needItem: true
    getOneFree:
      - STR_CALCINITE
      - STR_HALLUCINOID
      - STR_DEEP_ONE
      - STR_XARQUID
      - STR_TENTACULAT
      - STR_BIODRONE
      - STR_TRISCENE
    dependencies:
      - STR_AQUATOID_SOLDIER
    requires:
      - STR_AQUATOID_SOLDIER_DEP
– Aquatoid Medic do not appears in Research List when researching Aquatoid Soldier was completed.

How can I solve this problem?
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hobbes on April 25, 2016, 05:48:37 pm
You either use 'requires' or 'dependencies' - the difference between both is subtle (requires is more restrictive - check the wiki for more details) but they are designed to be used separately.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 25, 2016, 06:44:36 pm
You either use 'requires' or 'dependencies' - the difference between both is subtle (requires is more restrictive - check the wiki for more details) but they are designed to be used separately.
'Requires' NEVER USED WITHOUT 'dependencies' – you may see it itself in research.rul.

In any case, I tried use 'requires' without 'dependencies':
Code: [Select]
  - name: STR_AQUATOID_SOLDIER
    cost: 192
    points: 50
    lookup: STR_AQUATOID
    needItem: true
    unlocks:
      - STR_ALIEN_ORIGINS
      - STR_AQUATOID_SQUAD_LEADER
      - STR_AQUATOID_MEDIC
      - STR_AQUATOID_TECHNICIAN
      - STR_AQUATOID_NAVIGATOR
    dependencies:
      - STR_AQUATOID_CORPSE
      - STR_MC_READER
  - name: STR_AQUATOID_MEDIC
    cost: 192
    points: 50
    needItem: true
    getOneFree:
      - STR_CALCINITE
      - STR_HALLUCINOID
      - STR_DEEP_ONE
      - STR_XARQUID
      - STR_TENTACULAT
      - STR_BIODRONE
      - STR_TRISCENE
    requires:
      - STR_AQUATOID_SOLDIER
– Aquatoid Medic DOES NOT APPEAR in the research-list after the research Aquatoid Soldier.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hobbes on April 25, 2016, 07:13:03 pm
'Requires' NEVER USED WITHOUT 'dependencies' – you may see it itself in research.rul.

Thanks for the correction, in any case as you might see 'requires' is only used for the storyline research topics in both xcom1 and xcom2 and I would discourage using it since you can get the same effect with 'dependencies' without using 'requires', which is more complicated to use.

Quote
In any case, I tried use 'requires' without 'dependencies':
Code: [Select]
  - name: STR_AQUATOID_SOLDIER
    cost: 192
    points: 50
    lookup: STR_AQUATOID
    needItem: true
    unlocks:
      - STR_ALIEN_ORIGINS
      - STR_AQUATOID_SQUAD_LEADER
      - STR_AQUATOID_MEDIC
      - STR_AQUATOID_TECHNICIAN
      - STR_AQUATOID_NAVIGATOR
    dependencies:
      - STR_AQUATOID_CORPSE
      - STR_MC_READER
  - name: STR_AQUATOID_MEDIC
    cost: 192
    points: 50
    needItem: true
    getOneFree:
      - STR_CALCINITE
      - STR_HALLUCINOID
      - STR_DEEP_ONE
      - STR_XARQUID
      - STR_TENTACULAT
      - STR_BIODRONE
      - STR_TRISCENE
    requires:
      - STR_AQUATOID_SOLDIER
– Aquatoid Medic DOES NOT APPEAR in the research-list after the research Aquatoid Soldier.

Replace 'requires' with 'dependencies'. And you'll need to have a Aquatoid Medic on Alien Containment (since needItem: true) after you research Aquatoid Soldier
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 26, 2016, 02:01:02 am
I would discourage using it since you can get the same effect with 'dependencies' without using 'requires', which is more complicated to use.
Replace 'requires' with 'dependencies'. And you'll need to have a Aquatoid Medic on Alien Containment (since needItem: true) after you research Aquatoid Soldier
The fact of the problem is that when using 'GetOneFree' with 'Dependencies' – parameter 'Dependencies' IS IGNORED! (IMHO it should not be, but so it is)
So, in this case, it will be possible to research Aquatoid Medic without researching Aquatoid Soldier.

Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: hellrazor on April 27, 2016, 12:38:21 am
Correct usage of "dependencies" and "requires":

Code: [Select]
#BEGIN WIN THE GAME
#listOrder: 10-29
  - name: STR_THE_ALIEN_THREAT
    cost: 200
    points: 20
    listOrder: 10
  - name: STR_ALIEN_INVASION
    cost: 500
    points: 40
    dependencies:
      - STR_THE_ALIEN_THREAT
      - STR_ALIEN_DATA_SLATE
      - STR_ALIEN_INVASION_UNLOCK
    listOrder: 11
  - name: STR_ALIEN_INVASION_UNLOCK
    requires:
      - STR_THE_ALIEN_THREAT
    dependencies: &ALL_ALIVE_ALIENS
      - STR_FLOATER_SOLDIER
      - STR_FLOATER_NAVIGATOR
      - STR_FLOATER_MEDIC
      - STR_FLOATER_ENGINEER
      - STR_FLOATER_LEADER
      - STR_FLOATER_COMMANDER
      - STR_SECTOID_SOLDIER
      - STR_SECTOID_NAVIGATOR
      - STR_SECTOID_MEDIC
      - STR_SECTOID_ENGINEER
      - STR_SECTOID_LEADER
      - STR_SECTOID_COMMANDER
      - STR_SNAKEMAN_SOLDIER
      - STR_SNAKEMAN_NAVIGATOR
      - STR_SNAKEMAN_ENGINEER
      - STR_SNAKEMAN_LEADER
      - STR_SNAKEMAN_COMMANDER
      - STR_MUTON_SOLDIER
      - STR_MUTON_NAVIGATOR
      - STR_MUTON_ENGINEER
      - STR_WASPITE_SOLDIER
      - STR_WASPITE_NAVIGATOR
      - STR_WASPITE_MEDIC
      - STR_WASPITE_ENGINEER
      - STR_WASPITE_LEADER
      - STR_WASPITE_COMMANDER
      - STR_GAZER_SOLDIER
      - STR_GAZER_NAVIGATOR
      - STR_GAZER_MEDIC
      - STR_GAZER_ENGINEER
      - STR_GAZER_LEADER
      - STR_GAZER_COMMANDER
      - STR_SECTOID_ELITE_SOLDIER
      - STR_SECTOID_ELITE_NAVIGATOR
      - STR_SECTOID_ELITE_MEDIC
      - STR_SECTOID_ELITE_ENGINEER
      - STR_SECTOID_ELITE_LEADER
      - STR_SECTOID_ELITE_COMMANDER
      - STR_MUTON_ELITE_SOLDIER
      - STR_MUTON_ELITE_NAVIGATOR
      - STR_MUTON_ELITE_ENGINEER
      - STR_MUTON_ELITE_LEADER
      - STR_ETHEREAL_SOLDIER
      - STR_ETHEREAL_LEADER
      - STR_ETHEREAL_COMMANDER
      - STR_MUTON_ELITE_GUARD_SOLDIER
      - STR_MUTON_ELITE_GUARD_ENGINEER
      - STR_MUTON_ELITE_GUARD_LEADER
      - STR_SILACOID_TERRORIST
      - STR_REAPER_TERRORIST
      - STR_CYBERDISC_TERRORIST
      - STR_CHRYSSALID_TERRORIST
      - STR_SECTOPOD_TERRORIST
      - STR_CELATID_TERRORIST
      - STR_MUTON_BERSERKER_TERRORIST
      - STR_CYBERMITE_TERRORIST
      - STR_HOLODRONE_TERRORIST
      - STR_ARMORED_CYBERDISC
      - STR_ARMORED_SECTOPOD
      - STR_CHRYSSALID_SPITTER_TERRORIST
    listOrder: 12
  - delete: STR_ALIEN_ORIGINS
  - name: STR_ALIEN_ORIGINS
    cost: 1000
    points: 60
    dependencies:
      - STR_LEADER_PLUS
    listOrder: 13
  - delete: STR_LEADER_PLUS
  - name: STR_LEADER_PLUS
    requires:
      - STR_ALIEN_INVASION
    dependencies:
      - STR_FLOATER_LEADER
      - STR_FLOATER_COMMANDER
      - STR_SECTOID_LEADER
      - STR_SECTOID_COMMANDER
      - STR_SNAKEMAN_LEADER
      - STR_SNAKEMAN_COMMANDER
      - STR_WASPITE_LEADER
      - STR_WASPITE_COMMANDER
      - STR_GAZER_LEADER
      - STR_GAZER_COMMANDER
      - STR_SECTOID_ELITE_LEADER
      - STR_SECTOID_ELITE_COMMANDER
      - STR_MUTON_ELITE_LEADER
      - STR_ETHEREAL_LEADER
      - STR_ETHEREAL_COMMANDER
      - STR_MUTON_ELITE_GUARD_LEADER
    listOrder: 14
  - name: STR_THE_MARTIAN_SOLUTION
    cost: 2000
    points: 60
    dependencies:
      - STR_COMMANDER_PLUS
    listOrder: 15
  - name: STR_COMMANDER_PLUS
    unlocks:
      - STR_THE_MARTIAN_SOLUTION
    requires:
      - STR_ALIEN_ORIGINS
    dependencies:
      - STR_FLOATER_COMMANDER
      - STR_SECTOID_COMMANDER
      - STR_SNAKEMAN_COMMANDER
      - STR_WASPITE_COMMANDER
      - STR_GAZER_COMMANDER
      - STR_SECTOID_ELITE_COMMANDER
      - STR_ETHEREAL_COMMANDER
    listOrder: 16
  - delete: STR_CYDONIA_OR_BUST
  - name: STR_CYDONIA_OR_BUST
    cost: 3000
    points: 100
    unlockFinalMission: true
    dependencies:
      - STR_CYDONIA_PLUS
    listOrder: 17
  - name: STR_CYDONIA_PLUS
    unlocks:
      - STR_CYDONIA_OR_BUST
    requires:
      - STR_THE_MARTIAN_SOLUTION
    dependencies:
      - STR_ETHEREAL_COMMANDER
    listOrder: 18
#END WIN THE GAME

Correct usage of "dependencies", "requires", "unlock" and "getOneFree"

Code: [Select]
#BEGIN FLOATERS
#listOrder: 800-899
  - delete: STR_FLOATER_SOLDIER
  - delete: STR_FLOATER_MEDIC
  - delete: STR_FLOATER_ENGINEER
  - delete: STR_FLOATER_NAVIGATOR
  - delete: STR_FLOATER_LEADER
  - delete: STR_FLOATER_COMMANDER
  - name: STR_FLOATER
    listOrder: 800
  - name: STR_FLOATER_SOLDIER
    cost: 288
    points: 50
    needItem: true
    listOrder: 801
    lookup: STR_FLOATER
    unlocks:
      - STR_ALIEN_LANGUAGE_UNLOCK
      - STR_ALIEN_INVASION_UNLOCK
  - name: STR_FLOATER_MEDIC
    cost: 288
    points: 50
    needItem: true
    listOrder: 802
    lookup: STR_FLOATER
    unlocks: &MEDIC_UNLOCKS
      - STR_ALIEN_LANGUAGE_UNLOCK
      - STR_ALIEN_INVASION_UNLOCK
      - STR_EXAMINATION_ROOM_UNLOCK
      - STR_ALIEN_SURGERY_UNLOCK
      - STR_ALIEN_ENTERTAINMENT_UNLOCK
      - STR_PSI_AMP_UNLOCK
      - STR_PSI_LAB_UNLOCK_2
      - STR_ULTIMATE_CRAFT_UNLOCK_3
    getOneFree: &MEDIC_GETONEFREE
      - STR_FLOATER
      - STR_FLOATER_CORPSE
      - STR_SECTOID
      - STR_SECTOID_CORPSE
      - STR_SNAKEMAN
      - STR_SNAKEMAN_CORPSE
      - STR_MUTON
      - STR_MUTON_CORPSE
      - STR_WASPITE
      - STR_WASPITE_CORPSE
      - STR_GAZER
      - STR_GAZER_CORPSE
      - STR_SECTOID_ELITE
      - STR_SECTOID_ELITE_CORPSE
      - STR_MUTON_ELITE
      - STR_MUTON_ELITE_CORPSE
      - STR_ETHEREAL
      - STR_ETHEREAL_CORPSE
      - STR_MUTON_ELITE_GUARD
      - STR_MUTON_ELITE_GUARD_CORPSE
      - STR_SILACOID
      - STR_SILACOID_CORPSE
      - STR_REAPER
      - STR_REAPER_CORPSE
      - STR_CYBERDISC
      - STR_CYBERDISC_CORPSE
      - STR_CHRYSSALID
      - STR_CHRYSSALID_CORPSE
      - STR_SECTOPOD
      - STR_SECTOPOD_CORPSE
      - STR_CELATID
      - STR_CELATID_CORPSE
      - STR_MUTON_BERSERKER
      - STR_MUTON_BERSERKER_CORPSE
      - STR_CYBERMITE
      - STR_CYBERMITE_CORPSE
      - STR_HOLODRONE
      - STR_HOLODRONE_CORPSE
      - STR_ARMORED_CYBERDISC
      - STR_ARMORED_SECTOPOD_CORPSE
      - STR_ARMORED_SECTOPOD
      - STR_ARMORED_CYBERDISC_CORPSE
      - STR_CHRYSSALID_SPITTER
      - STR_CHRYSSALID_SPITTER_CORPSE
  - name: STR_FLOATER_ENGINEER
    cost: 288
    points: 50
    needItem: true
    listOrder: 803
    lookup: STR_FLOATER
    unlocks: &ENGINEER_UNLOCKS
      - STR_ALIEN_LANGUAGE_UNLOCK
      - STR_ALIEN_INVASION_UNLOCK
      - STR_PLASMA_PISTOL_UNLOCK
      - STR_PLASMA_RIFLE_UNLOCK
      - STR_HEAVY_PLASMA_UNLOCK
      - STR_SMALL_LAUNCHER_UNLOCK
      - STR_BLASTER_LAUNCHER_UNLOCK
      - STR_UFO_POWER_SOURCE_UNLOCK
      - STR_UFO_CONSTRUCTION_UNLOCK
      - STR_POWER_SUIT_UNLOCK
      - STR_REINFORCED_POWER_SUIT_UNLOCK
      - STR_PSI_LAB_UNLOCK_1
      - STR_NEW_FIGHTER_TRANSPORTER_UNLOCK_1
      - STR_NEW_FIGHTER_CRAFT_UNLOCK_1
      - STR_ULTIMATE_CRAFT_UNLOCK_1
    getOneFree: &ENGINEER_GETONFREE
      - STR_SMALL_SCOUT
      - STR_MEDIUM_SCOUT
      - STR_LARGE_SCOUT
      - STR_HARVESTER
      - STR_ABDUCTOR
      - STR_TERROR_SHIP
      - STR_BATTLESHIP
      - STR_SUPPLY_SHIP
      - STR_FIGHTER_SHIP
      - STR_SENTRY_SHIP
      - STR_LAB_SHIP
      - STR_EXCAVATOR
  - name: STR_FLOATER_NAVIGATOR
    cost: 288
    points: 50
    needItem: true
    listOrder: 804
    lookup: STR_FLOATER
    unlocks: &NAVIGATOR_UNLOCKS
      - STR_ALIEN_LANGUAGE_UNLOCK
      - STR_ALIEN_INVASION_UNLOCK   
      - STR_UFO_NAVIGATION_UNLOCK
      - STR_HYPER_WAVE_DECODER_UNLOCK
      - STR_FLYING_SUIT_UNLOCK
      - STR_NEW_FIGHTER_CRAFT_UNLOCK_2
      - STR_NEW_FIGHTER_TRANSPORTER_UNLOCK_2
      - STR_ULTIMATE_CRAFT_UNLOCK_2
      - STR_REINFORCED_FLYING_SUIT_UNLOCK
    getOneFree: &NAVIGATOR_GETONEFREE
      - STR_ALIEN_RESEARCH
      - STR_ALIEN_HARVEST
      - STR_ALIEN_ABDUCTION
      - STR_ALIEN_INFILTRATION
      - STR_ALIEN_BASE
      - STR_ALIEN_TERROR
      - STR_ALIEN_RETALIATION
      - STR_ALIEN_SUPPLY
  - name: STR_FLOATER_LEADER
    cost: 288
    points: 50
    needItem: true
    listOrder: 805
    lookup: STR_FLOATER
    unlocks:
      - STR_ALIEN_LANGUAGE_UNLOCK
      - STR_ALIEN_INVASION_UNLOCK
      - STR_LEADER_PLUS
  - name: STR_FLOATER_COMMANDER
    cost: 288
    points: 50
    needItem: true
    listOrder: 806
    lookup: STR_FLOATER
    unlocks:
      - STR_ALIEN_LANGUAGE_UNLOCK
      - STR_ALIEN_INVASION_UNLOCK
      - STR_LEADER_PLUS
      - STR_COMMANDER_PLUS
#END FLOATERS
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 27, 2016, 01:55:40 am
Correct usage of "dependencies" and "requires":
Listing-1

Correct usage of "dependencies", "requires", "unlock" and "getOneFree"
Listing-2

In your listings I have never found "dependencies" (or "requires") together with "getOneFree".
If I understand correctly, in this listings, Floaters of all ranks can be researched as soon as they appear in Alien Containment. This is not my case (https://openxcom.org/forum/index.php?action=dlattach;topic=4572.0;attach=21662;image).
If I'm wrong – I would be very happy if you describe in more detail how this works.
For exapmple: Which means &MEDIC_GETONEFREE in
Code: [Select]
   getOneFree: &MEDIC_GETONEFREE?
In Ruleset_Reference (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)) nothing is written about &any_reference. And in your listings I have not found where cited referenses with &.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hobbes on April 27, 2016, 03:00:54 am
Code: [Select]
  - delete: STR_FLOATER_SOLDIER
  - delete: STR_FLOATER_MEDIC
  - delete: STR_FLOATER_ENGINEER
  - delete: STR_FLOATER_NAVIGATOR
  - delete: STR_FLOATER_LEADER
  - delete: STR_FLOATER_COMMANDER

This is critical to do before changing any existing research entries, otherwise you might still be using some of the old settings
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: hellrazor on April 27, 2016, 07:31:39 am
In your listings I have never found "dependencies" (or "requires") together with "getOneFree".
They are not used in one and the same topic, but functionalwise both listings are linked, especially if you look at the Leader/Commander Rank and what researches they can unlock.

If I understand correctly, in this listings, Floaters of all ranks can be researched as soon as they appear in Alien Containment. This is not my case (https://openxcom.org/forum/index.php?action=dlattach;topic=4572.0;attach=21662;image).
If I'm wrong – I would be very happy if you describe in more detail how this works.
For exapmple: Which means &MEDIC_GETONEFREE in
Code: [Select]
   getOneFree: &MEDIC_GETONEFREE?
In Ruleset_Reference (https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)) nothing is written about &any_reference. And in your listings I have not found where cited referenses with &.
Yes indeed, those alien become immediatly avaible, once captured and in alien containment.
Those are YAML anchors for defining a list of values to be used elsewere. Nothing you need to worry about.
Here a example of using those $any_reference (also called YAML anchors)
Code: [Select]
#BEGIN SECTOID
#listOrder: 900-999
  - delete: STR_SECTOID_SOLDIER
  - delete: STR_SECTOID_MEDIC
  - delete: STR_SECTOID_ENGINEER
  - delete: STR_SECTOID_NAVIGATOR
  - delete: STR_SECTOID_LEADER
  - delete: STR_SECTOID_COMMANDER
  - name: STR_SECTOID
    listOrder: 900
  - name: STR_SECTOID_SOLDIER
    cost: 288
    points: 50
    needItem: true
    listOrder: 901
    lookup: STR_SECTOID
    unlocks:
      - STR_ALIEN_INVASION_UNLOCK
      - STR_ALIEN_LANGUAGE_UNLOCK
  - name: STR_SECTOID_MEDIC
    cost: 288
    points: 50
    needItem: true
    listOrder: 902
    lookup: STR_SECTOID
    unlocks: *MEDIC_UNLOCKS
    getOneFree: *MEDIC_GETONEFREE
  - name: STR_SECTOID_ENGINEER
    cost: 288
    points: 50
    needItem: true
    listOrder: 903
    lookup: STR_SECTOID
    unlocks: *ENGINEER_UNLOCKS
    getOneFree: *ENGINEER_GETONFREE
  - name: STR_SECTOID_NAVIGATOR
    cost: 288
    points: 50
    needItem: true
    listOrder: 904
    lookup: STR_SECTOID
    unlocks: *NAVIGATOR_UNLOCKS
    getOneFree: *NAVIGATOR_GETONEFREE
  - name: STR_SECTOID_LEADER
    cost: 288
    points: 50
    needItem: true
    listOrder: 905
    lookup: STR_SECTOID
    unlocks:
      - STR_ALIEN_LANGUAGE_UNLOCK
      - STR_ALIEN_INVASION_UNLOCK
      - STR_LEADER_PLUS
      - STR_PSIONICS_UNLOCK
  - name: STR_SECTOID_COMMANDER
    cost: 288
    points: 50
    needItem: true
    listOrder: 906
    lookup: STR_SECTOID
    unlocks:
      - STR_ALIEN_LANGUAGE_UNLOCK
      - STR_ALIEN_INVASION_UNLOCK
      - STR_LEADER_PLUS
      - STR_COMMANDER_PLUS
      - STR_PSIONICS_UNLOCK
#END SECTOID

Let me be brief:
"dependency": a Research Topic becomes avaible, once all its dependencies are unlocked (either throu researching them or via a unlock (from getOneFree also)
"requires": a Research Topic becomes avaible for research or unlocking once a list of other Researchtopics has been unlocked and all depencies fullfilled, dependencies will only fullfill if the appropriate requires is met before.
"unlock": a Researchtopic automatically unlocks another Researchtopics on its completion (if the requires for the research topic to be unlocked are met),
"getOneFree": allows to create a list of research topics, at completion of the current topic holding the list, one from the list will be selected and unlocked. Also implies that this research topic is avaible as long as there are element of the genOneFree List still avaible for unlocking.

EDIT: I am not sure, but i think alive alien will show up for research even if they have dependencies or require set. Never tested it thou.
EDIT2: Your Medic has "    needItem: true" set which means you need a alive one to research it.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: hellrazor on April 27, 2016, 07:46:56 am
'Requires' NEVER USED WITHOUT 'dependencies' – you may see it itself in research.rul.

In any case, I tried use 'requires' without 'dependencies':
Code: [Select]
  - name: STR_AQUATOID_SOLDIER
    cost: 192
    points: 50
    lookup: STR_AQUATOID
    needItem: true
    unlocks:
      - STR_ALIEN_ORIGINS
      - STR_AQUATOID_SQUAD_LEADER
      - STR_AQUATOID_MEDIC
      - STR_AQUATOID_TECHNICIAN
      - STR_AQUATOID_NAVIGATOR
    dependencies:
      - STR_AQUATOID_CORPSE
      - STR_MC_READER
  - name: STR_AQUATOID_MEDIC
    cost: 192
    points: 50
    needItem: true
    getOneFree:
      - STR_CALCINITE
      - STR_HALLUCINOID
      - STR_DEEP_ONE
      - STR_XARQUID
      - STR_TENTACULAT
      - STR_BIODRONE
      - STR_TRISCENE
    requires:
      - STR_AQUATOID_SOLDIER
– Aquatoid Medic DOES NOT APPEAR in the research-list after the research Aquatoid Soldier.
Maybe add:
Code: [Select]
    dependency:
      - STR_AQUATOID_SOLDIER
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 27, 2016, 03:56:49 pm
They are not used in one and the same topic, but functionalwise both listings are linked, especially if you look at the Leader/Commander Rank and what researches they can unlock.
Those "researches they can unlock" do not use 'GetOneFree'.

Quote
Yes indeed, those alien become immediatly avaible, once captured and in alien containment.
Here's the problem.
I need, on the one hand, the research depended on other researches and on the other – used 'GetOneFree'.

Quote
Those are YAML anchors for defining a list of values to be used elsewere. Nothing you need to worry about.
Here a example of using those $any_reference (also called YAML anchors)
Many thanks. Maybe even take advantage of this.

Quote
Let me be brief: ...
That's all – in theory. In practice:
• "getOneFree" negate the effect of "dependency" ("dependency" don't working with "getOneFree") – This is the main problem!
• "requires" triggered ONLY in 0-cost researches
(so I can't use this option) and it negate the effect of "getOneFree" ("getOneFree" don't working with "requires").

So:
Quote
EDIT: I am not sure, but i think alive alien will show up for research even if they have dependencies or require set. Never tested it thou.
Of course, but only those aliens, who have "getOneFree" in their research-topics (Medic, Engeneer/Technician, Squad Leader etc.). Soldiers and terrorists will not appear in the list immediately (after appearance in Alien Containment), if they add "dependencies".
If they add "requires" directly – they will NEVER show up for research (because they are not 0-cost recearch). Those can be done only through the support 0-cost recearch-topic.

Quote
EDIT2: Your Medic has "    needItem: true" set which means you need a alive one to research it.
:) The best way to repair technique is just to turn it "on"  ;D
Of course I have Aquatoid Medics in Alien Containment.

Maybe add:
Code: [Select]
    dependency:
      - STR_AQUATOID_SOLDIER
As far as I could understand – it's all about that "requires" triggered only in 0-cost researches.
So I could not use "requires" with "GetOneFree".

But by itself, this design is quite work:
Code: [Select]
  - name: STR_GAUSS_TECH
    cost: 0
    points: 0
    dependencies:
      - STR_MEDI_KIT
    requires:
      - STR_MEDI_KIT
Gauss Pistol (depended on Gauss Technology) becomes available for research after researching Medi-kit.

Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 27, 2016, 04:03:42 pm
This is critical to do before changing any existing research entries, otherwise you might still be using some of the old settings
Сurrently I don't do it like a mod.
Сurrently I'm directly editing openxcom\standard\xcom2\research.rul. So I have no "old settings".
And I don't use other mods affecting Research Tree.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hobbes on April 27, 2016, 04:12:47 pm
Сurrently I don't do it like a mod.
Сurrently I'm directly editing openxcom\standard\xcom2\research.rul. So I have no "old settings".
And I don't use other mods affecting Research Tree.

Which can lead to issues but as long as you know what you're doing...
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 27, 2016, 04:40:04 pm
Which can lead to issues...
What problems this can lead?
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Solarius Scorch on April 27, 2016, 05:21:27 pm
So:Of course, but only those aliens, who have "getOneFree" in their research-topics (Medic, Engeneer/Technician, Squad Leader etc.).

Not only aliens; any research that has getOneFree is always available from the start, as long as you have the item (if needed).
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hobbes on April 27, 2016, 09:20:30 pm
What problems this can lead?

Other mods that you might use, for instance: they might depend on the vanilla settings for research in order to properly work. Or the developers might release a new nightly with ruleset changes and then you'll need to edit the new ruleset. Or you might change something that will cause the ruleset to crash upon loading, and then you won't be able to start xcom2 at all unless you figure out what the error was.

Your method works for small ruleset edits but it's usually better just to create a separate mod the more you're developing it
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: hellrazor on April 27, 2016, 09:25:58 pm
Other mods that you might use, for instance: they might depend on the vanilla settings for research in order to properly work. Or the developers might release a new nightly with ruleset changes and then you'll need to edit the new ruleset. Or you might change something that will cause the ruleset to crash upon loading, and then you won't be able to start xcom2 at all unless you figure out what the error was.

Your method works for small ruleset edits but it's usually better just to create a separate mod the more you're developing it

Jeah in essence it is better to leave the xcom1 / xcom2 ruleset untouched. You can simply copy over the files you wanna modify into a new directory which you create in your "mods" user directory and edit stuff there.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Solarius Scorch on April 27, 2016, 10:53:04 pm
Not to mention you'll have to do the same every time there's a ruleset update.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 27, 2016, 11:31:32 pm
Other mods that you might use, for instance: they might depend on the vanilla settings for research in order to properly work. Or the developers might release a new nightly with ruleset changes and then you'll need to edit the new ruleset. Or you might change something that will cause the ruleset to crash upon loading, and then you won't be able to start xcom2 at all unless you figure out what the error was.
Your method works for small ruleset edits but it's usually better just to create a separate mod the more you're developing it
With my approach it is much easier to localize errors that occur. No need to guess what is causing the error, this mod or discrepancy of this mod with the master rulesets (like those "old settings").
And when all will work correctly – then it will be possible to do it as a mod.

Jeah in essence it is better to leave the xcom1 / xcom2 ruleset untouched. You can simply copy over the files you wanna modify into a new directory which you create in your "mods" user directory and edit stuff there.
And you can just create a backup and do whatever you want ;)

So don't worry about it.
As he sang once in one of our cartoon cat Leopold: "the Trouble that we will survive (https://www.youtube.com/watch?v=-wvr0XmVxgA&feature=youtu.be&t=11s)"  :D
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: hellrazor on April 28, 2016, 09:30:17 pm
With my approach it is much easier to localize errors that occur. No need to guess what is causing the error, this mod or discrepancy of this mod with the master rulesets (like those "old settings").

Once you start working on a bigger Modpack or a total conversion mod, it is really helpful to built stuff as small modular mods, especially newly added content for sake of finding and eliminating errors.
I myself do this everytime once i implement new stuff into my mod, it makes debugging much much easier.

And when all will work correctly – then it will be possible to do it as a mod.
And you can just create a backup and do whatever you want ;)

So don't worry about it.
As he sang once in one of our cartoon cat Leopold: "the Trouble that we will survive (https://www.youtube.com/watch?v=-wvr0XmVxgA&feature=youtu.be&t=11s)"  :D

Editing the standard master mods rulesets like xcom1 xcom2 is in general a bad idea, as i told you before. Upgrades will most likely reset your changes and working directly in it also has some disadvantages since the files are mostly uncommented and in a specific order (->itemListorder).

It's better to approach stuff with small Mods merge them together so you have in the end what you want or need.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 28, 2016, 11:37:57 pm
I'm not going to argue about the methods of creating mods.
I'm aware of all of the difficulties expressed by you, but I'll deal with them myself.

We digress from the main question:
How can I implement this block of Research-tree:

(https://openxcom.org/forum/index.php?action=dlattach;topic=4572.0;attach=21662;image)

knowing about this troubles:
• "dependency" don't working with "getOneFree"
• "requires" triggered ONLY in 0-cost researches
• "getOneFree" don't working with "requires"
?

Is there still any ideas?

Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Kjotleik on April 29, 2016, 02:19:11 am
We digress from the main question:
How can I implement this block of Research-tree:

knowing about this troubles:
• "dependency" don't working with "getOneFree"
• "requires" triggered ONLY in 0-cost researches
• "getOneFree" don't working with "requires"
?

Is there still any ideas?



What happens if you insert a dummy-tech between the Soldier and the Medic?
Something like... (ignore the formating-issues, please)
Code: [Select]
- name: STR_DUMMY_MEDIC
  unlocks:
    - STR_AQUATOID_MEDIC
  requires:
    - STR_AQUATOID_SOLDIER

- name: STR_AQUATOID_MEDIC
  needItem: true
  getOneFree:
    - STR_.......(fill in the list)
  dependencies:
    - STR_DUMMY_MEDIC

Would this have the desired effect of the Medic showing up only after researching the Soldier?
(I'm not a programmer, but this sounds logical to me, at least)

EDIT: And, of course, have no other techs unlocking the Medic!


Sincerely
Kjotleik
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 29, 2016, 02:42:53 am
What happens if you insert a dummy-tech between the Soldier and the Medic?
Something like... (ignore the formating-issues, please)
Code: [Select]
- name: STR_DUMMY_MEDIC
  unlocks:
    - STR_AQUATOID_MEDIC
  requires:
    - STR_AQUATOID_SOLDIER

- name: STR_AQUATOID_MEDIC
  needItem: true
  getOneFree:
    - STR_.......(fill in the list)
  dependencies:
    - STR_DUMMY_MEDIC
Would this have the desired effect of the Medic showing up only after researching the Soldier?
No. If parameter "getOneFree" present in STR_AQUATOID_MEDIC then parameter "dependencies" will be ignored.
So Aquatoid Medic will be available for researching immediately after his arrival in Alien Containment, even if Aquatoid Soldier (and, of course, STR_DUMMY_MEDIC ) is not researched.
IMHO it's wrong, but it works that way.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Kjotleik on April 29, 2016, 02:56:45 am
No. If parameter "getOneFree" present in STR_AQUATOID_MEDIC then parameter "dependencies" will be ignored.
So Aquatoid Medic will be available for researching immediately after his arrival in Alien Containment (even if Aquatoid Soldier is not researched).
IMHO it's wrong, but it works that way.

Hmm...  ???

So, what is needed is a dummy-tech AFTER the Medic (Medic has no getOneFree) like...

Code: [Select]
- name: STR_AQUATOID_MEDIC
  needItem: true
  unlocks: STR_DUMMY_GETONEFREE
  requires: STR_AQUATOID_SOLDIER

- name: STR_DUMMY_GETONEFREE
  cost: 0
  getOneFree:
    - STR_....(fill in the list)


The Medic should now require the Soldier, and the unlocked dummy-tech should give you one for free...?
(It has to work...somehow... right?)


Sincerely
Kjotleik
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 29, 2016, 03:25:21 am
So, what is needed is a dummy-tech AFTER the Medic (Medic has no getOneFree) like...
Code: [Select]
- name: STR_AQUATOID_MEDIC
  needItem: true
  unlocks: STR_DUMMY_GETONEFREE
  requires: STR_AQUATOID_SOLDIER

- name: STR_DUMMY_GETONEFREE
  cost: 0
  getOneFree:
    - STR_....(fill in the list)
The Medic should now require the Soldier, and the unlocked dummy-tech should give you one for free...?
(It has to work...somehow... right?)
In this case STR_DUMMY_GETONEFREE will be available for researching right at the beginning of the game.
If add "requires" to STR_DUMMY_GETONEFREE then stops working parameter "getOneFree" :(
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Kjotleik on April 29, 2016, 03:54:01 am
In this case STR_DUMMY_GETONEFREE will be available for researching right at the beginning of the game.
If add "requires" to STR_DUMMY_GETONEFREE then stops working parameter "getOneFree" :(


Hm. So, basically, the parameter "getOneFree" is hard-coded to ignore "dependencies" and "requires."

That's kind of weird.   :(

Unfortunately, I'm busy all weekend. I'll check back to see if someone else has found the answer in about two weeks. If not, I might try to experiment a little myself...


Sincerely
Kjotleik
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 29, 2016, 01:21:32 pm
Hm. So, basically, the parameter "getOneFree" is hard-coded to ignore "dependencies" and "requires."
Not quite so:
• "getOneFree" is hard-coded to ignore "dependencies"
• "requires" is hard-coded to ignore "getOneFree" and "unlocks"
Quote
That's kind of weird.
Just in the original version, such cases were not envisaged, therefore, was not tested in such conditions.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: hellrazor on April 29, 2016, 02:03:03 pm
To be even more brief:

What you are trying to achieve is not possible.
Every Alien which is marked as STR_ALIVE_ALIEN and has a appropriate Rank will be sent into the Alien Containment, and units in the Alien Containment are automatically made avaible in the Research Options.

This behaviour is as far as my knowledge goes hardcoded and for good reason.

However you could make the Alien Containment unit require some depenencies to get unlocked, move it further back into the research tree prolonging access to some tech's you usually wanna have quick, like Hyperwave Decoder for example.

It is also better to give the interrogations more meaning, for example you can add a getOneFree list towards any Soldier Rank, automatically unlocking a weapon or ammo type by random, which also would mean they would be avaible for research mutiple times.

The example i posted before mentioning the YAML anchors will help with this to a great deal, since in the end you only have 1 place to change your lists and it would be automatically applied to all the other places the list is called. Also removes redundencies.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: ivandogovich on April 29, 2016, 03:02:42 pm
To be even more brief:

What you are trying to achieve is not possible.
Every Alien which is marked as STR_ALIVE_ALIEN and has a appropriate Rank will be sent into the Alien Containment, and units in the Alien Containment are automatically made avaible in the Research Options.

Okay.  Good explanation of the problem.

Let me suggest a third alternative.  You desire to obscure some knowledge that the medic reveals from the player.
Piratez handles this by creating a "manufacturing" job called interrogation.  The prisoner is run through a process in the workshop that returns a "broken prisoner".  This item is presented back to the Research list, and after being researched can provide those techs that you want to delay.
In this situation, you may want to couch it as a "probe implantation" process, or maybe a "thought reader" or even a "universal translator." 

I'm not sure, but this ability to process live prisoners may only reside in the OpenXcom Extended branch.

Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Meridian on April 29, 2016, 03:11:05 pm
To be even more brief:
What you are trying to achieve is not possible.

I would normally not participate in such discussion, but proving hellrazor wrong is too good to pass... I think it is doable (not sure!) and I will try it in the evening :-) Fingers crossed...

EDIT: it's really not possible :( and the source code for this part is a total mess... I think the author should have taken a bit more sleep before writing it... you know something is wrong, when the variable name is called "ohBoy", not even joking. I hope SupSuper or Warboy can refactor this after 2.0 ... OXC definitely deserves it
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 29, 2016, 06:54:31 pm
However you could make the Alien Containment unit require some depenencies to get unlocked...
I'll keep that in mind as a Plan-B (In case the developers do not want to resolve "dependencies with getOneFree"-trouble).
I would not want to delay the appearance of the Alien Containment, as I have too many will depend on Medics (in order to avoid unnecessary confusion, I have shown only problematic part of the research tree), and at your option, by the time the end of building Alien Containment, Aquatoids can be stop appearing (but Medics have only Aquatoids).

Piratez handles this by creating a "manufacturing" job called interrogation.  The prisoner is run through a process in the workshop that returns a "broken prisoner".  This item is presented back to the Research list, and after being researched can provide those techs that you want to delay.
For the interrogation to use technicians instead of scientists? THIS IS A VERY INTERESTING IDEA!!!! :D
It will be necessary to try to implement!
By the way, you also resolved the issue of converting Live Aliens to сorpse wihout "slave-trading".

But in this case will be two small inconveniences:
• When will it end "getOneFree"-variants – "the results of the interrogation" would be impossible to research, so they will accumulate in the stores. But it will be almost unnoticeable.
• Added a pretty big list of production, because you have to create a separate production for each race and each rank of Aliens. However, the list can be reduced if, for example, soldiers and the terrorists will interrogate scientists and other – technicians.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 29, 2016, 07:00:37 pm
EDIT: it's really not possible :( and the source code for this part is a total mess... I think the author should have taken a bit more sleep before writing it... you know something is wrong, when the variable name is called "ohBoy", not even joking. I hope SupSuper or Warboy can refactor this after 2.0 ... OXC definitely deserves it
Are you want to say that to resolve the "dependencies with getOneFree"-issue in bugtrack not even worth it to post?
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Meridian on April 29, 2016, 07:21:38 pm
Are you want to say that to resolve the "dependencies with getOneFree"-issue in bugtrack not even worth it to post?

It's a change, which the devs will (in my opinion) definitely not do before 2.0... we would have to retest the whole research mechanics again. And for vanilla purposes, it works. Feel free to open it... but don't expect too much.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hobbes on April 29, 2016, 07:41:40 pm
but don't expect too much.

Nothing that a large bribe to the developers won't fix ;)
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: hellrazor on April 30, 2016, 12:09:26 pm
Nothing that a large bribe to the developers won't fix ;)

That must really be a big huge one.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Dioxine on April 30, 2016, 02:09:02 pm
It was fixed at some point (at least worked for me in OXCE at some point).
1. Make Alien Soldier 'Dependant' on the stuff on your list. This should block off the research of that alien. Might not work with 1.0 or the latest nightlies. Almost sure it works in OXCE, did that at some point but had alternative mechanics in place so decided not to demolish it.
2. Make Alien Specialist(s) 'Dependant' on Alien Soldier, or better yet, on a topic Dependant on Alien Soldier
3. Don't give anyone of the above Get One Free
3. NEVER use Requires, here or anywhere.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Hedron on April 30, 2016, 04:08:11 pm
It was fixed at some point (at least worked for me in OXCE at some point).
1. Make Alien Soldier 'Dependant' on the stuff on your list. This should block off the research of that alien. Might not work with 1.0 or the latest nightlies
In nightlies it all works and works correctly.
Quote
3. Don't give anyone of the above Get One Free
This is unacceptable. Who, then, will talk about Alien Submarines or Alien Missions?

Yet, if the developers do not want to eliminate a "GetOneFree with dependencies"-bug, the best solution I believe the option proposed by ivandogovich – to use for interrogation technicians instead of scientists.
Title: Re: Editing Research Tree in OpenXCom: "dependencies" with "getOneFree"
Post by: Kjotleik on May 31, 2016, 09:39:08 pm
Hello. again.


I did some experimenting to figure out how to do this. The only thing I came up with was to use a "Universal Translator" as implants for the alien-types which have a getOneFree.

The attachment has a working example for the standard X-Com (not TFTD), but you should have an easy task making this work for the sequel.

At the moment it only works with Sectoid/Floater Corpses/Soldiers/Navigators. Engineers/Medics/Leaders are all unchanged.

To check if it works in your installation:
A - start a new game
B - get either a Sectoid or Floater Corpse
C - get the corresponding live alien (Soldier rank)
D - get the corresponding live alien (Navigator rank)

1 - Soldiers/Navigators cannot be researched, despite them being in the Alien Containment.
2 - research the Corpse, this unlocks the Soldier rank.
3 - research the Soldier, this unlocks the Mind Probe.
4 - research the Mind Probe, this unlocks the Universal Translator and the Implanted Floater/Sectoid Navigator.
5 - manufacture Universal Translators (you get three UT's from one Mind Probe).
6 - "manufacture" the Implanted Floater/Sectoid Navigator.
7 - research the Implanted Floater/Sectoid Navigator to unlock their secrets.


PS!
You cannot ever research the Floater/Sectoid Navigators themselves. They are unavailable for research until they are Implanted in the Workshop.

If you can use any of this, please feel free to inform me if you succeed.
Unfortunately I cannot make this mod for the Final Mod Pack, as that would require to research live aliens in order to get access to the Mind Probe (and you would need the Mind Probe to research live aliens... :o  )


Sincerely
Kjotleik