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

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #60 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

Offline Dioxine

  • Commander
  • *****
  • Posts: 5458
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #61 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.
« Last Edit: October 09, 2015, 10:37:34 am by Dioxine »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #62 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.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5458
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #63 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? :)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #64 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.

Offline Coincident

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re:
« Reply #65 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
SpoilerAlien Containment dependencies:
  - 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

SpoilerCorpses unlock:
- 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.
« Last Edit: November 02, 2015, 01:05:25 am by Coincident »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #66 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.

Offline Coincident

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #67 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...)

Offline Coincident

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #68 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.

SpoilerRuleset:
  - 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?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #69 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.

Offline Coincident

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #70 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.

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #71 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 (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.
« Last Edit: November 13, 2015, 11:54:09 pm by Orz »

Offline Coincident

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: Ruleset Editing Questions (& Some mOrz Qestions)
« Reply #72 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  :)

Offline Firestorm

  • Sergeant
  • **
  • Posts: 19
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #73 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.
« Last Edit: November 30, 2015, 05:32:57 am by Firestorm »

Offline Firestorm

  • Sergeant
  • **
  • Posts: 19
    • View Profile
Re: Research: Dependencies & Requirements
« Reply #74 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.
« Last Edit: December 03, 2015, 02:09:24 am by Firestorm »