I have added an MG42 to the Sd.Kfz. 250, and I want it to be crewed and functional only when a squad is garrisoned. Here's what I did to achieve that so far:
1. In combat_ext, I added a (disabled) MG42 on hardpoint one:
attributes\weapon\axis\small_arms\machine_gun\light_machine_gun\halftrack_250_dummy
(receives_attack_commands set to True. I also edited sdkfz_250.abp to make it actually visible.)
2. In crew_ext, I added another crewman in the second role:
armies\german\soldiers\vehicle_crew\vehicle_crew
(role_name set to Gunner, sync_on_create set to False.)
This gives me a 250 with an uncrewed MG42 and only a driver inside, just like I wanted.
Screenshot
3. In hold_ext/on_loaded_hold_actions, I added two things:
3.1 add_crew_action, crew_name set to Gunner
(To make the second crewman actually appear.)
3.2 change_weapon, weapon set to:
attributes\weapon\west_german\small_arms\machine_gun\light_machine_gun\sdkfz_251_mg42_mp
(To make the MG42 actually functional.)
When I garrison a squad, a second crew member appears, but his position and posture is screwed up. Also, the MG42 doesn't fire at all.
Screenshot
I know that both the gunner and the new weapon work properly on this vehicle when I add them permanently. So it must have something to do with step three, I guess!
Additionally, when I unload the squad, the gunner doesn't disappear like he should.
Screenshot
The description of on_loaded_hold_actions says:
"Actions to execute on the HOLD when there are loadedgarrisoned troops inside These actions are reverted when troops are unloaded"
Does anyone have any experience with this? Did I do something fundamentally wrong or are these attributes just not fully functional?
Any help is greatly appreciated!