Author Topic: needItem confusion  (Read 7221 times)

Offline Quinch

  • Colonel
  • ****
  • Posts: 128
    • View Profile
needItem confusion
« on: November 23, 2014, 07:25:25 am »
I'm doing some experimental tweaking with the Final Mod Pack, but I'm a bit stumped.

Short version, in the research tree of the ruleset, I have a bunch of hidden prerequisite technologies that aren't unlocked by anything, but are granted by several getOneFree triggers*. For example;

  - name: STR_DART_RIFLE_CLIP_B_PRE1_MASTER
    points: 0
    needitem: true

In theory, I think, it should not be actually available for research, due to its needItem tag. But it, as well as all others of its kind, are showing up in the research window even as soon as a new game is started. A different example would be -

  - name: STR_HYBRID_MEETING
    points: 50
    needItem: true

- which is not available for research, and is likewise granted by a getOneFree from a different research.

What am I doing wrong?

*unless I'm overthinking this and there is actually a way to "OR" research dependencies.
« Last Edit: November 23, 2014, 07:36:28 am by Quinch »

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: needItem confusion
« Reply #1 on: November 23, 2014, 07:35:40 am »
Looking at your post and assuming you copy-pasted the code in (you should use code tags btw), it looks like the one that's not working is written as "needitem", whereas the one that works is "needItem", as it should be.

Rulesets are case sensitive and missing the one capital letter in the middle will make OpenXCom look at it, "think": <<I don't know nothing about "needitem", whatever.. Next! >> and ignore it, whereas it knows what to do with "needItem".

The joy of modding..

Offline Quinch

  • Colonel
  • ****
  • Posts: 128
    • View Profile
Re: needItem confusion
« Reply #2 on: November 23, 2014, 07:37:58 am »
Oh, for lack of a shift key.... yep, fixed! Onwards to the next error!

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: needItem confusion
« Reply #3 on: November 23, 2014, 12:32:54 pm »
*unless I'm overthinking this and there is actually a way to "OR" research dependencies.
there is
take a look hoe you get the plasma beam in the original ruleset
you need plasma rifle OR heavy plasma to get plasma beam

Offline Quinch

  • Colonel
  • ****
  • Posts: 128
    • View Profile
Re: needItem confusion
« Reply #4 on: November 23, 2014, 07:46:19 pm »
Yep, the roundabout way - I meant if there was something directly in the syntax.

What I'm trying {trying to test it now} is more of a X = (A OR B) AND (C OR D) kind of system. I actually uploaded the ruleset in the earlier post as an edit.

Offline NoelBuddy

  • Colonel
  • ****
  • Posts: 142
    • View Profile
Re: needItem confusion
« Reply #5 on: November 23, 2014, 08:04:06 pm »
Here's an alternative method for a this "or" that research progression.  I  changed it so instead of Laser Weapons you start with "First Contact Debris" for initial research option, which unlocks either Lasers or Gauss, then when you research plasma weapons it unlocks the other branch. From what I've found trying to combine multiple X = (A OR B) AND (C OR D) things get's messy quick. Figuring out plausible ways to cut it in to tiny step research projects seems the simplest method.
« Last Edit: November 23, 2014, 11:05:24 pm by NoelBuddy »

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: needItem confusion
« Reply #6 on: November 23, 2014, 08:18:27 pm »
That's a very nifty idea, NoelBuddy!

I like the unpredictability of innovation it represents. Your scientists come up with some idea, pursue it, and later discover the other. And you don't have time to wait until the other idea (no telling your scientists, keep looking into this more! I know there's something else to be found! Since the XCom commander doesn't know even though the player might).

Very nice and totally an idea I will try to steal to make a more dynamic research tree.

Offline Quinch

  • Colonel
  • ****
  • Posts: 128
    • View Profile
Re: needItem confusion
« Reply #7 on: November 23, 2014, 08:44:19 pm »
Different situation, I think. The original ruleset has dependencies for specific alien autopsies to unlock - but because of the increasing variety of alien species {which is a generally positive thing} it becomes more and more of a crapshoot as to which species you'll encounter.

I don't suppose there's a ruleset syntax for "research X amount of technologies from this list of dependencies to unlock Y"?

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: needItem confusion
« Reply #8 on: November 23, 2014, 08:57:08 pm »
I don't suppose there's a ruleset syntax for "research X amount of technologies from this list of dependencies to unlock Y"?
you can do these things
i made a mod "you need 2 ufos researched for firestorm 5 for lighning all for avenger" once
this was done by creating a lot of "0 cost 0 points" rules
you can make "nr of technologies" and OR condition already with the existing syntax
i admit some of these solution need a lot of yaml lines
but introducing new code (= better syntax) just to make mods more readable without adding functionality ... i hope the devs have better things to do ..


Offline NoelBuddy

  • Colonel
  • ****
  • Posts: 142
    • View Profile
Re: needItem confusion
« Reply #9 on: November 23, 2014, 09:16:39 pm »
I don't suppose there's a ruleset syntax for "research X amount of technologies from this list of dependencies to unlock Y"?

I've had difficulty triggering things with getOneFree, so that may be a complication with trying to do things "Research X UFOs to unlock Y" chains.  When a Research topic has it's dependencies fulfilled thru getOneFree even if it is set at cost = 0 it just becomes unlocked and still requires 1 scientist-day on it to complete the research... You could get around this by naming the nested research topics something like "UFO topic summery report" and then set the desired research topic to be unlocked once any combination of X reports have been generated.