To perform the team toggle ability on a team with plural entities, try to divide the toggle ability into two parts
Your need is to hold Infantry squad at weapon and use prefer-vehicles ability
1. copy "usf_vehicle_hold_fire_mp"
2. Modify squad_caster => squad
target => tp_squad
3. Remove Override_weapon_target_prereq_action of start_target_actions
4. Add an "upgrade_add" to squad in start_self_actions
"Upgrade_remove" in end_self_actions
5. Add "required_any_in_list"/required_slot_item (the weapon slot_item set to use) in the requirements (if not limited to a specific weapon to use, don't need this item)
6. Put this ability in squad_ability_ext
Then build another ability
1. Create an "aways_on_ability" (can copy "medic_auto_heal")
2. Modify squad_caster => ont_entity
target => tp_entity
3. Remove the content of action_list, and add "Override_weapon_target_prereq_action" to start_target_actions
4. Add"required_any_in_list"/required_active_weapon/hardpoint_name=>hardpoint_01 in requirements
weapon => (the weapon you set to use)
Add required_squad_upgrade(toggle ability upgrade_add)
5. Put this ability in the entity ability_ext of the squad
When the squad uses the toggle ability, it will get an upgrade, and the entity also has required_squad_upgrade and required_active_weapon to perform aways_on_ability
WWII MOD
The infantry squad in this mod is made using the above-mentioned method. With M9 Bazooka, PIAT Launcher, and Panzerschreck, will get a toggle ability, which can restrict these three weapons to target vehicle.
Dividing the toggle ability into two parts can solve the problem of the team losing the toggle ability after Reinforce (for example, the commando squad uses Hold Fire to fail after Reinforce) aways_on_ability will be executed once after Reinforce.
My English is not good, and I may not be able to express it correctly.