aliens

Author Topic: Ruleset Editing Questions (& Some m'Orz Qestions)  (Read 45693 times)

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Ruleset Editing Questions (& Some m'Orz Qestions)
« on: August 09, 2015, 01:33:05 am »
Quote
dependencies
List of research projects that can unlock access to this one. If the full list is researched, or if one of the projects on the list "unlocks" this one, it becomes available.


Let's say I list the following dependencies for all Sonic weapons (Pistol, Blasta Rifle & Cannon):

Code: [Select]
dependencies:
  - STR_AQUATOID
  - STR_GILLMAN
  - STR_TASOTH
  - STR_LOBSTERMAN

Does this mean each weapon will require 4 live aliens of every race? Or does fulfilling dependencies for one item apply to all others which list the same dependencies? In other words, would all Sonic weapons become unlocked after I research a live Aquatoid, Gillman, Tasoth and Lobsterman, or would I need to research these 4 alien races again for each weapon separately? (I hope that's a clear question.)

Or would the latter apply if I list the 4 alien races as requirements instead?

Quote
requires
List of research projects unilaterally required before this project can be unlocked (for example, "the martian solution" will not even be considered for unlocking until AFTER "alien origins" is completed).

Let's take The Martian Solution as an example then. How does having Alien Origins as a requirement differ from having Alien Origins as a dependency?

Apologies if it's a silly question :P

edit: changed topic's title
« Last Edit: January 27, 2016, 02:05:23 am by Orz »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #1 on: August 09, 2015, 01:59:06 am »


Let's say I list the following dependencies for all Sonic weapons (Pistol, Blasta Rifle & Cannon):

Code: [Select]
dependencies:
  - STR_AQUATOID
  - STR_GILLMAN
  - STR_TASOTH
  - STR_LOBSTERMAN

Does this mean each weapon will require 4 live aliens of every race? Or does fulfilling dependencies for one item apply to all others which list the same dependencies? In other words, would all Sonic weapons become unlocked after I research a live Aquatoid, Gillman, Tasoth and Lobsterman, or would I need to research these 4 alien races again for each weapon separately? (I hope that's a clear question.)

You need to research once all 4 live aliens in order to unlock the 3 plasma weapons.

Quote
Or would the latter apply if I list the 4 alien races as requirements instead?

Let's take The Martian Solution as an example then. How does having Alien Origins as a requirement differ from having Alien Origins as a dependency?

Apologies if it's a silly question :P

Requirements is hardly used for some reason I can't remember so it's better to use dependencies instead.

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #2 on: August 09, 2015, 03:11:00 am »
Thanks, Hobbes.

I'd still like to know the actual difference between requirements and dependencies, though. Requirements are only used twice in research, both of which are associated with unlocking the final mission.

Code: [Select]
  - name: STR_LEADER_PLUS
    cost: 0
    requires:
      - STR_ALIEN_ORIGINS

Wouldn't having Alien Origins as a dependency have the same effect as a requirement here? I would just like to understand the logic behind it. Same with the second example below.

Code: [Select]
  - name: STR_COMMANDER_PLUS
    cost: 0
    points: 0
    unlocks:
      - STR_TLETH_ALIEN_CITY
    requires:
      - STR_THE_ULTIMATE_THREAT

My following question is: I understand "unlock" basically overrides the need to fulfill multiple dependencies, correct? To follow up on my original example then, Sonic Pistol could have all 4 alien races listed under dependencies and I could make each one of those races "unlock" Sonic Pistol, thus overriding the need to research the 4 of them.

Now... could I have any other item (say, Gauss Pistol) "unlock" Sonic Pistol even if it's not listed under Sonic Pistol's dependencies (as the 4 alien races are) or does it have to be included under Sonic Pistol's dependencies too in order to be able to unlock it?

All these examples are experimental, I'm just trying to learn how it all works!

Thanks :)


« Last Edit: August 09, 2015, 03:13:02 am by Orz »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #3 on: August 09, 2015, 03:20:45 am »
I'd still like to know the actual difference between requirements and dependencies, though. Requirements are only used twice in research, both of which are associated with unlocking the final mission.

Code: [Select]
  - name: STR_LEADER_PLUS
    cost: 0
    requires:
      - STR_ALIEN_ORIGINS

Wouldn't having Alien Origins as a dependency have the same effect as a requirement here? I would just like to understand the logic behind it. Same with the second example below.

I don't know the exact difference between dependency and requirement - only that you should use dependency rather than requirement, sorry.

Quote
Code: [Select]
  - name: STR_COMMANDER_PLUS
    cost: 0
    points: 0
    unlocks:
      - STR_TLETH_ALIEN_CITY
    requires:
      - STR_THE_ULTIMATE_THREAT

My following question is: I understand "unlock" basically overrides the need to fulfill multiple dependencies, correct? To follow up on my original example then, Sonic Pistol could have all 4 alien races listed under dependencies and I could make each one of those races "unlock" Sonic Pistol, thus overriding the need to research the 4 of them.

Now... could I have any other item (say, Gauss Pistol) "unlock" Sonic Pistol even if it's not listed under Sonic Pistol's dependencies (as the 4 alien races are) or does it have to be included under Sonic Pistol's dependencies too in order to be able to unlock it?

All these examples are experimental, I'm just trying to learn how it all works!

Thanks :)

Correct, 'unlock' gets the research available even if all the entries on dependencies haven't been researched yet. And you can define 'unlock' in research topics that aren't 'dependencies', like your Gauss Pistol example.

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #4 on: August 09, 2015, 03:39:26 am »
So I wouldn't need Gauss Pistol to be listed under Sonic Pistol's dependencies then, just as long as Gauss Pistol has:

Code: [Select]
    unlocks:
      - STR_SONIC_PISTOL

Therefore if I wanted to make something require multiple topics of research I should make nothing 'unlock' it, so the only way to make it available would be by fulfilling all of its dependency items.

Next question: does 'getOneFree' always unlock one of the bonuses listed or is that random (ie. maybe you get a bonus, maybe not)?

I believe that's all the questions I have for now, but I'm pretty sure I'll be back for more later.

Thanks for the clarifications, Hobbes.

PS: Just to be sure, would STR_AQUATOID mean any Aquatoid, regardless of rank (as opposed to STR_AQUATOID_MEDIC, for example, which would be rank-specific)?
« Last Edit: August 09, 2015, 03:51:43 am by Orz »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #5 on: August 09, 2015, 04:53:04 am »
Next question: does 'getOneFree' always unlock one of the bonuses listed or is that random (ie. maybe you get a bonus, maybe not)?

Always unlocks one. Usage of 'getOneFree' also has a side effect which is that the research topic will always be available for research, even with dependencies.

Quote
PS: Just to be sure, would STR_AQUATOID mean any Aquatoid, regardless of rank (as opposed to STR_AQUATOID_MEDIC, for example, which would be rank-specific)?

No. STR_AQUATOID is used to designate a speciific /alienRace entry, while STR-AQUATOID_MEDIC is an entry on /units (along with all the other ranks).

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #6 on: August 09, 2015, 05:10:46 am »
Always unlocks one. Usage of 'getOneFree' also has a side effect which is that the research topic will always be available for research, even with dependencies.

You mean a 'getOneFree' from an Aquatoid Medic, for example, would randomly unlock some alien autopsy, completely overriding the need to properly research the corresponding corpse and therefore making the research topic immediately available?

Quote
No. STR_AQUATOID is used to designate a speciific /alienRace entry, while STR-AQUATOID_MEDIC is an entry on /units (along with all the other ranks).

So if I list the following under Sonic Pistol (to keep using the same example):

Code: [Select]
dependencies:
  - STR_AQUATOID
  - STR_GILLMAN
  - STR_TASOTH
  - STR_LOBSTERMAN

Doesn't that mean any rank of any of the aforementioned alien races would qualify? Or do I have to indicate STR_AQUATOID_SOLDIER, STR_AQUATOID_SQUAD_LEADER, STR_AQUATOID_MEDIC, etc. for each race (assuming I wanted all ranks to qualify as dependencies)?


PS: Does DEEP_ONE_TERRORIST under Ion Armor's dependencies mean you must have a live Deep One in storage/containment? In other words, it's not a Deep One's Autopsy, correct?

Code: [Select]
    dependencies:
      - STR_ION_BEAM_ACCELERATORS
      - STR_PLASTIC_AQUA_ARMOR
      - STR_DEEP_ONE_TERRORIST

So if I wanted it to be an autopsy or corpse requirement I'd have to change that to STR_DEEP_ONE_AUTOPSY or STR_DEEP_ONE_CORPSE, respectively?

And just to be sure, AUTOPSY means the UFOpedia entry has been unlocked and CORPSE means that, well, you have a dead Deep One in storage.

I should stop with the questions for now :P
« Last Edit: August 09, 2015, 05:28:45 am by Orz »

Offline XOps

  • Colonel
  • ****
  • Posts: 193
  • Guy who drowns first
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #7 on: August 09, 2015, 05:59:27 am »
You mean a 'getOneFree' from an Aquatoid Medic, for example, would randomly unlock some alien autopsy, completely overriding the need to properly research the corresponding corpse and therefore making the research topic immediately available?
Get one free basically randomly selects a single research topic from its following list, and gives it to the player instantly. It does not unlock anything by itself. The player just gets the random free tech as though they researched it.
Code: [Select]
   
  - name: STR_SOME_TECH
    cost: 100
    points: 10
    getOneFree:
      - STR_TECH_1
      - STR_TECH_2
      - STR_TECH_3
Basically when STR_SOME_TECH is researched, then it will give the player either tech 1, 2, or 3. However, upon completing research, STR_SOME_TECH will still be available unless needitem is set to true and the option to expend items upon research is set to true in the advanced options or it is a live alien which are hardcoded to expire after research. Dependencies, requirements, or any other restriction do not matter in this case. The player will receive a tech from the list unless the player already has every item researched.

So if I list the following under Sonic Pistol (to keep using the same example):

Code: [Select]
dependencies:
  - STR_AQUATOID
  - STR_GILLMAN
  - STR_TASOTH
  - STR_LOBSTERMAN

Doesn't that mean any rank of any of the aforementioned alien races would qualify? Or do I have to indicate STR_AQUATOID_SOLDIER, STR_AQUATOID_SQUAD_LEADER, STR_AQUATOID_MEDIC, etc. for each race (assuming I wanted all ranks to qualify as dependencies)?
Given the code you posted above, the player would only need to research a member of that alien race or have received the techs through medic interrogations. There would be no rank requirements.


PS: Does DEEP_ONE_TERRORIST under Ion Armor's dependencies mean you must have a live Deep One in storage/containment? In other words, it's not a Deep One's Autopsy, correct?

Code: [Select]
    dependencies:
      - STR_ION_BEAM_ACCELERATORS
      - STR_PLASTIC_AQUA_ARMOR
      - STR_DEEP_ONE_TERRORIST

So if I wanted it to be an autopsy or corpse requirement I'd have to change that to STR_DEEP_ONE_AUTOPSY or STR_DEEP_ONE_CORPSE, respectively?
Yes. DEEP_ONE_TERRORIST means the player must research a live deep one in order to meet the requierments for the tech to become available for research.
If you wanted the requirement to be a dead deep one, then I would stick with STR_DEEP_ONE_CORPSE to be safe since that's what the rules currently reference. Basically yes, corpses can be requirements for research.

And just to be sure, AUTOPSY means the UFOpedia entry has been unlocked and CORPSE means that, well, you have a dead Deep One in storage.
I'm not really sure. The rules basically have researching the corpse give the player the autopsy tech which references the proper UFOpaedia article. Someone wiser than me would probably know the reason why it's set up like this.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #8 on: August 09, 2015, 07:07:46 am »
I'm not really sure. The rules basically have researching the corpse give the player the autopsy tech which references the proper UFOpaedia article. Someone wiser than me would probably know the reason why it's set up like this.

Research topics with "needItem: true" need the item with the same string. So if you had a "STR_SECTOID_AUTOPSY" research project with "needItem: true" you would need a "Sectoid Autopsy" in your base in order to research it. That would make no sense.

Since the item you need is "STR_SECTOID_CORPSE", the associated project needs to be "STR_SECTOID_CORPSE" with "needItem: true". Following the ruleset, it will "lookup" STR_SECTOID_AUTOPSY (which means the research project will give actually display the Sectoid Autopsy title and that UFOPaedia article).

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #9 on: August 09, 2015, 11:14:30 am »
dependencies and requirements are similar, but where dependencies can occur in any order, requirements are just that - required in order for the research to become available to unlock.


so for example, the ultimate threat REQUIRES alien origins.

assuming you don't have alien origins completed, doing research on an alien leader will give you nothing of value. whereas if you HAVE alien origins unlocked, the requirement is fulfilled, so researching the leader will make the ultimate threat available.
in short, you can research the leader as many times as you want, but until you research origins, ultimate threat will stay locked. same applies to cydonia.

the divide between the corpses and the autopsies is intentional - medics will unlock certain autopsies, but they won't grant any associated research, whereas the corpse itself will still be available, and WILL.

for example: deep ones.
if you capture an aquatoid medic, he might give you information on live deep ones, but that won't give you access to aqua plastics, you still need to go out and get a physical sample.
« Last Edit: August 09, 2015, 11:20:40 am by Warboy1982 »

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Research & Facilities
« Reply #10 on: August 09, 2015, 04:35:20 pm »
Yes, I was just figuring that out last night... requirements could perhaps be more easily understood as pre-requisites, so that regardless of how many dependencies are met (or even single "unlocking" factors, for that matter), until the pre-requisite is fulfilled, nothing will be unlocked.

So following my earlier Sonic Pistol example, I could have this:

Code: [Select]
requires:
          - STR_AQUA_PLASTICS
dependencies:
  - STR_AQUATOID
  - STR_GILLMAN
  - STR_TASOTH
  - STR_LOBSTERMAN

In this case, even if I captured and interrogated all 4 live aliens from each race (or even if I made any one of them independently 'unlock' STR_SONIC_PISTOL), I would still not get Sonic Pistol until I researched Aqua Plastics.



Now, on to Facilities!

If I wanted to make Alien Containment require Alien Cryogenics and Alien Cloning (rather than being immediately available from the beginning), would this be enough?

Code: [Select]
  - type: STR_ALIEN_CONTAINMENT
    requires:
      - STR_ALIEN_CRYOGENICS
      - STR_ALIEN_CLONING

Would that prompt a "now we can build Alien Containment" pop-up alongside it's UFOpedia entry? Or do I need to do something else?



Also, I'm not sure if there's a little typo in the code below. I was going through Gauss Defenses as a guideline for the above example, and I came across this:

Code: [Select]
  - type: STR_GAUSS_DEFENSES
    requires:
      - STR_GAUSS_DEFENSES

However, when I tried to look up STR_GAUSS_DEFENSES in research.rul, I didn't find it. Instead, I found this:
    
Code: [Select]
  - name: STR_GAUSS_DEFENSE
    cost: 510
    points: 15

In other words, shouldn't Gauss Defenses require STR_GAUSS_DEFENSE (without the S at the end, as it appears in research.rul) rather than STR_GAUSS_DEFENSES (with an S at the end)? Or am I totally off?

Same applies to STR_PWT_DEFENSES and STR_SONIC_DEFENSES as well. Just want to be sure.

Thanks for all the help, everyone  :)
« Last Edit: August 09, 2015, 05:46:51 pm by Orz »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Research & Facilities
« Reply #11 on: August 09, 2015, 07:34:33 pm »
Would that prompt a "now we can build Alien Containment" pop-up alongside it's UFOpedia entry? Or do I need to do something else?

It should but the pop-ups sometimes don't appear when they should.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Research & Facilities
« Reply #12 on: August 09, 2015, 07:37:06 pm »
Yes, I was just figuring that out last night... requirements could perhaps be more easily understood as pre-requisites, so that regardless of how many dependencies are met (or even single "unlocking" factors, for that matter), until the pre-requisite is fulfilled, nothing will be unlocked.

So following my earlier Sonic Pistol example, I could have this:

Code: [Select]
requires:
          - STR_AQUA_PLASTICS
dependencies:
  - STR_AQUATOID
  - STR_GILLMAN
  - STR_TASOTH
  - STR_LOBSTERMAN

In this case, even if I captured and interrogated all 4 live aliens from each race (or even if I made any one of them independently 'unlock' STR_SONIC_PISTOL), I would still not get Sonic Pistol until I researched Aqua Plastics.
That's almost right. What will happen is that you can research any of these any number of time you want, it will do absolutely nothing for the sonic pistol. You have to research the aliens again AFTER you have researched aqua plastics. Before the requirements are met, no progress can be made towards the dependencies.

This is what makes requirements dangerous. If the dependency is an alien, you can always interrogate another one. Same for a corpse, you can research another one. But if you have research C with a requirement on research A and a dependency on a regular research B (which can only be researched once), then if you happen to complete research B before you did research A, you're screwed. Research B didn't satisfy the dependency of research C, because its requirement of research A had not been met. Even if you afterwards get research B, you can never again get research A, so you will never get research C.

That's why, if you have a project with a requirement, you should only put corpses, items and interrogations as dependencies, since you can do those however many time you want. Never put one off projects unless you are 500% sure that the requirement will be met before the dependency (in which case you could make your research tree differently and avoid requirements).

By being satisfiable in any order, dependencies are MUCH easier and safer to work with than requirements. But requirements can be awesome if you want to make things harder to get, like cydonia.

Quote
Now, on to Facilities!

If I wanted to make Alien Containment require Alien Cryogenics and Alien Cloning (rather than being immediately available from the beginning), would this be enough?

Code: [Select]
  - type: STR_ALIEN_CONTAINMENT
    requires:
      - STR_ALIEN_CRYOGENICS
      - STR_ALIEN_CLONING

Would that prompt a "now we can build Alien Containment" pop-up alongside it's UFOpedia entry? Or do I need to do something else?
That should work. In my version of a similar idea, I defined a new research project for the alien containment with its own dependencies, then put that in the facility's requires. It might help with the popup issue that Hobbes was talking about.

Quote
Also, I'm not sure if there's a little typo in the code below. I was going through Gauss Defenses as a guideline for the above example, and I came across this:

Code: [Select]
  - type: STR_GAUSS_DEFENSES
    requires:
      - STR_GAUSS_DEFENSES

However, when I tried to look up STR_GAUSS_DEFENSES in research.rul, I didn't find it. Instead, I found this:
    
Code: [Select]
  - name: STR_GAUSS_DEFENSE
    cost: 510
    points: 15

In other words, shouldn't Gauss Defenses require STR_GAUSS_DEFENSE (without the S at the end, as it appears in research.rul) rather than STR_GAUSS_DEFENSES (with an S at the end)? Or am I totally off?

Same applies to STR_PWT_DEFENSES and STR_SONIC_DEFENSES as well. Just want to be sure.

Thanks for all the help, everyone  :)

