I have to 'find' all these variables first...that's the hardest part! I like the idea but whether can be implemented or not depends on whether I can find all the variables needed
In the meantime I have a magnetic detonator defect check coded in. When the player launches the torpedo I added a hook into the torpedo initialization routine that will check for magnetic detonator defect. The current defect rate is set at 10%. This defect is a failure of the magnetic detonator to detect at the range specified. So if the game determines that this torpedo has a defect it will get a random number, scale it to between 0.0 and 1.0, and multiply that scaled random number by the magnetic detonator range specified in the torpedo .sim. This new value will be the torpedo's new magnetic detonator range