OpenXcom Forum

Modding => Help => Topic started by: Nord on March 24, 2022, 11:04:44 am

Title: Self-priming grenade
Post by: Nord on March 24, 2022, 11:04:44 am
Is it possible somehow to create a self-priming grenade? So that when item is created, it is allready primed?

To the point: i want to create corpse, that will explode later, on the next turn after death. "specab" can not be delayed, and corpse can not be of type: 4, so i create another item, that drops down when unit is killed, and then make real corpse invisible (with size 0x0). But if i use fuseType: -3 it will not explode, in any other cases it must be primed manually.
When we create items with terrain, there is "fuseTimers:". But what about items in pockets?
Thanks.
Title: Re: Self-priming grenade
Post by: Meridian on March 24, 2022, 11:42:36 am
Code: [Select]
items:
  - type: STR_TEST_GRENADE
    battleType: 4
    scripts:
      createItem: |
        var int fuseLength;
        battle_game.randomRange fuseLength 0 0;   # min max
        item.setFuseTimer fuseLength;
        return;
Title: Re: Self-priming grenade
Post by: Nord on March 25, 2022, 03:54:22 am
Code: [Select]
items:
  - type: STR_TEST_GRENADE
    battleType: 4
    scripts:
      createItem: |
        var int fuseLength;
        battle_game.randomRange fuseLength 0 0;   # min max
        item.setFuseTimer fuseLength;
        return;

Great, thanks!