There is a new setting in "units" ruleset.
units:
- type: STR_SECTOID_SOLDIER
pickUpWeaponsMoreActively: -1 # -1 (default) = take global setting, 0 = disabled, 1 = enabled
and 2 global settings:
ai:
pickUpWeaponsMoreActively: false # for aliens, default is false
pickUpWeaponsMoreActivelyCiv: false # for civilians, default is false
There is also an existing attraction attribute on the items:
items:
- type: STR_HEAVY_PLASMA
attraction: 10
- type: STR_HEAVY_PLASMA_CLIP
attraction: 10
When the "pickUpWeaponsMoreActively" is activated, the algorithm removes the following vanilla limitations:
1. aliens can pick up items even if they see an xcom unit
2. aliens can pick up any weapon, not only those dropped during alien turn
3. alien terrorists can pick up items too
Item attraction attribute needs to be higher than 0.
Distance is also considered, the final_attraction = attraction / (distance*2 + 1)
I.e. to pick up items:
- 0 tiles away you need attraction >= 1
- 1 tile away you need attraction >= 3
- 2 tiles away you need attraction >= 5
- 3 tiles away you need attraction >= 7
- etc.
Item with highest final_attraction is chosen.
Note: in vanilla the numbers would need to be even higher, because there was one more check (which is now turned off for units with "pickUpWeaponsMoreActively")... "attraction - (distance*2) > 5" needed to be true
--------------
However, even with these limitations removed, the outcome would barely change, since the AI is mostly in Escape mode when it doesn't have a weapon and it would take at least 2-3 turns to start shooting:
1. one full turn to go to the weapon (even if it's just 1 tile away)
2. one full turn to pick up a weapon and continue escaping
3. one to many turns to reconsider escape strategy to combat strategy and start shooting
So I have changed the AI strategy too (only for units with "pickUpWeaponsMoreActively" activated):
- walking to the weapon doesn't end the alien turn anymore
- picking up a weapon causes alien to reconsider its strategy... and hopefully start shooting instead of running away (not guaranteed)
Feedback welcome.