This is off-topic, but may be interesting to some:
Context: I got my AI to lay mines by tricking them into thinking that it's an MG bunker of sorts. This way, they will lay mines in somewhat strategic locations and around their emplacements. The AI loves MG buildings, so attaching a dummy MG to any building or object will result in them constructing that asap.
BTW your suggestion for coaxing the AI to use mines with MG42 works, although if you do that somehow the mines doesn't explode at all even if I change the weapon. I solved by spawning another mine that explodes and not deleting the original MG42-laden mine so the AI doesn't try to constantly build mines.
Good to hear that you got it to work. My AI mine actually works without spawning another set.
The mine starts out with 2 hardpoints:
1. hardpoint: dummy_mg
2. hardpoint: teller_mine_mp
I added a change_weapon action in the mine's on_construction_actions that changes hardpoint 1 to the teller_mine_mp weapon (or whatever mine "weapon" you want).
Then, with a delay action of 0,01, I remove_weapon the hardpoint 2 with fire_and_forget=true.
Happy to elaborate further, maybe even in a dedicated thread.