Perhaps this would be the spot to lay the inevitable groundwork for radios? Create a framework sending packets through different radio frequencies and you can use the PTT on a two-way radio to trigger explosives tuned to the same frequency. I feel like if radios and such are gonna be used for mission environments and common faction interaction, then the radio system could be used as a vehicle for explosives and drones.
Alternately, I believe there is a drone system that works right now. Maybe you could hook your planted explosives into that and you’d use a laptop to trigger them.
I believe you might look at src/enums.h. It’s got a method in there that keeps track of known traps. Seems like it that would be where you’d start to make a map of placed explosives and a function to access their locations. Set a distance on the detonator. If you can match BevapDin’s work with the known traps map, it would be easier to convert when the Z-level issues are straightened out. You’d have to make sure you’re on the same z-level for now, or some other method to make sure the bomb was loaded in the world before it detonates. I guess it is possible to have it detonate off map if you can access the item while it’s unloaded and change it from C4(armed) to C4(active) so that it blows up when the map reloads. The time to detonate would effectively be 1. So it would detonate near-instantaneously.
I recommend making the detonator a weapon mod to the block of C4, dynamite, pipe bomb itself. That way you can have different types of detonators without cluttering up the data files with lots of different recipes and versions of the same explosive. If you add multiple mod slots to your explosives, you can make it so you can have a proximity detonator and a remote detonator an the same explosive. This could also modify the way explosives work currently. You can make a pipe bomb, but now you also need to make a fuse for your explosives. You start with short fuses, combining two short fuses makes a fuse, and two fuses makes a long fuse.
You’d have to change the activation menu to be context sensitive to what’s already attached the explosive. So if a fuse is attached, you’d need a lit fire source to activate the fuse. If the proximity detonator is attached, it will have a prompt to activate it and to set a delay on its proximity sensors’ activation, allowing you to place it and move to safety, or throw the explosive (c4 is pretty stable, it should be safe to throw, adding less-stable explosives, like nitro-glycerin, RDX crystals, is a possibility.) A radio detonator would prompt you to set the frequency of a channel and its tone: Blue, Red, Green, Yellow. This means you can have 4 different chains of explosives on the same frequency and prevents regular radio chatter from detonating the radio. However, people tuned to that radio frequency might hear the tones if the channel were open. Some explosives can’t use the same detonators. C4 can’t use gunpowder timed fuses, and would need a mechanical or digital timed detonator instead.