OpenXcom Forum

OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Suggestions DONE => Topic started by: Nord on October 13, 2023, 08:09:08 pm

Title: [DONE][Suggestion] Self-destruct can spawn items and units
Post by: Nord on October 13, 2023, 08:09:08 pm
Is it possible to allow "corpseBattle" items of non 11 type?
 It will be useful first for units that spawn someone on death.
Title: Re: [Suggestion] Not corpse-type corpses.
Post by: Yankes on October 13, 2023, 08:32:31 pm
No, this is enforced because lot of logic is linked to item type and lot of recovery logic break when its changed.
Title: Re: [Suggestion] Not corpse-type corpses.
Post by: Nord on October 13, 2023, 10:22:46 pm
Oh, ok. How about scripted explosion of corpses with "power"? Is it posible maybe? Without "specab".
Title: Re: [Suggestion] Not corpse-type corpses.
Post by: Yankes on October 13, 2023, 10:37:20 pm
side question, this is related to globe corpse "specab" problem? if yes then I discussed this problem with SupSuper and we come to conclusion that we will fix it,
current solution will be new property `selfDestructItem:` that will override globe corpse item when used for self destruct.

for scripts itself, currency you can force self destruct using script hook `damageSpecialUnit` and one of parameters control "explosiveness" of given unit.
Title: Re: [Suggestion] Not corpse-type corpses.
Post by: Nord on October 13, 2023, 11:56:01 pm
No, it is not related. As about `damageSpecialUnit` - it is a great opportunity, thank you very much. Going to try. :)
Title: Re: [Suggestion] Not corpse-type corpses.
Post by: Nord on October 14, 2023, 12:40:51 am
Ok, i have discovered that i have encountered this problem earlier here (https://openxcom.org/forum/index.php/topic,6535.msg152166.html#msg152166).
I want to create resurrecting enemy unit, but exploding corpse can not spawn new unit.
Only way i found - is to add special item to the unit inventory, which will fall and detonate. But it is ugly and causes many odd situations ingame.
Best decision (for modders) will be support of spawning units not only from grenades, but from corpses too.
I see no script possibilities to spawn new unit from corpse, so maybe it will stay as it is now.
Title: Re: [Suggestion] Not corpse-type corpses.
Post by: Yankes on October 21, 2023, 06:37:34 pm
OXCE 7.9.15 now self destruct can spawn items and units, and you can define what items type is used for this by `selfDestructItem:` in armor.

Edit: https://github.com/MeridianOXC/OpenXcom/commit/b6c1eb0760540ac97bf249674c5ca165c20b26d8
Title: Re: [Suggestion] Not corpse-type corpses.
Post by: Nord on October 22, 2023, 10:47:32 am
Thanks, will try.
Title: Re: [Suggestion] Not corpse-type corpses.
Post by: Meridian on December 09, 2023, 10:38:18 am
Hi Nord, can you confirm if this is working or not?
Title: Re: [DONE][Suggestion] Self-destruct can spawn items and units
Post by: Nord on January 15, 2024, 03:14:08 pm
Checked. Work just fine. Thank you very much.
Title: Re: [DONE][Suggestion] Self-destruct can spawn items and units
Post by: mutantlord on January 15, 2024, 05:05:38 pm
Sample ruleset please?
Title: Re: [DONE][Suggestion] Self-destruct can spawn items and units
Post by: Nord on January 15, 2024, 06:21:32 pm
Sample ruleset please?
Code: [Select]
items:
  - type: STR_PHOENIX_BLAST
    categories: [STR_CORPSES]
    size: 0.2
    weight: 5
    bigSprite: 1550
    floorSprite: 1550
    invWidth: 2
    invHeight: 2
    power: 24
    damageType: 2
    recover: false
    damageAlter:
      RandomType: 2
      FireBlastCalc: false
      ToItem: 10
    spawnItem: STR_PHOENIX_CORPSE
    spawnItemChance: 100
    battleType: 11
    armor: 1
    listOrder: 10747
    ignoreInCraftEquip: true
    fixedWeapon: false

  - type: STR_PHOENIX_CORPSE
    categories: [STR_CORPSES]
    size: 0.2
    costSell: 8500
    weight: 5
    bigSprite: 1550
    floorSprite: 1550
    invWidth: 2
    invHeight: 2
    power: 24
    damageType: 2
    damageAlter:
      RandomType: 2
      FireBlastCalc: false
    recoveryPoints: 5
    spawnUnit: STR_PHOENIX
    spawnUnitFaction: 1
    battleType: 4
    isExplodingInHands: false
    fuseType: -3
    armor: 32
    listOrder: 10747
    ignoreInCraftEquip: true
    fixedWeapon: false
    scripts:
      createItem: |
        item.setFuseTimer 0;
        return;
armors:
  - type: PHOENIX_ARMOR
    corpseBattle: [STR_PHOENIX_BLAST]
    selfDestructItem: STR_PHOENIX_BLAST
...