OpenXcom Forum
Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Meridian on February 05, 2019, 02:10:59 pm
-
requested by luke83
-
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.
-
I really like that, but I've been playng lately to xpiratex 0.99J.11 (oxce 5.2, 21-Jan-2019 experimental build) and enemies did not pick up weapons at all. Maybe in the mod it is disabled?
-
There is a new setting in "units" ruleset.
Since OXCE v6.5, this option applies also to civilian AI, not only to alien AI.
-
So by default civilians inherit a global setting and in order to keep behavior that was before 6.5 I would need to set up `pickUpWeaponsMoreActively: 0` for all civilian units if I don't want them to shoot plasma rifles (even if I can't do that yet)?
-
Yes.
Or change the global setting back to default and only use unit settings.
EDIT: Since OXCE v6.5.1, the original global setting will apply again only to alien AI. Civilian AI will have its own global setting "pickUpWeaponsMoreActivelyCiv".
-
TY! 6.5.0 update would force me to set this option to false (or code that myself, but I'm afraid to go to AI part), as I don't want civilians shooting plasma when I cant (I have alien weapons that humans cant use by lore).