OpenXcom Forum

Modding => Help => Topic started by: Cooper on November 22, 2022, 10:07:35 pm

Title: Adding items to the UFO breaks Elerium recovery?
Post by: Cooper on November 22, 2022, 10:07:35 pm
Ive added some items to a UFO floor like this:

  - type: STR_MEDIUM_SCOUT
[...]
    battlescapeTerrainData:
      name: UFO_110
      mapDataSets:
        - BLANKS
        - U_EXT02
        - U_WALL02
        - U_BITS
        - U_PODS
        - U_DISEC3
        - UFOL83
      mapBlocks:
        - name: UFO_EX1
          width: 10
          length: 10
          items:
            STR_ALIEN_SMOKE_GRENADE:
              - [7, 3, 0]
              - [7, 3, 0]


However this causes Elerium not to be recovered anymore! Is this a bug? Any way to fix this without removing the item?
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: Meridian on November 22, 2022, 10:16:05 pm
yes, seems like a bug

I'll have a look...
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: ohartenstein23 on November 22, 2022, 10:23:25 pm
Not a bug, I looked at this a while ago.

If the mapblock has items defined, the code that causes the alien fuel item to be placed on power sources doesn't run so that it doesn't duplicate them in the TFTD ships where the fuel is placed elsewhere.
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: Meridian on November 22, 2022, 10:29:50 pm
yup, found it, a feature, both in OXC and OXCE as oharty says

with a comment and all

Code: [Select]
// if one of the mapBlocks has an items array defined, don't deploy fuel algorithmically
_generateFuel = mapblock->getItems()->empty();

since July 2014
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: Cooper on November 23, 2022, 12:16:23 am
Alright, thanks for the info.

Any cool ideas on how to work around this?
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: Meridian on November 23, 2022, 12:41:52 am
Add the Elerium manually in your "items" block.
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: Cooper on November 23, 2022, 01:41:50 am
Right!

I'm so glad one Elerium in battlescape = 50 Elerium in geoscape right now.
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: Solarius Scorch on November 23, 2022, 03:05:59 pm
This is indeed how it works. It is a mild headache sometimes (especially when you use the same mapblocks for aliens and also for something else; it requires making a new terrain and redefine all the blocks), but I trust there was a good reason for this.
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: The Martian on December 01, 2022, 03:09:48 pm
I'm so glad one Elerium in battlescape = 50 Elerium in geoscape right now.

I think you could use recoveryTransformations: to control the amount of Elerium recovered from each specific item you place in the mapblock.

Example:
Code: [Select]
items:
  - type: STR_ELERIUM_115_X25
    size: 0.1
    costSell: 5000
    weight: 3
    bigSprite: 56
    floorSprite: 37
    invWidth: 1
    invHeight: 1
    recoveryPoints: 5
    recoveryTransformations:
      STR_ELERIUM_115: [25]
Title: Re: Adding items to the UFO breaks Elerium recovery?
Post by: Cooper on December 02, 2022, 12:02:53 am
Thats useful, thanks!