Maybe missing some details, It is feasible when I test.
[...]
If slot infantry anti tank weapon, Slot holder only auto attack vehicle.
As shown in my first post, I'm using *not* unit type infantry, because I do want them to still auto-fire on buildings, etc - not just vehicles. To prove that this part works, I used the override_weapon_target_prereq_action directly in the action_apply_ext of Pioneers (applying to all weapons, in other words). This worked in game to completely stop Pioneers from auto-firing on infantry. Therefore, the problem must somehow be with the requirement_action.
Incidentally, why do you have a redundant change_target_action? The target is already an entity. My testing proved that this is unnecessary. You're also using a lot of extra weapon profiles which either don't exist in my mod or are ones that I still want to auto-fire on infantry. Like I said in my first post, this should apply to Panzerschreks, Bazookas and PIAT Launchers (and nothing else).
Anyway, this is what I have (moved to Panzergrenadier now), which still does not work. And again, the override_weapon_target_prereq_action *does* work independently of the requirement_action.
requirement_action
action_table
override_weapon_target_prereq_action
auto_attack_only: true
persist_on_weapon_change: true
requirement_table
required_not
required_unit_type
owned_by_player_only: false
search_load_out: false
unit_type: infantry
check_self: false
fire_and_forget_non_global: false
global_fire_and_forget_on_success: false
instant_requirement_check: false
kill_action_on_failed_requirements: false
no_retrigger: false
requirement_table
required_any_in_list
required_active_weapon
hardpoint_name: hardpoint_01
weapon: ../m9_bazooka_mp
required_active_weapon
hardpoint_name: hardpoint_01
weapon: ../panzerschreck_atw_mp
required_active_weapon
hardpoint_name: hardpoint_01
weapon: ../piat_launcher_mp
validate_all_sub_actions: true
Oh, and Lugie - thanks for trying at least :-)