Author Topic: [Solved] melee unit leeroyJenkins not attacking  (Read 3203 times)

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
[Solved] melee unit leeroyJenkins not attacking
« on: August 24, 2018, 10:56:59 am »
  - type: STR_BRAINSUCKER_TERRORIST
    race: STR_BRAINSUCKER
    rank: STR_LIVE_TERRORIST
    stats:
      tu: 90
      stamina: 140
      health: 20
      bravery: 110
      reactions: 5
      firing: 0
      throwing: 0
      strength: 10
      psiStrength: 100
      psiSkill: 0
      melee: 80
    armor: BRAINSUCKER_ARMOR
    standHeight: 3
    kneelHeight: 3
    floatHeight: 1
    value: 10
    deathSound: 181
    aggroSound: 182
    moveSound: 179
    intelligence: 2
    aggression: 9
    energyRecovery: 50
    livingWeapon: true
    isLeeroyJenkins: true


  - type: BRAINSUCKER_WEAPON
    weight: 3
    bigSprite: -1
    floorSprite: 31
    handSprite: 104
    meleeSound: 180
    clipSize: -1
    power: 110
    strengthApplied: false
    damageType: 7
    accuracyMelee: 100
    tuMelee: 15
    battleType: 3
    fixedWeapon: true
    invWidth: 2
    invHeight: 3
    recover: false
    zombieUnit: STR_ZOMBIE2
    flatRate: true


  - type: STR_BRAINSUCKER_TERRORIST
    size: 0.0
    recover: true
    liveAlien: true
    costSell: 40000


Last time i tried to make a small unit it didn't attack because the attack "origin point" was below the floor. Maybe it's the same problem even though I don't understand why.
I also tried to set  isLeeroyJenkins to false, but it still just wanders around.
« Last Edit: February 11, 2023, 05:40:27 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Re: [OXCE+] melee unit leeroyJenkins not attacking
« Reply #1 on: August 24, 2018, 12:17:25 pm »
You need to make the brainsucker taller.

If a unit is only 3 voxels high, it's shoulders (=firing origin voxel) are at height 0... and when validating melee range, the LOF will hit the target tile's floor before it hits the unit on that tile... resulting in "no LOF"...
...or something like that... I didn't have the patience to trace all attempts to draw a line... in any case, the brainsucker cannot target the units with its attack.

With standHeight=6 I got massacred pretty badly :)
« Last Edit: August 24, 2018, 12:30:08 pm by Meridian »

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: [OXCE+] melee unit leeroyJenkins not attacking
« Reply #2 on: August 24, 2018, 12:26:02 pm »
You need to make the brainsucker taller.

If a unit is only 3 voxels high, it's shoulders (=firing origin voxel) are at height 0... and when validating melee range, the LOF will hit the target tile's floor before it hits the unit on that tile... resulting in "no LOF".

With standHeight=6 I got massacred pretty badly :)
I see. Although 6 seems quite tall for the brainsucker.

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: [OXCE+] melee unit leeroyJenkins not attacking
« Reply #3 on: August 24, 2018, 09:24:01 pm »
It's not really a brainsucker though, since that can't be done right now. It's a squishy little chryssalid.
Anyway the question is solved.