Author Topic: Self-priming grenade  (Read 1856 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Self-priming grenade
« 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.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Self-priming grenade
« Reply #1 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;

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Self-priming grenade
« Reply #2 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!