Author Topic: AI and weapon range/hit chance stats  (Read 8154 times)

Offline Dioxine

  • Commander
  • *****
  • Posts: 5422
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: AI and weapon range/hit chance stats
« Reply #15 on: June 30, 2017, 11:18:09 pm »
You probably could give them weapons that do not have any form of attack but one for switching between distances; for example, give them a longer ranged gun with only aimed shots or snap shots, and beyond ~4 tiles they will prefer that (I think), then a gun with only auto-attack for closer range, which they will prefer under 4 tiles.  Not great for using the looted guns, but this may be the only way to get what you're thinking about without writing more code.

This is highly unlikely to work, I've been through this dance a long time ago when designing AI tanks. If there is no snap shot, the AI reads it as zero or infinity (not sure). It always selects one weapon, and never uses the other, even if it means never firing at all due to other constraints.