OpenXcom Forum

Modding => Help => Topic started by: LobsterKing on February 04, 2021, 03:16:38 pm

Title: Unit using builtInWeaponSets dropped no loot when dies. Intended feature or bug?
Post by: LobsterKing on February 04, 2021, 03:16:38 pm
Hi, I have units in my mod using builtInWeaponSets. When the unit was killed, it drops no loot. Only when it was stunted, then the loot it carries was dropped. Is this an intended feature that the unit dropped no loot unless it is stunted?
Title: Re: Unit using builtInWeaponSets dropped no loot when dies. Intended feature or bug?
Post by: Solarius Scorch on February 04, 2021, 03:48:49 pm
No, such weapons should be dropped normally.

Check if they're not marked as built-in weapons.
Title: Re: Unit using builtInWeaponSets dropped no loot when dies. Intended feature or bug?
Post by: LobsterKing on February 04, 2021, 04:58:01 pm
I assume built-in weapons as weapons or items having   

fixedWeapon: true?

I don't have anything like this in the code for my items or weapons that's included within the builtInWeaponSets for my units.
Title: Re: Unit using builtInWeaponSets dropped no loot when dies. Intended feature or bug?
Post by: Solarius Scorch on February 04, 2021, 05:05:43 pm
Can you paste your code? It's hard to think of what could have gone wrong, because anything could have gone wrong. :)
Title: Re: Unit using builtInWeaponSets dropped no loot when dies. Intended feature or bug?
Post by: LobsterKing on February 04, 2021, 05:07:39 pm
Here is a sample of my code.

Code: [Select]
units:
  - type: STR_POLICE_MALE
    race: STR_CIVILIANGROUP
    rank: STR_LIVE_SOLDIER
    stats:
      tu: 45
      stamina: 65
      health: 30
      bravery: 80
      reactions: 40
      firing: 50
      throwing: 50
      strength: 24
      psiStrength: 5
      psiSkill: 0
      melee: 50
    armor: POLICE_MALE_ARMOR
    aggroSound: 951
    moveSound: 952
    deathSound: [41, 42, 43]
    standHeight: 21
    kneelHeight: 14
    value: 30
    intelligence: 4
    energyRecovery: 20
    builtInWeaponSets:
      - - STR_MAGNUM_CLIP
        - STR_MAGNUM  
items:
  - type: STR_MAGNUM
    size: 0.1
    costBuy: 800
    costSell: 600
    requires:
      - STR_MAGNUM
    weight: 2
    bigSprite: 753
    floorSprite: 628
    handSprite: 605
    bulletSprite: 1
    fireSound: 4
    compatibleAmmo:
      - STR_MAGNUM_CLIP
    accuracySnap: 60
    accuracyAimed: 70
    tuSnap: 35
    tuAimed: 60
    aimRange: 6
    snapRange: 3
    battleType: 1
    invWidth: 1
    invHeight: 2
    recoveryPoints: 2
  - type: STR_MAGNUM_CLIP
    size: 0.1
    costBuy: 70
    costSell: 52
    requires:
      - STR_MAGNUM
    weight: 1
    bigSprite: 754
    floorSprite: 629
    hitSound: 22
    hitAnimation: 26
    power: 45
    damageType: 1
    clipSize: 6
    battleType: 2
    armor: 12
    recoveryPoints: 2
alienDeployments:
  - type: STR_SMALL_SCOUT
    data:
      - alienRank: 0
        lowQty: 1
        highQty: 1
        dQty: 1
        percentageOutsideUfo: 50
        itemSets:
          -
            []
          -
            []
          -
            []
    width: 90
    length: 90
    height: 9
alienRaces:
  - id: STR_CIVILIANGROUP
    membersRandom:
      - [STR_POLICE_MALE]

There is a strong and specific reason that I did not include any weapons in the itemset for the small scout's alien deployment. I strongly wanting to use the unit's builtInWeaponSets to replace the itemset. The primary reason is because I wish to utilize the memberRandom feature in the alienRaces to the fullest, by having a lot of random units with their own builtInWeaponSets.  So I can have unpredictable encounters whenever a small scout is shot down.

My main problem is, if the enemy unit was stunted, all its items were recoverable.  If the unit was killed, all its items are missing but its corpse.
Title: Re: Unit using builtInWeaponSets dropped no loot when dies. Intended feature or bug?
Post by: R1dO on February 04, 2021, 05:37:22 pm
Just to be sure.

While testing you did not accidentally had the "Alien weapons self-destruct" set (see attached screenclip)?
Title: Re: Unit using builtInWeaponSets dropped no loot when dies. Intended feature or bug?
Post by: LobsterKing on February 04, 2021, 05:50:07 pm
I can confirm that option was enable. It is the source of my ills. Thanks for the help everyone.