aliens

Author Topic: Research Dependency Problems  (Read 1591 times)

Offline MFive

  • Captain
  • ***
  • Posts: 95
  • Lazy Sectoid
    • View Profile
Research Dependency Problems
« on: August 08, 2016, 08:44:55 am »
Hello,

I am attempting to re-arrange the order in which the plasma technologies are unlocked, but it is not working. I am attempting to use

Spoiler:
- name: STR_PLASMA_WEAPONS
    cost: 130
    points: 20

to unlock (after interrogating an alien, but I haven't added that part for testing) this

Spoiler:
  - name: STR_HEAVY_PLASMA
    cost: 820
    points: 30
    dependencies:
      - STR_PLASMA_WEAPONS

I am not getting any syntax errors, at least none that I am being told, and when I finish Plasma Weapons, no technologies are unlocked (like Laser Weapons).

I would have consulted the UFOPedia, but their website seems to be down at the moment (502 error).

Any ideas?


Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 6378
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Research Dependency Problems
« Reply #1 on: August 08, 2016, 10:04:27 am »
Can you please attach the whole file?... there can be mistakes in the part you haven't shown us.

Offline MFive

  • Captain
  • ***
  • Posts: 95
  • Lazy Sectoid
    • View Profile
Re: Research Dependency Problems
« Reply #2 on: August 08, 2016, 10:35:39 am »
Certainly! Here are the plasma and laser rulesets.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 6378
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Research Dependency Problems
« Reply #3 on: August 08, 2016, 11:52:02 am »
It works for me... but I guess you wanted to research Heavy Plasma even without having one at the base?
If so, you need to remove the dependency on the object itself (see attached screenshots how the dependencies look like with your ruleset).

If you didn't know, when modding an existing thing, you don't redefine it completely, you only change attributes you specify in a mod and the rest stays.

Adding:
Code: [Select]
    needItem: false
to your STR_HEAVY_PLASMA research rules should help... but somehow it gets ignored?? Don't know why...

When I commented out the "needItem: true" in the original research.rul file, it worked... maybe some more experienced modders can help, I never did any more complicated ruleset modding.

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 9814
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Research Dependency Problems
« Reply #4 on: August 08, 2016, 12:42:54 pm »
When I commented out the "needItem: true" in the original research.rul file, it worked... maybe some more experienced modders can help, I never did any more complicated ruleset modding.

Well, I can't exactly explain it, but when in doubt:

- delete: STR_HEAVY_PLASMA

And then add the entire Heavy Plasma entry again, with changes.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 6378
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Research Dependency Problems
« Reply #5 on: August 08, 2016, 01:45:19 pm »
Well, I can't exactly explain it, but when in doubt:

- delete: STR_HEAVY_PLASMA

And then add the entire Heavy Plasma entry again, with changes.

I found it... the problem was, as usual, my own stupidity.
I've put the new rul file in the same directory as original research.rul... and they got processed in wrong order.
If you put it properly in a separate mod, it will work nicely.

Offline Hobbes

  • Commander
  • *****
  • Posts: 3502
  • Infiltration subroutine in progress
    • View Profile
Re: Research Dependency Problems
« Reply #6 on: August 08, 2016, 03:09:39 pm »
Well, I can't exactly explain it, but when in doubt:

- delete: STR_HEAVY_PLASMA

And then add the entire Heavy Plasma entry again, with changes.

The explanation is that entries on rulesets either overwrite over existing entries or supplement them (in which case you'll need to delete the first entry) and a modder doesn't usually know which one happens ;)

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 9814
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Research Dependency Problems
« Reply #7 on: August 08, 2016, 03:28:35 pm »
The explanation is that entries on rulesets either overwrite over existing entries or supplement them (in which case you'll need to delete the first entry) and a modder doesn't usually know which one happens ;)

I meant I didn't know why it didn't work in this case.
Meridian's post explained it though.

Offline MFive

  • Captain
  • ***
  • Posts: 95
  • Lazy Sectoid
    • View Profile
Re: Research Dependency Problems
« Reply #8 on: August 09, 2016, 01:38:15 am »
Thanks everyone, that fixed it!