OpenXcom Forum

OpenXcom => Open Feedback => Topic started by: Orz on August 09, 2015, 01:33:05 am

Title: Ruleset Editing Questions (& Some m'Orz Qestions)
Post by: Orz 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
Title: Re: Research: Dependencies & Requirements
Post by: Hobbes 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.
Title: Re: Research: Dependencies & Requirements
Post by: Orz 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 :)


Title: Re: Research: Dependencies & Requirements
Post by: Hobbes 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.
Title: Re: Research: Dependencies & Requirements
Post by: Orz 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)?
Title: Re: Research: Dependencies & Requirements
Post by: Hobbes 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).
Title: Re: Research: Dependencies & Requirements
Post by: Orz 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
Title: Re: Research: Dependencies & Requirements
Post by: XOps 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.
Title: Re: Research: Dependencies & Requirements
Post by: Arthanor 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).
Title: Re: Research: Dependencies & Requirements
Post by: Warboy1982 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.
Title: Re: Research & Facilities
Post by: Orz 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  :)
Title: Re: Research & Facilities
Post by: Hobbes 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.
Title: Re: Research & Facilities
Post by: Arthanor 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.
Title: Re: Research & Facilities
Post by: XOps 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.
Title: Re: Research & Facilities
Post by: Orz 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!
Title: Re: Research & Facilities
Post by: Arthanor on August 09, 2015, 09:16:02 pm
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.

Yup, otherwise the requirement would be no different from an extra dependency. Take something that has dependencies on A and B, but requires C.

If you could get dependencies at any time, it would be the same as "Depends on A, B and C" since all that really matters is getting all 3 of them.

What actually happens is "Requires C first, then A and B in any order", which is very different. That's why, for example, if you research an alien leader before having researched Alien Origins, you need to research another one. The first one did not satisfy the dependency, since the requirement had not been met.
Title: Re: Research & Facilities
Post by: Warboy1982 on August 10, 2015, 05:31:34 am
the missing S in the research was fixed days ago, make sure you're using the up-to-date ruleset.
Title: Re:
Post by: Orz on August 10, 2015, 11:18:03 pm
the missing S in the research was fixed days ago, make sure you're using the up-to-date ruleset.

Wonderful. Will do.

Now I got some mOrz questions! :P

If I wanted to remove Deep One's dependencies from Aqua Plastics, would this do the trick? (I know I could simply edit it out of the base rulset, but I'd like to understand how modular rulsets are applied to the base ruleset here—and more specifically, how to use "" and [])

Code: [Select]
  - name: STR_AQUA_PLASTICS
    dependencies: ""

Would that nullify STR_DEEP_ONE_CORPSE?

Next question (getting more complicated). If I wanted to remove a list of dependencies instead of just one, whilst adding my own dependencies, how would I do that? Let's take TFTD Alien Origin's, for example. This is how it appears:

Code: [Select]
    dependencies:
      - STR_AQUATOID_COMMANDER
      - STR_AQUATOID_NAVIGATOR
      - STR_AQUATOID_TECHNICIAN
      - STR_AQUATOID_MEDIC
      - STR_AQUATOID_SQUAD_LEADER
      - STR_AQUATOID_SOLDIER
      - STR_CALCINITE_TERRORIST
      - STR_HALLUCINOID_TERRORIST
      - STR_GILLMAN_COMMANDER
      - STR_GILLMAN_TECHNICIAN
      - STR_GILLMAN_SQUAD_LEADER
      - STR_GILLMAN_SOLDIER
      - STR_DEEP_ONE_TERRORIST
      - STR_XARQUID_TERRORIST
      - STR_TASOTH_SQUAD_LEADER
      - STR_TASOTH_SOLDIER
      - STR_TENTACULAT_TERRORIST
      - STR_BIODRONE_TERRORIST
      - STR_TRISCENE_TERRORIST
      - STR_LOBSTERMAN_COMMANDER
      - STR_LOBSTERMAN_NAVIGATOR
      - STR_LOBSTERMAN_TECHNICIAN
      - STR_LOBSTERMAN_SQUAD_LEADER
      - STR_LOBSTERMAN_SOLDIER

If I just wanted to remove all of that and just add the 4 non-Terrorist races instead, would this work?

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

Last question (for now). This is a silly question perhaps, but just to be completely clear: when I list any dependencies on my own modular ruleset without removing any from the base ruleset, does it nullify the original dependencies or does it add to them?

For example, let's say this is what I want to modify:

Code: [Select]
- name: STR_NEW_ITEM
dependencies:
- STR_ITEM_A
- STR_ITEM_B

If I do:

Code: [Select]
- name: STR_NEW_ITEM
dependencies:
- STR_ITEM_C

Does it already override the base ruleset's dependencies or does it add ITEM_C to the list?


Bonus question:

If I want to completely delete something entirely, would this work?

Code: [Select]
- facilities:
- delete: STR_ALL_YOUR_BASE_ARE_BELONG_TO_US


Bonus question #2

Does 'needItem: true' just means you must have item in storage first, so that even if dependencies are already met (or even if some other item 'unlocks' this one), you must have the item regardless?
Title: Re:
Post by: Arthanor on August 10, 2015, 11:42:05 pm
No idea about the quotes and square brackets, I haven't seen them used anywhere in rulesets (except quotes for extraStrings).. As for the rest:

Now I got some mOrz questions! :P
Alright! Let's see...

Quote
If I wanted to remove Deep One's dependencies from Aqua Plastics, would this do the trick? (I know I could simply edit it out of the base rulset, but I'd like to understand how modular rulsets are applied to the base ruleset here—and more specifically, how to use "" and [])

Code: [Select]
  - name: STR_AQUA_PLASTICS
    dependencies: ""

