aliens

Author Topic: Recovering friendly spawned units?  (Read 201 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 548
  • "It implores you to listen to its arguments..."
    • View Profile
Recovering friendly spawned units?
« on: January 12, 2022, 01:08:27 am »
Is it possible to recover a friendly unit at the end of combat that was spawned from an item via:
Code: [Select]
items:
  - type: STR_EXAMPLE_ITEM
    spawnUnit: STR_EXAMPLE_UNIT
    spawnUnitFaction: 0

I have a remote controlled robot drone but at the moment X-Com just discards it if deployed in the field which seems silly.

Offline Filip H

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Recovering friendly spawned units?
« Reply #1 on: January 12, 2022, 09:14:36 pm »
Using builtInWeaponSets to add a dummy item with recoveryTransformations to change it back to the original item could probably do it.
Something like this:
Code: [Select]
units:
   - type: STR_EXAMPLE_UNIT
     builtInWeaponSets:
       - - STR_DUMMY_ITEM
items:
   - type: STR_DUMMY_ITEM
     fixedWeapon: true
     recover: true
     recoveryTransformations:
        STR_EXAMPLE_ITEM: [1]

Offline The Martian

  • Commander
  • *****
  • Posts: 548
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Recovering friendly spawned units?
« Reply #2 on: January 16, 2022, 02:11:34 am »
Great idea!

And since it is assigned fixedWeapon: true if the unit is destroyed it won't drop the item, perfect!

I'll try it out and post the result.