aliens

Author Topic: [SOLVED] How do I eliminate a research dependency?  (Read 2940 times)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
[SOLVED] How do I eliminate a research dependency?
« on: December 13, 2015, 12:13:06 pm »
I am trying to make a mod that removes the laser pistol and laser rifle dependency on their respective research projects, and instead causes the laser weapons research project to unlock both of them.

If I give them STR_LASER_WEAPONS as a manufacturing dependency, it simply adds that one to the dependency list but they still need STR_LASER_PISTOL or STR_LASER_RIFLE research to be completed.

If I set STR_LASER_WEAPONS to unlock STR_LASER_PISTOL and STR_LASER_RIFLE, it unlocks the research projects, as in it makes them available to begin researching.

If I set the research projects' cost to 0, they still appear in the list and must be researched for 1 day.


How do I make the ruleset do what I want?
« Last Edit: September 08, 2019, 10:04:34 am by The Reaver of Darkness »

Offline robin

  • Commander
  • *****
  • Posts: 1219
  • ULTIMATE ROOKIE
    • View Profile
Re: How do I eliminate a research dependency?
« Reply #1 on: December 13, 2015, 12:46:53 pm »
delete the old projects with
  - delete: STR_LASER...
then add them again immediately after, with the differences you want:
 - type: STR_LASER...

if using the the very same name causes issues, just add a "2", or whatever, after the name:
 - type: STR_LASER...2
(i re-add deleted items/researches like this; but if you do it, you have to fix ufopaedia/items too, since the name has changed).

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: How do I eliminate a research dependency?
« Reply #2 on: December 13, 2015, 03:41:25 pm »
I didn't know there was a delete command for rulesets.

Can I delete a specific line or category from a list item? For instance, can I delete just the dependencies for STR_LASER_PISTOL?

Offline robin

  • Commander
  • *****
  • Posts: 1219
  • ULTIMATE ROOKIE
    • View Profile
Re: How do I eliminate a research dependency?
« Reply #3 on: December 13, 2015, 03:52:58 pm »
"delete" is used in place of "type".
so to delete the rifle:

 - delete: STR_RIFLE

(the original line being:
 - type: STR_RIFLE )

afaik you can't delete just the dependencies.
« Last Edit: December 13, 2015, 03:55:24 pm by robin »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: How do I eliminate a research dependency?
« Reply #4 on: December 14, 2015, 06:38:01 am »
It works, thanks!

It's a little wonky trying to replace the research if I want a research option. I was able to get the Laser Pistol, Laser Rifle, Heavy Laser, and Laser Cannon to work by using the delete command for their respective research projects. With two listed research dependencies on the manufacture project, it ignored the one that didn't exist. The Laser Defense I managed to get to work by creating a special research dependency which unlocks it.

Pro tip, for anyone reading this and trying to do something similar:
If you set the research cost to 0, you still have to research it, but...
If you make a new project that isn't in the vanilla list and you don't assign it a research cost, it works instantly and invisibly in the background. This is how the vanilla Plasma Beam research works, you can research it with either:
1.) Heavy Plasma and Heavy Plasma Clip, or
2.) Plasma Rifle and Plasma Rifle Clip.

It uses two dependency "research projects" to accomplish this.