Creating the files:
1. Clone ebps\races\west_german\buildings\base_building\heavy_armor_support_mp (or any from the three 3 HQ's)
2. Clone ebps\environment\art_ambient\objects\vehicles\wrecked_vehicles\wrecked_halftrack_sws, give it a different name!
3. Clone abilities\british\timed_ability\uec_self_repair, also give this a different name!
The ability
Open the file from step 3, the new ability.
4. Remove everything from action_list/start_self_actions and action_list/start_end_actions
5. Add spawn_entity_action in start_self_actions:
Set the following values:
duration to 0
permanent to true
player_owned to true
select in entity_blueprint the new wreck from step 2.
6. Also add a delay in start_self_actions and add make_death in the delayed_actions. Set destroy and ignore_invulnerability to true.
7. Remove everything from requirements
The Battlegroup HQ building
Open the file from step 1, the hq entity.
8. Add the new ability from step 3 in ebps/ability_ext/abilities.
The wreck
Open the file from step 2, the new wreck.
9. Add a heal_action in action_apply. Set amount to 150 (equal health_ext/hitpoints)
10. Change in health_ext/rebuild_entity to attributes\ebps\races\west_german\vehicles\sws_halftrack\sws_halftrack_mp and set keep_wreck_ownership to true.
This feature does have a design challenge. Do you have to pay the full price again to re-setup? I chose to make three separate trucks in my mod and tied the construction costs of the building to the sws trucks. Then setup/re-setup is always free.
Good luck!