Would that nullify STR_DEEP_ONE_CORPSE?[/quote[
I don't think this would work, no. You can define a new list, which will overwrite the old one, but I don't think you can define an empty list. I think it might be better to just have
Code: [Select]
research:
    - delete: STR_AQUA_PLASTICS
    - name: STR_AQUA_PLASTICS
      cost: ???
      points: ???
      needItem: true

Quote
Next question (getting more complicated). If I wanted to remove a list of dependencies instead of just one, whilst adding my own dependencies, how would I do that? Let's take TFTD Alien Origin's, for example. This is how it appears:

Code: [Select]
    dependencies:
      - STR_AQUATOID_COMMANDER
      - STR_AQUATOID_NAVIGATOR
      - STR_AQUATOID_TECHNICIAN
      - STR_AQUATOID_MEDIC
      - STR_AQUATOID_SQUAD_LEADER
      - STR_AQUATOID_SOLDIER
      - STR_CALCINITE_TERRORIST
      - STR_HALLUCINOID_TERRORIST
      - STR_GILLMAN_COMMANDER
      - STR_GILLMAN_TECHNICIAN
      - STR_GILLMAN_SQUAD_LEADER
      - STR_GILLMAN_SOLDIER
      - STR_DEEP_ONE_TERRORIST
      - STR_XARQUID_TERRORIST
      - STR_TASOTH_SQUAD_LEADER
      - STR_TASOTH_SOLDIER
      - STR_TENTACULAT_TERRORIST
      - STR_BIODRONE_TERRORIST
      - STR_TRISCENE_TERRORIST
      - STR_LOBSTERMAN_COMMANDER
      - STR_LOBSTERMAN_NAVIGATOR
      - STR_LOBSTERMAN_TECHNICIAN
      - STR_LOBSTERMAN_SQUAD_LEADER
      - STR_LOBSTERMAN_SOLDIER

If I just wanted to remove all of that and just add the 4 non-Terrorist races instead, would this work?

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

The reason it is done this way is that there is some kind of interplay between having project A as a dependency of project B if A unlocks B. As you have it listed now, STR_ALIEN_ORIGINS will require you to research all 4 races. You could potentially make the racial projects unlock alien origins, but that becomes a really long chain: research line alien -> get alien race project -> unlock alien origins. in this case it was judged simpler to have "A gives B and unlocks C" than "A gives B that unlocks C". But to answer the question, yes, defining a new list will overwrite the old list.

Quote
Last question (for now). This is a silly question perhaps, but just to be completely clear: when I list any dependencies on my own modular ruleset without removing any from the base ruleset, does it nullify the original dependencies or does it add to them?

For example, let's say this is what I want to modify:

Code: [Select]
- name: STR_NEW_ITEM
dependencies:
- STR_ITEM_A
- STR_ITEM_B

If I do:

Code: [Select]
- name: STR_NEW_ITEM
dependencies:
- STR_ITEM_C

Does it already override the base ruleset's dependencies or does it add ITEM_C to the list?
Defining your list will overwrite the previous list. Unfortunately lists are not additive. If you want to add to a list, you have to define the whole thing. So for your example, you would need:

Code: [Select]
- name: STR_NEW_ITEM
dependencies:
- STR_ITEM_A
- STR_ITEM_B
- STR_ITEM_C


[quote[Bonus question:

If I want to completely delete something entirely, would this work?

Code: [Select]
- facilities:
- delete: STR_ALL_YOUR_BASE_ARE_BELONG_TO_US
[/quote[
Yup, that removes it. In some cases it is the only way to do things, such as the deleting and redefining I suggested above for Aqua Plastics.


[quote[Bonus question #2
Does 'needItem: true' just means you must have item in storage first, so that even if dependencies are already met (or even if some other item 'unlocks' this one), you must have the item regardless?
The "needItem: true" means exactly that, you need the item to be able to do the research. The only exception I can think of would be:

Code: [Select]
- name: STR_MY_SUPER_GUN
  needItem: true
- name: STR_ALIEN_GENIUS
  getOneFree:
    - STR_MY_SUPER_GUN
In which case the project is given for free, regardless of dependencies and presumable "needItem". If STR_MY_SUPER_GUN has a "requires", then I am not sure how that would interact with the "getOneFree" however.
Title: Re:
Post by: Orz on August 11, 2015, 12:27:00 am
The "needItem: true" means exactly that, you need the item to be able to do the research.

Then does 'needItem: true' become the single determining factor to gain access to certain research topics? In other words, does it work with dependencies or other variables or not?

For example, Vibro Blade has Calcinite Corpse as dependency. Does that mean I do not need to have Vibro Blade (the item in question) in order to unlock the research?

Code: [Select]
  - name: STR_VIBRO_BLADE
    cost: 300
    points: 10
    dependencies:
      - STR_CALCINITE_CORPSE

What if I add 'needItem: true' to it? What happens then?


As for the nullifying of dependencies or requirements without using "" or []

https://www.ufopaedia.org/index.php?title=Rulesets_%28OpenXcom%29#Modular_Rulesets (https://www.ufopaedia.org/index.php?title=Rulesets_%28OpenXcom%29#Modular_Rulesets)
Quote
If you need to specifically erase a field, for example to clear requirements for something (like making an item or research available from the start of the game), you can use "" for an empty string, [] for an empty list and {} for an empty map.

Say, you wanted to remove Deep One Corpse dependency from Aqua Plastics (thereby making Aqua Plastics available for research upon acquisition).

Code: [Select]
  - name: STR_AQUA_PLASTICS
    cost: 400
    points: 30
    needItem: true
    dependencies:
      - STR_DEEP_ONE_CORPSE

How would you go about it?

And does Deep One Corpse's 'unlock' need to be removed as well?

Code: [Select]
  - name: STR_DEEP_ONE_CORPSE
    cost: 180
    points: 50
    lookup: STR_DEEP_ONE_AUTOPSY
    needItem: true
    unlocks:
      - STR_AQUA_PLASTICS

To rephrase it differently: if Aqua Plastics no longer has Deep One Corpse dependency, can Deep One Corpse still unlock it just because it has 'unlocks: - STR_AQUA_PLASTICS'? Or does negating one negate the other?
Title: Re:
Post by: Arthanor on August 11, 2015, 12:51:45 am
Then does 'needItem: true' become the single determining factor to gain access to certain research topics? In other words, does it work with dependencies or other variables or not?

For example, Vibro Blade has Calcinite Corpse as dependency. Does that mean I do not need to have Vibro Blade (the item in question) in order to unlock the research?

Code: [Select]
  - name: STR_VIBRO_BLADE
    cost: 300
    points: 10
    dependencies:
      - STR_CALCINITE_CORPSE

What if I add 'needItem: true' to it? What happens then?

If a research has a "needItem: true", it simply means that this item needs to be in storage for the research to be available. It is in addition to other dependencies or requirements, which also have to be met. If you have the item in storage when the project's last dependency is satisfied, you should get the "We can now research" popup. If you didn't, but later on acquire one, you will never get a popup but it will be there next time you check after acquiring the item.

If you were you add "needItem: true" to the vibro blade, you would need to research a calcinite corpse, and then, then next time you go in the lab while having a vibro blade in your storage, you will see the research topic. Note that this doesn't work in this case, since aliens don't use the vibro blade, so you will never have one in storage before you made one, but you will never make one before researching it, but you will never research it before having one, etc.


Quote
As for the nullifying of dependencies or requirements without using "" or []

https://www.ufopaedia.org/index.php?title=Rulesets_%28OpenXcom%29#Modular_Rulesets (https://www.ufopaedia.org/index.php?title=Rulesets_%28OpenXcom%29#Modular_Rulesets)
Say, you wanted to remove Deep One Corpse dependency from Aqua Plastics (thereby making Aqua Plastics available for research upon acquisition).

Code: [Select]
  - name: STR_AQUA_PLASTICS
    cost: 400
    points: 30
    needItem: true
    dependencies:
      - STR_DEEP_ONE_CORPSE

How would you go about it?
Uh.. well well.. Never noticed that :P I guess it would work. As I mentioned before, I would otherwise have deleted the whole project and redefined it straight away. I have never been in a situation to remove dependencies, just add more, so I didn't know about that!

Quote
And does Deep One Corpse's 'unlock' need to be removed as well?

Code: [Select]
  - name: STR_DEEP_ONE_CORPSE
    cost: 180
    points: 50
    lookup: STR_DEEP_ONE_AUTOPSY
    needItem: true
    unlocks:
      - STR_AQUA_PLASTICS

To rephrase it differently: if Aqua Plastics no longer has Deep One Corpse dependency, can Deep One Corpse still unlock it just because it has 'unlocks: - STR_AQUA_PLASTICS'? Or does negating one negate the other?

If a research "unlocks" something, you will usually see it as a dependency for the projects it unlocks. This is done because otherwise, the unlocked project would have no dependency so could be researched from the beginning. In general, many things unlock a project, and that project will have many dependencies. (Unlock makes the project available regardless of dependencies and is used to bypass all the not-yet-satisfied ones).

In this case, since there is only one project that can unlock Aqua Plastics, I honestly don't see why the corpse would need to unlock it. As soon as the Deep-One Corpse project is finished, all (of one) dependencies of Aqua Plastics have been satisfied and it should become available any ways.

If you remove the dependency, you should also remove the unlock, yes. More for simplicity and "cleanliness" than because it is needed in this case, but in others where there could be new dependencies defined, having an odd unlock will probably still unlock the project and mess up your research tree.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 11, 2015, 01:13:58 am
If a research has a "needItem: true", it simply means that this item needs to be in storage for the research to be available. It is in addition to other dependencies or requirements, which also have to be met. If you have the item in storage when the project's last dependency is satisfied, you should get the "We can now research" popup. If you didn't, but later on acquire one, you will never get a popup but it will be there next time you check after acquiring the item.

That's exactly what I wanted to find out.

Quote
If you were you add "needItem: true" to the vibro blade, you would need to research a calcinite corpse, and then, then next time you go in the lab while having a vibro blade in your storage, you will see the research topic.

Great, as I figured!

EDIT: just to be clear, STR_CALCINITE_CORPSE would mean just having a corpse in storage, correct? Not the same as STR_CALCINITE_AUTOPSY.

Quote
Note that this doesn't work in this case, since aliens don't use the vibro blade, so you will never have one in storage before you made one, but you will never make one before researching it, but you will never research it before having one, etc.

Are you sure about that? Maybe it's because I have never played vanilla TFTP, only TFTDextender, but I am 100% certain aliens do carry drill-type weapons quite a lot. In fact, I've gotten all 3 types of drills way before I even begun research on them.

Quote
As I mentioned before, I would otherwise have deleted the whole project and redefined it straight away.

Well, that may perhaps be less troublesome! So, I do ask you again, just to have an idea, what would you do code-wise to delete the project and then redefine it? I still don't quite see how it should look like in my mind. An example would be appreciated :)

Quote
If a research "unlocks" something, you will usually see it as a dependency for the projects it unlocks. This is done because otherwise, the unlocked project would have no dependency so could be researched from the beginning.

Ah, so I noticed. That's why I was wondering if there was a mutual relationship between 'unlocks' and 'dependencies' where canceling one would cancel the other out.

Quote
In this case, since there is only one project that can unlock Aqua Plastics, I honestly don't see why the corpse would need to unlock it. As soon as the Deep-One Corpse project is finished, all (of one) dependencies of Aqua Plastics have been satisfied and it should become available any ways.

Exactly, that's why I was/am a bit confused.

Quote
If you remove the dependency, you should also remove the unlock, yes. More for simplicity and "cleanliness" than because it is needed in this case, but in others where there could be new dependencies defined, having an odd unlock will probably still unlock the project and mess up your research tree.

Right, I'll play it safe. Just wanted to understand the "logic" behind it.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Arthanor on August 11, 2015, 02:01:24 am
EDIT: just to be clear, STR_CALCINITE_CORPSE would mean just having a corpse in storage, correct? Not the same as STR_CALCINITE_AUTOPSY.
uh?! If you have a project that has:

Code: [Select]
- name: STR_VIBRO_BLADE
  dependencies:
      - STR_CALCINITE_CORPSE
  needItem: true

In order to research the vibroblade, you do not need to have a calcinite corpse at your base, but you need to already have researched a calcinite corpse (which is different from getting a calcinite autopsy article from an alien medic, you need to have researched the actual corpse). You also need to have a vibroblade in your storage at the base.

Quote
Are you sure about that? Maybe it's because I have never played vanilla TFTP, only TFTDextender, but I am 100% certain aliens do carry drill-type weapons quite a lot. In fact, I've gotten all 3 types of drills way before I even begun research on them.

Well well.. my memory playing tricks on me! Looking back in the ruleset, you are very right that the aliens also use the same melee weapons as XCom. I did not remember that! Sorry.

Quote
Well, that may perhaps be less troublesome! So, I do ask you again, just to have an idea, what would you do code-wise to delete the project and then redefine it? I still don't quite see how it should look like in my mind. An example would be appreciated :)

Previously, I would have done:
Code: [Select]
- delete: STR_AQUA_PLASTICS
- name: STR_AQUA_PLASTICS
  cost: 400
    points: 30
    needItem: true[/quote]

I believe that what you said is better, so knowing that now, I would do:
[code]- name: STR_AQUA_PLASTICS
  dependencies: []

Since  the second one is much cleaner.

Ouf.. anything else?  ;D
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 11, 2015, 02:40:04 am
In order to research the vibroblade, you do not need to have a calcinite corpse at your base, but you need to already have researched a calcinite corpse (which is different from getting a calcinite autopsy article from an alien medic, you need to have researched the actual corpse). You also need to have a vibroblade in your storage at the base.

You are of course absolutely right. I just realized it, but you beat me to it! I was thinking CORPSE meant the actual item in storage (which didn't make too much sense, but I was willing to go with that), when in fact it means the "Alien Corpse" research topic unlocked (which invariably unlocks the corresponding UFOpaedia article). Everything makes much more sense now.

Code: [Select]
- delete: STR_AQUA_PLASTICS
- name: STR_AQUA_PLASTICS
  cost: 400
    points: 30
    needItem: true

That doesn't look bad at all. I was worried the second would conflict with the first and get itself deleted too :P

By the way, does it matter in which order they are listed? What if you did "delete: STR_ID" after "name: STR_ID"? Or is "delete" just removing the previous/older iteration (which would be found in the base ruleset) regardless?

Code: [Select]
- name: STR_AQUA_PLASTICS
  dependencies: []

And if I did the above to replace old dependencies for new ones, would it still work? Like this:

Code: [Select]
- name: STR_AQUA_PLASTICS
  dependencies: []
  - STR_SONIC_PISTOL

Would that cancel out Deep-One Corpse and add in Sonic Pistol?

Or perhaps I should just stick to the good ol' "delete: STR_ID" method!


I do have totally different question now: when I change weapon stats, does that reflect in the corresponding UFOpedia entry or do I have to update the UFOpedia file separately? Like, if I change Dart Gun's meager power value of 16 to 24 or whatever, would UFOpaedia show this?

PS: One more question. Does 'unlock' override 'needItem'? Or do I still need to have said item before 'unlock' can come into effect? For example, Sonic Pistol could have Zrbite, Aqua Plastics and Gilman dependencies while research on Gilman Corpse can independently 'unlock' Sonic Pistol. But if Sonic Pistol has 'needItem', does Gilman Corpse research till 'unlock' it or do I have to have Sonic Pistol first?


By the way, Warboy (or anyone else working on OpenXcom), by the time I write this it may have already been fixed, but I found this:

Code: [Select]
- name: STR_MAGNETIC_NAVIGATION
cost: 450
points: 30
needItem: true
- name: STR_ION_BEAM_ACCELERATORS
cost: 450
needItem: true

ION_BEAMS is missing its 30 points research value.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Arthanor on August 11, 2015, 03:44:24 am
That doesn't look bad at all. I was worried the second would conflict with the first and get itself deleted too :P

By the way, does it matter in which order they are listed? What if you did "delete: STR_ID" after "name: STR_ID"? Or is "delete" just removing the previous/older iteration (which would be found in the base ruleset) regardless?

Well, it looks worse than the other way ;) And as far as I can tell, things are executed in order from top to bottom, so if you did:

Code: [Select]
- name: STR_AQUA_PLASTICS
  dependencies: []
- delete: STR_AQUA_PLASTICS

you would first redefine the dependency, but then remove the project altogether after. That's not a good place to be!

Quote
And if I did the above to replace old dependencies for new ones, would it still work? Like this:

Code: [Select]
- name: STR_AQUA_PLASTICS
  dependencies: []
  - STR_SONIC_PISTOL

Would that cancel out Deep-One Corpse and add in Sonic Pistol?

Or perhaps I should just stick to the good ol' "delete: STR_ID" method!
If you define new dependencies, they automatically replace the previous one. So if you want the sonic pistol to replace the corpse, all you need to do is:

Code: [Select]
- name: STR_AQUA_PLASTICS
  dependencies:
    - STR_SONIC_PISTOL

No need to delete anything. Since a new definition overwrites the old one, if you want both the Deep One and the Sonic Pistol, you need to do:

Code: [Select]
- name: STR_AQUA_PLASTICS
  dependencies:
    - STR_DEEP_ONE_CORPSE
    - STR_SONIC_PISTOL


Quote
I do have totally different question now: when I change weapon stats, does that reflect in the corresponding UFOpedia entry or do I have to update the UFOpedia file separately? Like, if I change Dart Gun's meager power value of 16 to 24 or whatever, would UFOpaedia show this?
The UFOPaedia section of the game is very well done and goes to get all its own data. If you change stats (or pictures) of an already existing item, the UFOPaedia article will automatically load the new data. Nothing to else to do. The only exception is for things like weight, which are NOT displayed generally but some modders add it to the flavour text. If you do that and then change the weight, you need to update the flavour text yourself.

Quote
PS: One more question. Does 'unlock' override 'needItem'? Or do I still need to have said item before 'unlock' can come into effect? For example, Sonic Pistol could have Zrbite, Aqua Plastics and Gilman dependencies while research on Gilman Corpse can independently 'unlock' Sonic Pistol. But if Sonic Pistol has 'needItem', does Gilman Corpse research till 'unlock' it or do I have to have Sonic Pistol first?

What unlock does is make it so that the dependencies of a given research project count as being fulfilled, regardless of if they actually were. It does not work if there is also a requires that has not been satisfied yet. It also does not interact at all with needItem, so you will still need the item. So if you have:

Code: [Select]
- name: STR_ITEM_C
  dependencies:
    - STR_PROJECT_A
    - STR_PROJECT_B
  needItem: true

- name: STR_PROJECT_B
  unlocks:
    - STR_ITEM_C

Researching project B will make item C researchable even if you haven't completed project A, but you will still need to have item C in your storage, otherwise the project will not show up. All that unlocks does is get rid of dependencies if there is no require.

Good catch on the research. It does not seem to have been corrected. For reference, if you want to see the most up to date code without having to update, you can go to the git repository (https://github.com/SupSuper/OpenXcom) and look there for the ruleset in bin/standard/xcom2.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 11, 2015, 06:00:35 pm
Researching project B will make item C researchable even if you haven't completed project A, but you will still need to have item C in your storage, otherwise the project will not show up. All that unlocks does is get rid of dependencies if there is no require.

Fabulous. Well, I believe you've answered all my questions!

Now, you wouldn't happen to know how AP, HE & Incendiary/Phosphorous actually differ from each other, would you? :P To make it simple: what does more damage; an AP round of power value 60, an HE round of 60, or a In/Ph round of 60? (I'm asking about direct hit damage—AOE or subsequent fire damage aside.)

Oh, actually: this is not terribly important, but can I use two getOneFree's in order to unlock 2 random UFO files at a time, as an example, instead of just 1? Or would they come in conflict with each other? I wouldn't think there'd be a problem, but just to be sure.

And would you happen to know where the repair, fuel, rearm order for crafts is located? I haven't been able to find it...

Quote
Good catch on the research. It does not seem to have been corrected. For reference, if you want to see the most up to date code without having to update, you can go to the git repository and look there for the ruleset in bin/standard/xcom2.

Awesome, will keep an eye on it!
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 11, 2015, 06:29:37 pm
OK, mOrz questions.

If I wanted to remove the New Fighter Flying Sub from Coelacanth/Gauss' dependencies (to make it more worthwhile), but leave Gauss Cannon intact, would this do it?

Code: [Select]
  - name: STR_COELACANTH_GAUSS    #Coelacanth/Gauss #
    requires:
     - STR_GAUSS_CANNON

In other words: whatever I list under 'requires' (even if multiple items, or same items as the base ruleset but with additions or omissions) would override the 'requires' found in the base ruleset, correct?
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Arthanor on August 11, 2015, 08:54:24 pm
Fabulous. Well, I believe you've answered all my questions!

Now, you wouldn't happen to know how AP, HE & Incendiary/Phosphorous actually differ from each other, would you? :P To make it simple: what does more damage; an AP round of power value 60, an HE round of 60, or a In/Ph round of 60? (I'm asking about direct hit damage—AOE or subsequent fire damage aside.)

With the TftD damage rule, both AP and Explosives do 50% to 150% of listed damage on impact (at ground zero for the explosive, which also means it is hitting under armor instead of whatever facing was hit). That means 30 to 90 damage on hit (neglecting damage modifiers and armor).

With EU damage rule, AP does 0% to 200% damage, so 0 to 120 damage for your 60 listed power. By opposition, explosives still do 50% to 150% damage. On average, they both do 60, in practice, the HE is a lot more reliable, especially since at ground zero it is hitting under armor which is generally lower.

For both formulas, In/Ph rounds do variable damage on hit, about 6 on average, and will do damage over time. The only thing that the listed power does is determine the size of the area to be covered in fire.

Quote
Oh, actually: this is not terribly important, but can I use two getOneFree's in order to unlock 2 random UFO files at a time, as an example, instead of just 1? Or would they come in conflict with each other? I wouldn't think there'd be a problem, but just to be sure.

No, getOneFree will be executed once, and if you have two defined in the ruleset the second should overwrite the first. It's not getTwoFree :P

Quote
And would you happen to know where the repair, fuel, rearm order for crafts is located? I haven't been able to find it...

I believe that this is hard coded.

If I wanted to remove the New Fighter Flying Sub from Coelacanth/Gauss' dependencies (to make it more worthwhile), but leave Gauss Cannon intact, would this do it?

Code: [Select]
  - name: STR_COELACANTH_GAUSS    #Coelacanth/Gauss #
    requires:
     - STR_GAUSS_CANNON

In other words: whatever I list under 'requires' (even if multiple items, or same items as the base ruleset but with additions or omissions) would override the 'requires' found in the base ruleset, correct?
You mean in the manufacture section I guess? Yes, that should work. The option to manufacture the Coelacanth should pop when you research the gauss canon. Note that you will need to also change the dependencies of the USOPaedia article if you want to get that at the same time.

It is a bit different since the coelacanth does not have its own research project. If it did, with dependencies on the cannon and sub construction, and both the manufacture and UFOPaedia had depended on that research topic, all you would have had to do is change the dependencies, but alas ;)
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 11, 2015, 09:51:50 pm
With the TftD damage rule, both AP and Explosives do 50% to 150% of listed damage on impact (at ground zero for the explosive, which also means it is hitting under armor instead of whatever facing was hit). That means 30 to 90 damage on hit (neglecting damage modifiers and armor).

With EU damage rule, AP does 0% to 200% damage, so 0 to 120 damage for your 60 listed power. By opposition, explosives still do 50% to 150% damage. On average, they both do 60, in practice, the HE is a lot more reliable, especially since at ground zero it is hitting under armor which is generally lower.

For both formulas, In/Ph rounds do variable damage on hit, about 6 on average, and will do damage over time. The only thing that the listed power does is determine the size of the area to be covered in fire.

Alright, that answers everything pretty nicely! I was aware of the 50-150% of TFTD and the 0-200% of EU. Also knew HE's quirk (other than AOE) is that it hits under armor (which is usually weaker). I did not understand how In/Ph worked, though. The damage value is quite misleading! No wonder I couldn't kill anything with Phosphorous when I first played TFTD! So there's basically little benefit other than illuminating big patches of terrain with it, right? It's not like you can count on 6 points of damage per turn to kill the enemy for you... (which is a shame, because I would have wanted it to have a more compelling reason to actually be useful)

And while I'm at it, I might as well ask: does smoke damage (like making Dye Grenade do 60 smoke damage instead of 10) also determine blast radius, or is there something else to it? Actually, is there any smoke health damage at all, or is does it only build up stunning over time? I'm a bit confused now since armor's damage modifiers do list smoke as if a unit could be strong/weak against it somehow. I can understand 0.0 would mean totally invulnerable, but to what exactly? In other words, what does smoke really do, damage-wise?

Quote
No, getOneFree will be executed once, and if you have two defined in the ruleset the second should overwrite the first. It's not getTwoFree :P

Ah, would've been nice if it worked. On a tangential note, can 2 or more UFOpaedia articles pop-up at the same time? For example, you research an Aquatoid Medic and get the Aquatoid UFOpaedia entry proper (provided you never research any Aquatoid before) + some random autopsy due to the Medic's 'geOneFree'? Does this happen or do you get both unlocked but just one pops up? I do not recall getting any more than one at once...

Quote
I believe that this is hard coded.

I do not know where I had read this, but I remember refuel, repair and rearming priorities could be re-ordered...?

Quote
You mean in the manufacture section I guess? Yes, that should work. The option to manufacture the Coelacanth should pop when you research the gauss canon. Note that you will need to also change the dependencies of the USOPaedia article if you want to get that at the same time.

It is a bit different since the coelacanth does not have its own research project. If it did, with dependencies on the cannon and sub construction, and both the manufacture and UFOPaedia had depended on that research topic, all you would have had to do is change the dependencies, but alas ;)

Right. Same with making Medi-Kit and Particle Disturbance Sensor available from the start (which is what I've just done): remove ('delete: STR_ID') their research, manufacture and UFOpedia entries.

Well, I've exhausted all my questions for now! I should be back with some mOrz later :P

Thanks for all the help.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 11, 2015, 11:17:34 pm
Digressing momentarily back to the UFOpedia question:

I noticed Disruptor Pulse Launcher shows 75% TU Cost in UFOpedia, but it's actually 66% in the code:

(https://ufopedia.csignal.org/usopedia/048.png)

Code: [Select]
    compatibleAmmo:
      - STR_DISRUPTOR_AMMO
    accuracyAimed: 120
    tuAimed: 66
    battleType: 1


Similarly, Displacer/Sonic shows a Weapon Power of 130, but it's actually 110:

(https://ufopedia.csignal.org/usopedia/014.png)

Code: [Select]
  - type: STR_DISPLACER_SONIC
    size: 6
    costSell: 980000
    transferTime: 96
    bigSprite: 54
    bulletSprite: 8
    fireSound: 36
    hitSound: 31
    power: 110
    damageType: 5

So why did UFOpedia get that wrong?

Thanks :)
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Arthanor on August 12, 2015, 01:02:38 am
Alright, that answers everything pretty nicely! I was aware of the 50-150% of TFTD and the 0-200% of EU. Also knew HE's quirk (other than AOE) is that it hits under armor (which is usually weaker). I did not understand how In/Ph worked, though. The damage value is quite misleading! No wonder I couldn't kill anything with Phosphorous when I first played TFTD! So there's basically little benefit other than illuminating big patches of terrain with it, right? It's not like you can count on 6 points of damage per turn to kill the enemy for you... (which is a shame, because I would have wanted it to have a more compelling reason to actually be useful)
Fire can be useful, there is a thread somewhere where we were discussing it recently. Fire damage ignores armor (but not damage modifiers), so if you have a 2x2 unit that is not immune to fire, that's ~24 damage per hit which is sometimes more than you can deal otherwise (a good example being sectopods), and it can work really well against reapers. For pure damage dealing in general though, it is indeed not great unless you have a weapon with lots of shots per turn. That's what the flamethrower mods do and it allows you to get a nice arc spread around your target too.

Quote
And while I'm at it, I might as well ask: does smoke damage (like making Dye Grenade do 60 smoke damage instead of 10) also determine blast radius, or is there something else to it? Actually, is there any smoke health damage at all, or is does it only build up stunning over time? I'm a bit confused now since armor's damage modifiers do list smoke as if a unit could be strong/weak against it somehow. I can understand 0.0 would mean totally invulnerable, but to what exactly? In other words, what does smoke really do, damage-wise?
The power listing of smoke is also for the area (and I think the smoke density. Not all smoked tiles are equal. (https://www.ufopaedia.org/index.php?title=Smoke#Visual_range)). The damage done is 1-3/turn and only affected by the damage multiplier. So if an armor (ex.: Power Suit) has 0%, they don't get that tiny damage. In Piratez, most armors are well above 100% and unarmored units are at 400%, which now deals 4-12 per turn and you'll get soldiers passing out if standing in the smoke. It's just that the vanilla values are very small so it's kind of a non-issue.

Quote
Ah, would've been nice if it worked. On a tangential note, can 2 or more UFOpaedia articles pop-up at the same time? For example, you research an Aquatoid Medic and get the Aquatoid UFOpaedia entry proper (provided you never research any Aquatoid before) + some random autopsy due to the Medic's 'geOneFree'? Does this happen or do you get both unlocked but just one pops up? I do not recall getting any more than one at once...
I'm pretty sure you will get the aquatoid entry and also something from getOneFree. An example is researching an engineer where you get the race and also some other stuff, usually UFO stats or something.

Quote
I do not know where I had read this, but I remember refuel, repair and rearming priorities could be re-ordered...?
I think someone altered the code to enable this at some point, at my request even. To change it to Rearm, Refuel, Repair so they are completed from fastest to longest. But I don't know of an option for that (even though I would like it rather than having to change the code).

Quote
Well, I've exhausted all my questions for now! I should be back with some mOrz later :P

Thanks for all the help.
Really? I wonder how long I'll have to wait :P But you're welcome all the same ;) I figure it's worth it to help new modders, since then we all get some new mods :D

As for your USOPaedia questions, you're sure you're comparing the picture with the ruleset that generated it? If so, that's really weird.. Or are you comparing your picture (with a dated, wrong ruleset, it seems) with the new ruleset from Github (where it would have been fixed)?
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: hellrazor on August 12, 2015, 01:15:48 am
About researching Aliens, you can do nice stuff with dependencies and such.

Make a specific research only appear after a alive alien was researched. For example.
And trigger additional Mission.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 13, 2015, 01:44:03 am
Fire damage ignores armor (but not damage modifiers), so if you have a 2x2 unit that is not immune to fire, that's ~24 damage per hit which is sometimes more than you can deal otherwise

Good to know.

Quote
The power listing of smoke is also for the area (and I think the smoke density. Not all smoked tiles are equal.). The damage done is 1-3/turn and only affected by the damage multiplier.

Alright, but to be clear: this is stun-damage only, correct?

Quote
I'm pretty sure you will get the aquatoid entry and also something from getOneFree. An example is researching an engineer where you get the race and also some other stuff, usually UFO stats or something.

Perhaps I should have phrased my question somewhat differently. What I meant to ask was: I know the two entries will be added to the UFOpedia, but will they pop-up on screen, one first, then the other (immediately after you exit the first one)? Or will the game just notify you for the first unlocked entry only?

It's a bit of a silly question, I know. I just do not remember getting two UFOpedia entries simultaneously.

Quote
I think someone altered the code to enable this at some point, at my request even. To change it to Rearm, Refuel, Repair so they are completed from fastest to longest. But I don't know of an option for that (even though I would like it rather than having to change the code).

It would be very useful if this could be implemented with rulesets.

Quote
As for your USOPaedia questions, you're sure you're comparing the picture with the ruleset that generated it? If so, that's really weird.. Or are you comparing your picture (with a dated, wrong ruleset, it seems) with the new ruleset from Github (where it would have been fixed)?

No, that's a screencap from the vanilla game. Sure, it may be fixed now. Regardless, why would the actual data state 110 and UFOpedia 130? I mean, I'm just asking because I want to be absolutely sure that any changes I make to items will be automatically reflected in UFOpedia without me needing to go out of my way and be on the lookout for any errors!

https://www.ufopaedia.org/index.php?title=Displacer/Sonic (https://www.ufopaedia.org/index.php?title=Displacer/Sonic)
Quote
Notes
The UFOpedia.orgrmation on the power of the Displacer/Sonic's weapon is incorrect. Its true power is 110.

Alright, I've been heavily (but lightly) modding the game—just aiming for a more balanced, improved, perhaps slightly more difficult re-playability. And so far, everything works to perfection (considering the hundred little changes and all the cross-referencing between rulesets). I've believe I've satisfactorily got research, manufacture, facilities, items, itemLevels, alienRaces, units and armors down.

I thought I had ufopaedia.rul down too, but I've come upon a slight predicament now. For some reason I'm unaware of, I cannot make Particle Disturbance Sensor and Medi-Kit appear on UFOpedia right from the start. Any thoughts on that?

All I've done was this:

Code: [Select]
ufopaedia:
  - id: STR_PARTICLE_DISTURBANCE_SENSOR
    requires: ""
  - id: STR_MEDI_KIT
    requires: ""

The only other changes I've done were:
Code: [Select]
research:
  - delete: STR_PARTICLE_DISTURBANCE_SENSOR
  - delete: STR_MEDI_KIT

Code: [Select]
manufacture:
  - delete: STR_PARTICLE_DISTURBANCE_SENSOR    #Particle Disturbance Sensor #
  - delete: STR_MEDI_KIT    #Medi-Kit #

And of course, I can already purchase these items as normal. Their UFOpaedia entries just don't show.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 13, 2015, 02:07:14 am
Don't worry, I managed to get it done by using the good ol' delete: STR_ID trick!

Code: [Select]
  - delete: STR_PARTICLE_DISTURBANCE_SENSOR
  - id: STR_PARTICLE_DISTURBANCE_SENSOR
    type_id: 14
    section: STR_WEAPONS_AND_EQUIPMENT
    text: STR_PARTICLE_DISTURBANCE_SENSOR_UFOPEDIA
    image_id: UP030.BDY
  - delete: STR_MEDI_KIT
  - id: STR_MEDI_KIT
    type_id: 14
    section: STR_WEAPONS_AND_EQUIPMENT
    text: STR_MEDI_KIT_UFOPEDIA
    image_id: UP052.BDY

I still don't know why it wouldn't work otherwise. Maybe... I'm not using "" correctly? if that's the case, then I'll need to fix a couple other entries in which I've used "" to delete some requirement.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Warboy1982 on August 13, 2015, 02:23:29 am
in some cases, "" won't work, because it's adding to an array rather than replacing a string, so you need to delete and redefine.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Arthanor on August 13, 2015, 02:47:29 am
Alright, but to be clear: this is stun-damage only, correct?
Yes.

Quote
Perhaps I should have phrased my question somewhat differently. What I meant to ask was: I know the two entries will be added to the UFOpedia, but will they pop-up on screen, one first, then the other (immediately after you exit the first one)? Or will the game just notify you for the first unlocked entry only?

It's a bit of a silly question, I know. I just do not remember getting two UFOpedia entries simultaneously.
Yeah, as far as I know you get them back to back. It just doesn't happen very often since you only need STR_SECTOID once, and you likely got it from a soldier which doesn't give anything else, and then when you research a sectoid medic or engineer, you only get the "bonus" one, since you already have STR_SECTOID.

Quote
No, that's a screencap from the vanilla game. Sure, it may be fixed now. Regardless, why would the actual data state 110 and UFOpedia 130? I mean, I'm just asking because I want to be absolutely sure that any changes I make to items will be automatically reflected in UFOpedia without me needing to go out of my way and be on the lookout for any errors!
Are you trying to say that the ruleset should follow the vanilla screencap? If you don't identify what you show, it is very difficult to understand you. This screenshot could have come from OpenXCom (any version of it) and that code snippet could be from any ruleset too. If you don't say anything, the assumption is that they are from the same version, which they weren't.

As you showed, the coelacanth had power 110 wrongly displayed, so OpenXCom devs decided to give the coelacanth the same power, but OpenXCom works better than the original and displays the right info. As far as I can tell, it always displays exactly the info there. The UFOPaedia in OpenXCom will pull its values from the ruleset it uses. There is nowhere for you to overwrite that, except for the "flavour" text that you need to define. If you write technical info (ex.: range or weight) then you will need to correct that as needed. Do it at your own risk ;)

Regarding the UFOPaedia thing, I guess Warboy answered. But that opens its own question: Is the "requires" list actually additive? That would be unusual..
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 14, 2015, 02:48:27 am
About researching Aliens, you can do nice stuff with dependencies and such.

Indeed! That's what I was aiming for: making live alien captures slightly more useful/important.

in some cases, "" won't work, because it's adding to an array rather than replacing a string, so you need to delete and redefine.

Thanks. Will keep that in mind!

Are you trying to say that the ruleset should follow the vanilla screencap? If you don't identify what you show, it is very difficult to understand you. This screenshot could have come from OpenXCom (any version of it) and that code snippet could be from any ruleset too. If you don't say anything, the assumption is that they are from the same version, which they weren't.

You are absolutely right. I thoughtlessly assumed the screenshot being from the vanilla game was a given. I should have clarified! My bad :P

Quote
As you showed, the coelacanth had power 110 wrongly displayed, so OpenXCom devs decided to give the coelacanth the same power, but OpenXCom works better than the original and displays the right info. As far as I can tell, it always displays exactly the info there. The UFOPaedia in OpenXCom will pull its values from the ruleset it uses.

Fantastic. I seemed to have forgot that OpenXCom is not using the same engine as the vanilla game with all its buggy innards and whatnot!

Now, I do have a question. This time I've tried pretty much everything I could think of, but I've run out of ideas! I must have overlooked something. To make a long story short: I have added all 6 ranks to every non-terrorist alien race. That is, I have added Gillman Medic & Navigator, Lobsterman Medic, and Tasoth Medic, Technician, Navigator & Commander. I have cross-checked to make sure everything was in order between rulesets (items, units, research, etc) quite extensively. I was just now testing if I could research the aliens without problem, so I assigned a couple live aliens to my base's storage using startingBase.rul

Everything works fine (I get the associated UFOpedia entries, getOneFree's, etc), but their names appear as STR_ALIEN_RANK in the research and storage lists.

This happens only with the ones I have added myself, of course. It doesn't happen with an Aquatoid Medic or Lobsterman Navigator, for example.

Is there something I'm overlooking?
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Arthanor on August 14, 2015, 02:57:14 am
did you assume that the game would auto-generate those names? :P

Unfortunately, the game isn't clever enough to realize that it is of race Tasoth and rank Commander and so should be displayed as "Tasoth Commander" You need to define what to display for STR_TASOTH_COMMANDER in the extraStrings section. If I remember well, it is just something like

Code: [Select]
extraStrings:
  STR_TASOTH_COMMANDER: "Tasoth Commander"
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 15, 2015, 07:31:13 am
Unfortunately, the game isn't clever enough to realize that it is of race Tasoth and rank Commander and so should be displayed as "Tasoth Commander" You need to define what to display for STR_TASOTH_COMMANDER in the extraStrings section.

Much appreciated. I got it done like so:

Code: [Select]
extraStrings:
  - type: en-US
    strings:
      STR_ID: Name

A couple new questions have risen. Although the mod is still being tested and works perfectly for the most part, I have experienced a couple random crashes. Now, I am aware OpenTFTD is still in beta and, as such, should not quite yet fully support modding. Furthermore, I am not even sure if these 2-3 crashes were due to some buggy coding of my own, or some buggy coding in OpenTFTD itself. I have reloaded the game again just to see if I could maybe pinpoint what caused the issue, but in some instances the crash would simply not occur again, so I guess there's no way to be totally sure, right?

Just now I was playing a random skirmish and when the first alien came out (Lobsterman), the game crashed. Earlier, the game crashed after a terror mission came up. (I have not modified the AI, missions or alien deployment in any way.)

Perhaps the following questions should be easier to address:

Is there a way to change TU-cost for priming/throwing grenades separately (say, make Proximity Grenade cheaper/faster to prime n' throw than regular Grenades)? Is this possible? If so, I have not discovered how!

Following the same line of thought: can Psi-Amp's TU-cost be differentiated between Panic and Mind Control or are they absolutely bound under Psi-Amp's singular TU-cost? In other words, could I make Panic cost 25 TUs and Mind Control 60?

And directly related to the above: can psionics be given a range-based accuracy (like weapons) instead of either (a) having you and the aliens be capable of MC'ing anyone across the map from the comfort of one's ship as in vanilla, or (b) reducing MC to line of sight only as in current mod (which makes it a bit underpowered, I must say, for both aliens and human players)? How about something in between?
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 17, 2015, 01:24:29 am
I have another question now, this time regarding 'raceWeights' (in alienMissions): do the percentages listed under raceWeights have to amount to 100%?

Let's take the following example from vanilla:

Code: [Select]
  - type: STR_ALIEN_RESEARCH
    points: 0
    raceWeights:
      0:
        STR_SECTOID: 70
        STR_SNAKEMAN: 10
        STR_FLOATER: 20

Alright, so that's 100% total. But what happens if I apply robin's Anthropod mod?

Code: [Select]
  - type: STR_ALIEN_RESEARCH
    raceWeights:
      0:
          STR_ANTHROPOD: 10

How does this affect the original code? Does it just add 10% to 100%?  ??? Why doesn't it come in conflict with the other code?

Thanks!
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Warboy1982 on August 17, 2015, 01:27:06 am
nope, they can add up to whatever you want, it will generate a number between 0 and the sum to make its selection. we (generally) make them add up to 100 because those are nice round numbers that people can easily interpret as percentages.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 17, 2015, 05:31:47 am
Thanks, Warboy. That's good to know. I'd still keep it a nice, round 100%.

Now, a small issue has popped up. I've been modding UFO/EU quite a bit. One of the things I've done was completely remove Floaters, Snakemen and Reapers (I've left Chrysallids exclusively for terror missions). I've never kind of liked them very much. Besides, I'm adding robin's 3 new aliens and I don't want to have way too many alien races flying around. The problem I encountered was when I started a new game, immediately after placing the base, I get the following error message:

(https://s27.postimg.org/pa3h7g5hf/STR_FLOATER2.png)

Sometimes, this doesn't happen and I can carry on playing as normal, but after a few days I'll get the following:

(https://s18.postimg.org/4xwree4jd/STR_FLOATER.jpg)

This is of course due to something in missionScripts, such as (for the first example):

Code: [Select]
  - type: recurringTerror
    missionWeights:
      0:
        STR_ALIEN_TERROR: 100

Is there any way to work around that?


Also, although I can rename armors (via extraStrings), they will still appear with their vanilla name when equipping them. For example, I've renamed Personal Armor: Tactical Armor. It appears as such in my item storage, but when equipping it to a soldier it appears as Personal Armor.

Am I missing something?
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Warboy1982 on August 17, 2015, 06:38:50 am
you'll have to alter the raceweights to remove floaters from the table, you might have to delete stuff first.
as for the armor, there are two written forms, STR_SOME_ARMOR and STR_SOME_ARMOR_UC (UC standing for UPPER CASE)
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 17, 2015, 07:44:54 am
you'll have to alter the raceweights to remove floaters from the table, you might have to delete stuff first

You mean, raceWeights in alienMissions? Because I had already taken care of that prior to encountering this issue. And I had also already deleted (delete: STR_ID) every instance having STR_FLOATER, STR_SNAKEMAN and STR_REAPER from every other ruleset.

Perhaps the problem lied here:

Code: [Select]
alienRaces:
  - delete: STR_FLOATER
  - delete: STR_SNAKEMAN

'alienRaces' and 'ufopaedia' are the only (?) rulesets which define by 'id:' rather than 'type:", which leads me to believe 'delete: STR_ID' doesn't apply here for some reason (?). So I did a little experiment and changed the above to:

Code: [Select]
alienRaces:
  - id: STR_FLOATER
    members: ""
  - id: STR_SNAKEMAN
    members: ""

And that seems to have done the trick. Or at least the game didn't crash for 2 months (previously it could crash right at the start or before the first month was over). I have only tried once, though, as I should be retiring to bed now. But hopefully this is it.

Quote
as for the armor, there are two written forms, STR_SOME_ARMOR and STR_SOME_ARMOR_UC (UC standing for UPPER CASE)

Thanks, that got it done!
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 18, 2015, 02:11:32 am
So I have tested this crashing issue a few more times after doing:

Code: [Select]
alienRaces:
  - id: STR_FLOATER
    members: ""
  - id: STR_SNAKEMAN
    members: ""

Although the pop-up error message didn't come up anymore, the game would still sometimes crash when entering a terror mission. I couldn't/cannot find any reason why this may be happening since it doesn't seem to be related to 'missionScript' and Floaters & Snakemen have been completely removed/replaced in 'alienMissions' and elsewhere.

So I went back to alienRaces (the above code) and did this:

Code: [Select]
alienRaces:
  - id: STR_FLOATER
    members:
      - STR_MUTON_COMMANDER
  - id: STR_SNAKEMAN
    members:
      - STR_MUTON_COMMANDER

And I have lasted over 3 months without crashing in any terror mission.

The crash is obviously related to the deletion of Floater and Snakeman races and the generation of terror missions somehow. I fail to see the connection, however. Are Floaters and Snakemen hard-coded into the game so that they cannot be actually removed? ???

How would one go about deleting an alien race entirely then?

PS: A less important question, does the ordering of aliens under 'members' in 'alienRaces' matter? I don't think it would, but just to be absolutely sure.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Warboy1982 on August 18, 2015, 04:07:15 am
you'll need to delete all the raceweights, not just "" them out. and that includes the weights in missionScripts (as applicable)
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 18, 2015, 05:18:04 am
Thanks, Warboy! It now seems so obvious! It appears the problem lied right here, what I had done was (snippet example):

Code: [Select]
alienMissions:
  - type: STR_ALIEN_RESEARCH
    points: 0
    raceWeights:
      0:
        STR_SECTOID: 70
        STR_GAZER: 10
        STR_WASPITE: 20

I thought I was replacing STR_SNAKEMAN with STR_GAZER (and FLOATER with WASPITE)! Clearly not, as I was merely adding into the original 'raceWeights' which already included Snakeman and Floater by default. How silly of me. So what I have now done was keep Snakeman & Floater but gave them 0 chance of being triggered by the game:

Code: [Select]
  - type: STR_ALIEN_RESEARCH
    points: 0
    raceWeights:
      0:
        STR_SECTOID: 70
        STR_GAZER: 10
        STR_WASPITE: 20
        STR_SNAKEMAN: 0
        STR_FLOATER: 0

This seems to have finally fixed the problem. I've been able to last 5+ months without inconveniences before I lost the game due to multiple failures to intercept/crash UFOs and flagrant avoidance of terror attacks :P

PS: Out of curiosity now, why is it that if I evade or abort a terror site, all UFO activity ceases next month and the only thing that occurs is another terror attack?

PPS: And where did Arthanor go?!
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Warboy1982 on August 22, 2015, 12:37:14 am
PS: Out of curiosity now, why is it that if I evade or abort a terror site, all UFO activity ceases next month and the only thing that occurs is another terror attack?

gonna put that down to confirmation bias. there probably are UFOs that you're simply not detecting.
you can check this at any time by making a save and opening it in a text editor to see how many UFOs are in flight/etc.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on August 28, 2015, 05:40:58 am
gonna put that down to confirmation bias. there probably are UFOs that you're simply not detecting.
you can check this at any time by making a save and opening it in a text editor to see how many UFOs are in flight/etc.

Will do that next time!

Now I'm back with a quick question :P

I cannot make the "we can now research: item" message pop-up for any of the three last HWPs (ie. Tank/Laser & the 2 Hovertanks). What I'm doing is giving each tank an independent research of their own, rather than having them become immediately available after researching other items in vanilla. So, I can make the research appear after certain dependencies are fulfilled. That's easy. Works on anything else if I'm fiddling with the research tree. For example, I could make a Sectoid Soldier research unlock Alien Grenade for research, and I will get the  "we can now research: Alien Grenade" message as normal.

However, for some reason that's eluding me, this does not occur with the tanks :/

What I'm doing:

Code: [Select]
research:
  - name: STR_HOVERTANK_PLASMA
    cost: 450
    points: 15
    dependencies:
      - STR_HEAVY_PLASMA_CLIP
      - STR_NEW_FIGHTER_CRAFT

Again, it does become researchable (it will appear in the lab's research list), but I do not get the "we can now research: Tank/Laser" notification.

What am I missing?

PS: Oh, just to compare with a more successful example: I've made it so that Alien Containment requires previous research and that works just fine. After researching the required item, I'll get the message: "we can now research: Alien Containment" without problem. So I don't know what it is with the tanks.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on September 07, 2015, 03:45:30 am
So after extensively and painstakingly modding UFO/EU to my satisfaction and playing it from beginning to end to ensure it works to perfection (*) over the past couple weeks, I've resumed my original TFTD mod. I dropped modding TFTD originally because it was not fully mod-friendly, so I thought I'd give it some time to become more stable. The following issue is probably due to this mod-support issues, but just to be completely sure I figured I'd ask here.

Basically, the game crashes when certain units (in my units.rul) get killed. So far I've encountered this problem with all Coelacanths, Displacers and Deep Ones. The strange thing is I hadn't even edited those units yet (that is, the unit in question appears exactly the same as the original file, copy/pasted and unedited). I've tested this several times already to be sure.

This is my (as of yet unedited) Deep One:

Code: [Select]
units:
  - type: STR_DEEP_ONE_TERRORIST
    race: STR_DEEP_ONE
    rank: STR_LIVE_TERRORIST
    stats:
      tu: 50
      stamina: 90
      health: 35
      bravery: 90
      reactions: 55
      firing: 50
      throwing: 58
      strength: 40
      psiStrength: 50
      psiSkill: 0
      melee: 70
    armor: DEEP_ONE_ARMOR0
    standHeight: 21
    kneelHeight: 16
    value: 12
    deathSound: 56
    intelligence: 4
    aggression: 2
    livingWeapon: true

And this is the original Deep One (Nightly 2015-09-05 06:03):
Code: [Select]
units:
  - type: STR_DEEP_ONE_TERRORIST
    race: STR_DEEP_ONE
    rank: STR_LIVE_TERRORIST
    stats:
      tu: 50
      stamina: 90
      health: 35
      bravery: 90
      reactions: 55
      firing: 50
      throwing: 58
      strength: 40
      psiStrength: 50
      psiSkill: 0
      melee: 70
    armor: DEEP_ONE_ARMOR0
    standHeight: 21
    kneelHeight: 16
    value: 12
    deathSound: 56
    intelligence: 4
    aggression: 2
    livingWeapon: true

Took me a while to figure out what was actually causing the crash (I thought it was something missing in the armor.rul at first, but that was not it): if I completely delete my Deep One from my items.rul and test it again on a random battle, then Deep Ones will die without crashing the game. It really makes no sense, considering the unit in question is an unedited copy/paste of the original.

What's more, I have other units which are actually slightly edited, like Gillmen (which come along Deep Ones, so I can test them together), but I have no problems with those. So the issue must be with the OpenXCom/TFTD engine itself. In short: some units simply cannot be overwritten (without crashing the game), even if the overwriting ruleset is a duplicate of the original.

Any suggestions? Perhaps (I hope!) I'm simply overlooking something terribly stupid.

Thanks :)


(*) I still have that HWP UFOpedia issue mentioned in my previous post unresolved, though, so any help would be highly appreciated!
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: SupSuper on September 07, 2015, 04:59:04 pm
Copy-pasting will not save you from the modding issues (https://openxcom.org/forum/index.php/topic,3287.msg50713.html#msg50713), as they are still separate mods and the game will judge them differently. It could be anything as simple as a death sound or object sprite falling into the danger zone.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on September 13, 2015, 10:54:15 pm
Copy-pasting will not save you from the modding issues (https://openxcom.org/forum/index.php/topic,3287.msg50713.html#msg50713), as they are still separate mods and the game will judge them differently. It could be anything as simple as a death sound or object sprite falling into the danger zone.

Well, I see it all seems to be fixed now :D



In other (old) news: I apologize for being so insistent here, but I would still like some help with this issue I'm having regarding HWP research topics.

Very simply, this is what I'm doing:

Code: [Select]
research:
  - name: STR_TANK_LASER_CANNON
    cost: 300
    points: 15
    dependencies:
      - STR_HEAVY_LASER
  - name: STR_HOVERTANK_PLASMA
    cost: 450
    points: 15
    dependencies:
      - STR_HEAVY_PLASMA_CLIP
      - STR_NEW_FIGHTER_CRAFT
  - name: STR_HOVERTANK_LAUNCHER
    cost: 500
    points: 15
    dependencies:
      - STR_BLASTER_BOMB
      - STR_NEW_FIGHTER_CRAFT

Their respective manufacture and ufopaedia rulesets have been tweaked accordingly. I have no problem with that (once research is done, I'll get the notice I can now manufacture the tank in question and the UFOpedia entry will pop-up as normal). My only issue is that—let's take the above Tank/Laser for example—once I complete Heavy Laser research, it will unlock Tank/Laser research, but it will not notify me "we can now research Tank/Laser" as with any other unlocked research.

In other words, after finishing Heavy Laser I can go into the lab, open up the list of topics, and lo and behold: Tank/Laser is available for research. However, I never get the pop-up notification.

And I've done this same thing with Alien Containment, like so:

Code: [Select]
research:
  - name: STR_ALIEN_CONTAINMENT
    cost: 300
    points: 25
    dependencies:
      - STR_ALIEN_FOOD
      - STR_ALIEN_REPRODUCTION

Yet I have no trouble with it. Once I research Alien Food, I will get "we can now research Alien Containment" message as normal.

So what's the problem with the tanks? It eludes me!

This is probably the last thing that I'm missing to call my mod 100% complete.

Thanks, as always  :)
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: SupSuper on September 16, 2015, 01:25:28 am
Should be fixed now.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on September 16, 2015, 04:16:49 pm
Should be fixed now.

Thanks! Tested and so far so good. Didn't know that was a bug (?). I thought I was missing something in my rulesets :P
Title: Re: Ruleset Editing Questions
Post by: Orz on September 25, 2015, 07:39:56 am
So I am play-testing my TFTD mod and The Latest Flying Sub research changes are not taking effect. Tested several times. I've done the exact same thing on my UFO/EU mod and had no problems whatsoever.

Code: [Select]
  - name: STR_THE_LATEST_FLYING_SUB
    cost: 900
    points: 30
    requires:
      - STR_NEW_FIGHTER_TRANSPORTER
    dependencies:
      - STR_THE_LATEST_FLYING_SUB_DEP
  - name: STR_THE_LATEST_FLYING_SUB_DEP
    cost: 0
    dependencies:
      - STR_AQUATOID_COMMANDER
      - STR_AQUATOID_NAVIGATOR
      - STR_AQUATOID_TECHNICIAN
      - STR_GILLMAN_COMMANDER
      - STR_GILLMAN_NAVIGATOR
      - STR_GILLMAN_TECHNICIAN
      - STR_TASOTH_COMMANDER 
      - STR_TASOTH_NAVIGATOR 
      - STR_TASOTH_TECHNICIAN 
      - STR_LOBSTERMAN_COMMANDER
      - STR_LOBSTERMAN_NAVIGATOR
      - STR_LOBSTERMAN_TECHNICIAN

In this case, it was an Aquatoid Navigator which I was researching (and yes, I already had HAMMERHEAD so the pre-requisite had already been fulfilled). And yes, all pertaining aliens (listed above) have the unlocking of STR_THE_LATEST_FLYING_SUB_DEP
 listed under their respective strings.

I even reverted back to vanilla:

Code: [Select]
  - name: STR_THE_LATEST_FLYING_SUB
    cost: 900
    points: 30
    dependencies:
      - STR_NEW_FIGHTER_TRANSPORTER
      - STR_LOBSTERMAN_COMMANDER

And just swapped Lobsterman Commander for Aquatoid Navigator:

Code: [Select]
  - name: STR_THE_LATEST_FLYING_SUB
    cost: 900
    points: 30
    dependencies:
      - STR_NEW_FIGHTER_TRANSPORTER
      - STR_AQUATOID_NAVIGATOR

Yet it still doesn't work. Seems to be something "hard-coded" about Lobsterman Commander  ???


Just to compare notes, this is what I had done in my UFO/EU mod and it worked as it should (and play-tested twice):

Code: [Select]
  - name: STR_ULTIMATE_CRAFT
    cost: 900
    points: 30
    dependencies:
      - STR_NEW_FIGHTER_TRANSPORTER
      - STR_ULTIMATE_CRAFT_DEP
  - name: STR_ULTIMATE_CRAFT_DEP
    cost: 0
    dependencies:
      - STR_SECTOID_COMMANDER
      - STR_SECTOID_LEADER
      - STR_SECTOID_ENGINEER
      - STR_WASPITE_COMMANDER
      - STR_WASPITE_LEADER
      - STR_WASPITE_ENGINEER
      - STR_GAZER_COMMANDER
      - STR_GAZER_LEADER
      - STR_GAZER_ENGINEER
      - STR_ANTHROPOD_COMMANDER
      - STR_ANTHROPOD_LEADER
      - STR_ANTHROPOD_ENGINEER
      - STR_MUTON_COMMANDER
      - STR_MUTON_LEADER
      - STR_MUTON_ENGINEER
      - STR_ETHEREAL_COMMANDER
      - STR_ETHEREAL_LEADER
      - STR_ETHEREAL_ENGINEER

Warboy or anyone, care to lend a hand?  ;)

PS: Don't know if I should post this on OpenXcom Bug Tracker instead.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Neo23 on September 25, 2015, 03:55:27 pm
Some entries in the rulesets cannot be simply overridden. The research dependencies are such a case. Your own entries will only add to all the vanilla entries without overwriting
or deleting them.
To make this work, you must delete the entire vanilla research topic from the game and add it as a new one in your mod, which is pretty easy to do:

Code: [Select]
  - delete: STR_THE_LATEST_FLYING_SUB

  - name: STR_THE_LATEST_FLYING_SUB
    cost: 900
    points: 30
    dependencies:
      - STR_NEW_FIGHTER_TRANSPORTER
      - STR_THE_LATEST_FLYING_SUB_DEP

The first line "- delete: STR_THE_LATEST_FLYING_SUB" removes the topic from the game. After that you can re-add it with new dependencies.
This will also delete the original pre-counted listorder for this item. You can sort it again by adding the listorder parameter.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on September 25, 2015, 04:52:07 pm
The first line "- delete: STR_THE_LATEST_FLYING_SUB" removes the topic from the game. After that you can re-add it with new dependencies.
This will also delete the original pre-counted listorder for this item. You can sort it again by adding the listorder parameter.

Forgot to mention yesterday, I had already done that too and it didn't work either. So far I've only successfully used that to delete and redefine Ethereal Soldier's and Aquatoid Technician's psi-skills (since I was giving the ability to just Navigators/Leaders & Commanders) which seemed to be hard-coded even if you made the value 0. And also to delete Medi-Kit and Detector/Sensor in order to make them available from the start. So I know how it works, but "delete: STR_ID" just won't work in this particular instance.

PS: Just to be clear, it's the "requires" field which doesn't work, not the dependencies. Don't worry about it, it's not that big of a deal, I'll just keep dependencies instead. I just wanted dependencies to come into effect only after the requirement was fulfilled, just a fastidious little detail :P
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Neo23 on September 25, 2015, 11:48:06 pm
I had much trouble with the "required" parameter already too and try to avoid it. From my own ruleset experience it seems this only works correct if a zero cost dep-research is used as required, but these must be unlocked with dependencies and not with get one free or unlock. Complicated stuff which cost me hours already (the famous no "you can now research" message bug for example).
As you said, try to use dependencies only and make switch researches with zero cost and you should be fine.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on September 28, 2015, 04:35:14 pm
I had much trouble with the "required" parameter already too and try to avoid it.

Indeed, I'm just sticking to dependencies only now.


Question!

I'm trying to edit the list order of facilities in the "build facility" list at the base. I cannot seem to affect the order unless I edit the main file. In other words, reordering facilities in my own facilities.rul has no effect on the game. Any way to work around this so I don't have to manually overwrite the main ruleset every time after downloading a nightly?
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Warboy1982 on September 29, 2015, 02:49:00 am
use the listOrder
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on October 02, 2015, 09:33:13 pm
use the listOrder

I was not aware listOrder applied to anything but items, research, manufacture and ufopaedia. I actually did think about it initially, I should have experimented a bit more before asking!

PS: On that note, it would be nice if a TFTD' list order was released sometime on https://ufopaedia.org. Figuring out that the vanilla (UFO/EU) listing is here altered by the introduction of 7 new items (Craft Gauss Shells, the 3 Gauss Clips, and the 3 Drills) can be a bit tricky ;P
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Dioxine on October 09, 2015, 10:34:29 am
PS: Just to be clear, it's the "requires" field which doesn't work, not the dependencies. Don't worry about it, it's not that big of a deal, I'll just keep dependencies instead. I just wanted dependencies to come into effect only after the requirement was fulfilled, just a fastidious little detail :P

My personal opinion on the 'required' flag, based on almost 2 years of modding OXCOM... avoid it like fire ;)

PS: On that note, it would be nice if a TFTD' list order was released sometime on https://ufopaedia.org. Figuring out that the vanilla (UFO/EU) listing is here altered by the introduction of 7 new items (Craft Gauss Shells, the 3 Gauss Clips, and the 3 Drills) can be a bit tricky ;P

It's a shame the listOrder for vanilla items is taken from "somewhero elso" instead of being written down in the ruleset, where it belongs. The best solution for a large mod is to add listorders for everything - lots of work but saves a lot of effort later.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: SupSuper on October 09, 2015, 11:39:05 am
My personal opinion on the 'required' flag, based on almost 2 years of modding OXCOM... avoid it like fire ;)
I feel the same way about research.

It's a shame the listOrder for vanilla items is taken from "somewhero elso" instead of being written down in the ruleset, where it belongs. The best solution for a large mod is to add listorders for everything - lots of work but saves a lot of effort later.
If you wanna write down the listOrder for over a hundred items by hand be my guest, I'd rather let a computer do it for me. :P
I'll make a script to put it on the wiki once the order's finalized.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Dioxine on October 09, 2015, 12:01:12 pm
If you wanna write down the listOrder for over a hundred items by hand be my guest, I'd rather let a computer do it for me. :P

Over a hundred? Please. It's over a 1000 in my case (and too overcomplicated to rely on a script) :) But, can't your script write it INTO the ruleset, or do you think everyone should write their own script as an exercise? :)
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Arthanor on October 09, 2015, 05:40:53 pm
Since almost everything is already written in the rulesets, it always surprised me that listOrder wasn't there. There aren't that many items in vanilla, and neither they, nor their other, ever change. It seems like something that would only need to be done once and.. if nobody is willing, I'm sure I could if you tell me it will get pulled in the master.
Title: Re:
Post by: Coincident on November 02, 2015, 12:57:36 am
Hello everyone. I've been modding some changes to research, and I've had very similar issues to ORZ, so I thought I would post here too.
I am getting a "We can now research Sectoid Corpse" message after another research, but the Sectoid Corpse has no dependencies, and nothing unlocks it, and I could already research it before...
I'm still relatively new to modding so I must have done something wrong... why am I getting this popup?

Here's what I've changed:

- Alien Containment requires research, and depends on any alien corpse
  - name: STR_ALIEN_CONTAINMENT
    cost: 250
    points: 15
    dependencies:
      - STR_SECTOID_CORPSE
      - STR_SNAKEMAN_CORPSE
      - STR_ETHEREAL_CORPSE
      - STR_MUTON_CORPSE
      - STR_FLOATER_CORPSE
      - STR_CELATID_CORPSE
      - STR_SILACOID_CORPSE
      - STR_CHRYSSALID_CORPSE
      - STR_REAPER_CORPSE
      - STR_SECTOPOD_CORPSE
      - STR_CYBERDISC_CORPSE

- name: STR_SECTOID_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_SNAKEMAN_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_ETHEREAL_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_MUTON_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_FLOATER_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_CELATID_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_SILACOID_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_CHRYSSALID_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_REAPER_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_SECTOPOD_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_CYBERDISC_CORPSE
    cost: 180
    points: 18
    unlocks:
      - STR_ALIEN_CONTAINMENT

The scenario:
I have 1 Sectoid Corpse and 1 Floater Corpse in storage. Both are available to research.
I research the Floater Corpse, and it unlocks Alien Containment (everything fine here).
After Alien Containment research finishes, I get a popup saying "We can now research Sectoid Corpse", dunno why.



After searching this thread I found this:

If a research has a "needItem: true", it simply means that this item needs to be in storage for the research to be available. It is in addition to other dependencies or requirements, which also have to be met. If you have the item in storage when the project's last dependency is satisfied, you should get the "We can now research" popup. If you didn't, but later on acquire one, you will never get a popup but it will be there next time you check after acquiring the item.
Sure - the Sectoid Corpse has "needItem: true", and I have the item in storage all the time, but nothing changed in terms of dependencies, or storage...


PS - I'm using the latest nightly build - updated this morning.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Solarius Scorch on November 04, 2015, 08:17:14 am
Coincident, I suggest using STR_SECTOID_AUTOPSY instead of STR_SECTOID_CORPSE as a prerequisite. The autopsy research is a research topic separate from the corpse research, but it costs 0 points and therefore is completed as soon as the corpse research is completed. And it will get rid of the problem with the corpse.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Coincident on November 05, 2015, 02:19:09 am
Thanks for the reply.

I did as you suggested, made the containment research depend on the several alien autopsies, and made each autopsy unlock it.
However, now when I research the first corpse (which yields an autopsy), I no longer get the "We can now research Alien Containment" message... but the research is available once I go back to the Lab interface.

(I guess I should try and take a look at the code...)
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Coincident on November 11, 2015, 02:03:20 pm
Hello again.

I wanted to try and make any alien interrogation research depend on the respective alien corpse research.
However, this does not seem to work: as soon as I capture any live alien I can immediately research it, regardless of what the research depends on.

I tried making the STR_SNAKEMAN_ENGINEER research depend on STR_SNAKEMAN_CORPSE, STR_SNAKEMAN_AUTOPSY, and even STR_ALIEN_SURGERY (I have not researched any of these 3).
Still, the Snakemen Engineer research is always available.

  - name: STR_SNAKEMAN_ENGINEER
    cost: 210
    points: 42
    dependencies:
      - STR_SNAKEMAN_AUTOPSY

Any ideas?
Am I doing something wrong? Or perhaps is this just not supported yet?
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Solarius Scorch on November 11, 2015, 05:50:00 pm
I'm pretty sure live aliens are exempt from normal research limitations. You can always interrogate them.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Coincident on November 11, 2015, 06:35:54 pm
I'm pretty sure live aliens are exempt from normal research limitations. You can always interrogate them.

Ok, I understand. Thanks for the info.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Orz on November 13, 2015, 11:44:44 pm
I did as you suggested, made the containment research depend on the several alien autopsies, and made each autopsy unlock it.
However, now when I research the first corpse (which yields an autopsy), I no longer get the "We can now research Alien Containment" message... but the research is available once I go back to the Lab interface.

Apologies for a super late reply, but I had taken (am taking) some time off as I'm occupied with other matters at the moment. I saw your message the other day but didn't quite have the leisure to provide any input until now :P

Anyway, I have come across the same quandary. For some odd reason, corpse-dependent research topics will trigger the "we can now research" message for any and all corpses (except the one that triggered the unlocking) that are listed under said research topic's dependencies after said research topic is researched, as long as those corpses are in your base's storage.

So if you have every alien corpse listed under Alien Containment's dependencies and you have Muton, Sectoid and Ethereal corpses in your storage, then after researching Muton Corpse (to pick one), unlocking the Alien Containment topic, and then researching Alien Containment, this will trigger the "we can now research" message for Sectoid and Ethereal corpses.

The problem with having autopsies do the unlocking is, as you noticed, that autopsies do not trigger the "we can now research" message, even though the research topic is still unlocked at the lab.

A fix for this should be requested here: https://openxcom.org/bugs/openxcom (https://openxcom.org/bugs/openxcom) (I'll try to make a request later since I'm incredibly busy, otherwise feel free!)

Either:

(a) corpses should be "unlinked" from being erroneously triggered for research by the research topic under which they are listed as dependencies, or

(b) autopsies should correctly trigger the "we can now research" message for whatever research topic they are unlocking.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Coincident on November 14, 2015, 12:17:24 am
Totally agree, that's exactly the situation. However, I'm focused on some other more severe bugs to report this issue atm.
Either:

(a) corpses should be "unlinked" from being erroneously triggered for research by the research topic under which they are listed as dependencies, or

(b) autopsies should correctly trigger the "we can now research" message for whatever research topic they are unlocking.
Or both  :)
Title: Re: Research: Dependencies & Requirements
Post by: Firestorm on November 30, 2015, 05:10:53 am
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.

So... Just to be crystal clear, you're saying that if I had

Code: [Select]
- name: STR_ALIEN_THINGAMAJIG
  dependencies:
    STR_ALIEN_CORPSE

- name: STR_ALIEN_MEDIC
  getOneFree:
    STR_ALIEN_AUTOPSY

Then interrogating the medic will give me the autopsy report, but will NOT unlock the thingamajig, because I didn't do the actual legwork on the CORPSE myself.  However...  If I did this instead:

Code: [Select]
- name: STR_ALIEN_THINGAMAJIG
    dependencies:
      STR_ALIEN_AUTOPSY

and again, I got that autopsy from an alien medic, that WOULD still satisfy the requirements, yes?

I'm pretty sure live aliens are exempt from normal research limitations. You can always interrogate them.

Just tested this and it is not entirely true.  While they do appear to be exempt from dependencies, they are, however, still unavailable to research if any requirements are not yet met.  Further testing may be advisable though to make sure everything flows as it should throughout the process.
Title: Re: Research: Dependencies & Requirements
Post by: Firestorm on December 03, 2015, 02:07:41 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.

Are there any plans to remedy this in the future?  Further testing on my example above has shown that listing a requirement under an alien interrogation will lock it, as I've described, but there does not appear to be any way to unlock it once the requirements have been met.  And I'd much rather use dependencies anyways, as they're simpler, more direct, and less prone to complications as have been described throughout this topic.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: greg77 on December 31, 2015, 05:05:30 pm
hi,
i'm new here and i also consider myself a newbie in openxcom modding.

what i don't quite know is how to properly add a new top-level technology to research rules. laser weapons show up automatically, but new entries i put into my rul file would not. what am i missing here?
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Meridian on December 31, 2015, 05:23:52 pm
Well, then take the "Laser Weapons" entry, make a copy and change the ID... should work.

Without the actual code, my guess is that your new technology has some dependencies, which are not discovered yet, i.e. won't pop up automatically.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: greg77 on January 02, 2016, 06:07:41 pm
thank you, Meridian, i'm right on track.
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: Cristao on January 13, 2016, 01:51:45 pm
What Meridan said. @greg77 - what I do is I tend to look for a mod or item that has the behaviour I need then modify it to give me what I want
Title: Re: Ruleset Editing Questions (& Some mOrz Qestions)
Post by: silencer_pl on January 26, 2016, 01:03:14 am
Has something changed in way for adding custom music files?

I have seperate file for music rule:

Code: [Select]
musics:
  - type: LIGHTNINGWAR
    normalization: 1.00

And in another rule for example I've added it to base defense

Code: [Select]
  - type: STR_BASE_DEFENSE
    music:
      - type: LIGHTNINGWAR

After I've switched to 2015-12-27 nightly it doesn't work anymore.
Title: Re: Research: Dependencies & Requirements
Post by: Meridian on June 27, 2017, 10:18:05 am
Usage of 'getOneFree' also has a side effect which is that the research topic will always be available for research, even with dependencies.

This limitation has been removed in the latest nightly.

PS: I'll be necroing a few posts to let modders know what's new.
Title: Re: Research: Dependencies & Requirements
Post by: Hobbes on June 27, 2017, 06:55:31 pm
PS: I'll be necroing a few posts to let modders know what's new.

It would also be useful to update the UFOPaedia.org page regarding the Nightlies ruleset to include the new functionalities and what they allow

And great work with the code rewrite done by you sir :)
Title: Re: Research: Dependencies & Requirements
Post by: Meridian on June 29, 2017, 02:38:29 pm
It would also be useful to update the UFOPaedia.org page regarding the Nightlies ruleset to include the new functionalities and what they allow

I just checked https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Research
and everything written there is correct, no need to update IMO.