Author Topic: Ufo power source (specialType: 2), how does it work? And more  (Read 3990 times)

Offline robin

  • Commander
  • *****
  • Posts: 1225
  • ULTIMATE ROOKIE
    • View Profile
Ufo power source (specialType: 2), how does it work? And more
« on: October 27, 2016, 10:44:23 am »
1)
I'd like to understand how the damage for crashed (sunk) UFOs works, especially regarding the power source (MCD specialType: 2).

Everything is new in my UFOs, so I deleted the vanilla STR_UFO_POWER_SOURCE to replace it with mine:

  - type: STR_ALIEN_POWER_SOURCE
    size: 0.7
    costSell: 250000
    specialType: 2
    recoveryPoints: 20

MCD-wise, the only difference is that my new one explodes, HE strength set to 90..... (didn't the original power source explode too?)

Another difference is this, I don't want it to drop any fuel:

alienFuel: [STR_ELERIUM_115, 0]

The issue I have is that my new power source is ALWAYS destroyed (exploded) in a crashed UFO, which seems abnormal to me. At first I thought it was because of the 0 dropped elerium, but it isn't.
I guess I could try to use a different specialType for my new MCD, instead of the power source reserved value (2); but then how will the damage work if I do so? Is there something hardcoded about specialType/Target_Type: 2?

Bit of complicated to explain, I hope it is clear.
In shorts I want to make a new power source that doesn't drop elerium and explodes when destroyed.. but right know I have the issue that it is always exploded on crashed UFOs.



2)
Another problem I have is about craft weapons and facilities, that can be equipped or built before being researched.

The craft weapon is an MCD, linked to the item by the specialType value (so basically it is dropped by UFOs).
The research is correctly added to the list once you obtain one of such item; but the item is immediately equippable on crafts, without need for it to be researched.

items:
  - type: STR_PLASMA_CANNON_ALIEN
    requires:
      - STR_PLASMA_CANNON_ALIEN
    size: 2.0
    costSell: 211000
    transferTime: 48
    specialType: 34
research:
  - name: STR_PLASMA_CANNON_ALIEN
    cost: 350
    points: 30
    needItem: true
    destroyItem: true

Same as above, I have a facility that is buildable before it is researched:

facilities:
  - type: STR_RADAR_SYSTEM_HD
    requires:
      - STR_RADAR_SYSTEM_HD
    requires:
    hyper: true
    spriteShape: 2
    spriteFacility: 32
    buildCost: 1500000
    buildTime: 35
    monthlyCost: 25000
    radarRange: 10850
    radarChance: 20
    mapName: XBASE_04
research:
  - name: STR_RADAR_SYSTEM_HD_ASP
    lookup: STR_RADAR_SYSTEM_HD
    cost: 10
    points: 0
    dependencies:
      - STR_CONTRACT  # non-existing thing, this project is unlocked by some other research
  - name: STR_RADAR_SYSTEM_HD
    cost: 10
    points: 10
    needItem: true


I don't understand what i'm doing wrong.
« Last Edit: October 27, 2016, 03:05:48 pm by robin »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Ufo power source (specialType: 2), how does it work? And more
« Reply #1 on: October 27, 2016, 02:42:42 pm »
I don't know if it will fix the issue, but for the radar facility, you have requires: defined twice, the first with your research, the second time, empty.  It might be reading those in order as requiring a certain research, but then wait, it's modded to not require research.  Try taking out the second requires:?

Offline robin

  • Commander
  • *****
  • Posts: 1225
  • ULTIMATE ROOKIE
    • View Profile
Re: Ufo power source (specialType: 2), how does it work? And more
« Reply #2 on: October 27, 2016, 03:03:30 pm »
i'm blind and you are right! thanks for the help
« Last Edit: October 27, 2016, 03:08:44 pm by robin »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Ufo power source (specialType: 2), how does it work? And more
« Reply #3 on: October 27, 2016, 03:12:19 pm »
No problem, glad to help.

I'm not sure you can gate equipping a craft weapon behind a research project - you could work around this by making the research unlock a manufacturing project to convert the recovered item into a usable craft weapon.

Offline robin

  • Commander
  • *****
  • Posts: 1225
  • ULTIMATE ROOKIE
    • View Profile
Re: Ufo power source (specialType: 2), how does it work? And more
« Reply #4 on: October 27, 2016, 03:30:06 pm »
making the research unlock a manufacturing project to convert the recovered item into a usable craft weapon.
this is what i had in mind initially, but then i decided to skip the manufacturing step because it was boring busywork. I guess i could go back to this solution if nothing else works.