That looks like a good catch! I haven't played OpenTftD enough to find if indeed the defenses don't show up, but strictly from this, they should indeed not come up as the research/requires don't match.

Offline XOps

  • Colonel
  • ****
  • Posts: 193
  • Guy who drowns first
    • View Profile
Re: Research & Facilities
« Reply #13 on: August 09, 2015, 07:57:27 pm »
Just for reference
https://www.ufopaedia.org/index.php?title=Ruleset_Reference_Nightly_%28OpenXcom%29
This explains most of the rules files.

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Research & Facilities
« Reply #14 on: August 09, 2015, 09:00:02 pm »
That's why, if you have a project with a requirement, you should only put corpses, items and interrogations as dependencies, since you can do those however many time you want.

Ah, that's extremely good to know!

You also answered another question I had in mind: I was thinking dependencies fulfilled prior to the requirement would still count towards unlocking said project/topic, but you are basically saying that's not the case (ie. dependencies must be researched—again, if necessary—after the requirement is met). Gotta keep that in mind.

Quote
That looks like a good catch! I haven't played OpenTftD enough to find if indeed the defenses don't show up, but strictly from this, they should indeed not come up as the research/requires don't match.

That's what I thought. I haven't gotten into OpenTFTD quite yet either (I was/am already in the middle of playing TFTDextender when it was released). Would be nice if somebody could verify this (ie. Gauss/Sonic/PWT Defenses research strings not matching those of facilities).

It should but the pop-ups sometimes don't appear when they should.

Is there any particular reason for that? I also noticed this while playing TFTDextender, I just thought it was some glitch in the coding or something (and I've reloaded a couple times on the same research to test it, but it seems to be totally random).

Just for reference
https://www.ufopaedia.org/index.php?title=Ruleset_Reference_Nightly_%28OpenXcom%29
This explains most of the rules files.

Yes, I'm drawing from it extensively!
« Last Edit: August 09, 2015, 09:08:04 pm by Orz »