AntennaRange.cfg: Added EVA_MODULE and EVA_RESOURCE definitions for EVA Kerbal transmitters and electric charge, with an MM patch to avoid duplicating ElectricCharge when TACLS is installed.
AntennaRange.cfg: Added EVA_MODULE and EVA_RESOURCE definitions for EVA Kerbal transmitters and electric charge, with an MM patch to avoid duplicating ElectricCharge when TACLS is installed.

--- a/AntennaRange.cfg
+++ b/AntennaRange.cfg
@@ -46,6 +46,16 @@
 		maxPowerFactor = 8
 		maxDataFactor = 4
 	}
+
+	MODULE
+	{
+		name = ModuleScienceContainer
+
+		dataIsCollectable = true
+		dataIsStorable = false
+
+		storageRange = 2
+	}
 }
 
 @PART[mediumDishAntenna]:FOR[AntennaRange]:NEEDS[!RemoteTech2]
@@ -56,6 +66,16 @@
 		nominalRange = 30000000
 		maxPowerFactor = 8
 		maxDataFactor = 4
+	}
+
+	MODULE
+	{
+		name = ModuleScienceContainer
+
+		dataIsCollectable = true
+		dataIsStorable = false
+
+		storageRange = 2
 	}
 }
 
@@ -68,5 +88,42 @@
 		maxPowerFactor = 8
 		maxDataFactor = 4
 	}
+
+	MODULE
+	{
+		name = ModuleScienceContainer
+
+		dataIsCollectable = true
+		dataIsStorable = false
+
+		storageRange = 2
+	}
 }
 
+EVA_MODULE
+{
+	name = ModuleLimitedDataTransmitter
+
+	nominalRange = 5000
+	maxPowerFactor = 8
+	maxDataFactor = 4
+
+	packetInterval = 0.5
+	packetSize = 2
+	packetResourceCost = .1
+
+	requiredResource = ElectricCharge
+}
+
+EVA_RESOURCE
+{
+	name = ElectricCharge
+	amount = 100
+	maxAmount = 100
+}
+
+@EVA_RESOURCE[ElectricCharge]:AFTER[AntennaRange]:NEEDS[TacLifeSupport]
+{
+	!name = DELETE
+}
+

--- a/ModuleLimitedDataTransmitter.cs
+++ b/ModuleLimitedDataTransmitter.cs
@@ -227,32 +227,9 @@
 			this.packetThrottle = 100f;
 		}
 
-		// At least once, when the module starts with a state on the launch pad or later, go find Kerbin.
-		public override void OnStart (StartState state)
-		{
-			base.OnStart (state);
-
-			if (state >= StartState.PreLaunch)
-			{
-				this.relay = new AntennaRelay(this);
-				this.relay.maxTransmitDistance = this.maxTransmitDistance;
-
-				this.UImaxTransmitDistance = Tools.MuMech_ToSI(this.maxTransmitDistance) + "m";
-
-				GameEvents.onPartActionUICreate.Add(this.onPartActionUICreate);
-				GameEvents.onPartActionUIDismiss.Add(this.onPartActionUIDismiss);
-			}
-		}
-
-		// When the module loads, fetch the Squad KSPFields from the base.  This is necessary in part because
-		// overloading packetSize and packetResourceCostinto a property in ModuleLimitedDataTransmitter didn't
-		// work.
-		public override void OnLoad(ConfigNode node)
-		{
-			this.Fields.Load(node);
-			base.Fields.Load(node);
-
-			base.OnLoad (node);
+		public override void OnAwake()
+		{
+			base.OnAwake();
 
 			this._basepacketSize = base.packetSize;
 			this._basepacketResourceCost = base.packetResourceCost;
@@ -273,6 +250,34 @@
 			));
 		}
 
+		// At least once, when the module starts with a state on the launch pad or later, go find Kerbin.
+		public override void OnStart (StartState state)
+		{
+			base.OnStart (state);
+
+			if (state >= StartState.PreLaunch)
+			{
+				this.relay = new AntennaRelay(this);
+				this.relay.maxTransmitDistance = this.maxTransmitDistance;
+
+				this.UImaxTransmitDistance = Tools.MuMech_ToSI(this.maxTransmitDistance) + "m";
+
+				GameEvents.onPartActionUICreate.Add(this.onPartActionUICreate);
+				GameEvents.onPartActionUIDismiss.Add(this.onPartActionUIDismiss);
+			}
+		}
+
+		// When the module loads, fetch the Squad KSPFields from the base.  This is necessary in part because
+		// overloading packetSize and packetResourceCostinto a property in ModuleLimitedDataTransmitter didn't
+		// work.
+		public override void OnLoad(ConfigNode node)
+		{
+			this.Fields.Load(node);
+			base.Fields.Load(node);
+
+			base.OnLoad (node);
+		}
+
 		// Post an error in the communication messages describing the reason transmission has failed.  Currently there
 		// is only one reason for this.
 		protected void PostCannotTransmitError()
@@ -304,8 +309,17 @@
 			}
 			else
 			{
+				double rangeFactor = (this.transmitDistance / this.nominalRange);
+				rangeFactor *= rangeFactor;
+
 				base.packetResourceCost = this._basepacketResourceCost
-					* (float)Math.Pow (this.transmitDistance / this.nominalRange, 2);
+					* (float)rangeFactor;
+
+				Tools.PostDebugMessage(
+					this,
+					"Pretransmit: packet cost set to {0} before throttle (rangeFactor = {1}).",
+					base.packetResourceCost,
+					rangeFactor);
 			}
 
 			base.packetResourceCost *= this.packetThrottle / 100f;
@@ -321,9 +335,18 @@
 			}
 			else
 			{
+				double rangeFactor = (this.nominalRange / this.transmitDistance);
+				rangeFactor *= rangeFactor;
+
 				base.packetSize = Math.Min(
-					this._basepacketSize * (float)Math.Pow (this.nominalRange / this.transmitDistance, 2),
+					this._basepacketSize * (float)rangeFactor,
 					this._basepacketSize * this.maxDataFactor);
+
+				Tools.PostDebugMessage(
+					this,
+					"Pretransmit: packet size set to {0} before throttle (rangeFactor = {1}).",
+					base.packetSize,
+					rangeFactor);
 			}
 
 			base.packetSize *= this.packetThrottle / 100f;
@@ -394,29 +417,55 @@
 			}
 			else
 			{
+				Tools.PostDebugMessage(this, "{0} unable to transmit during TransmitData.", this.part.partInfo.title);
+
+				var logger = Tools.DebugLogger.New(this);
+
 				foreach (ModuleScienceContainer	scienceContainer in this.vessel.getModulesOfType<ModuleScienceContainer>())
 				{
+					logger.AppendFormat("Checking ModuleScienceContainer in {0}\n",
+						scienceContainer.part.partInfo.title);
+
 					if (
 						scienceContainer.capacity != 0 &&
 						scienceContainer.GetScienceCount() >= scienceContainer.capacity
 					)
 					{
+						logger.Append("\tInsufficient capacity, skipping.\n");
 						continue;
 					}
+
+					List<ScienceData> dataStored = new List<ScienceData>();
 
 					foreach (ScienceData data in dataQueue)
 					{
 						if (!scienceContainer.allowRepeatedSubjects && scienceContainer.HasData(data))
 						{
+							logger.Append("\tAlready contains subject and repeated subjects not allowed, skipping.\n");
 							continue;
 						}
 
+						logger.AppendFormat("\tAcceptable, adding data on subject {0}... ", data.subjectID);
 						if (scienceContainer.AddData(data))
 						{
-							dataQueue.Remove(data);
+							logger.Append("done, removing from queue.\n");
+
+							dataStored.Add(data);
 						}
+						#if DEBUG
+						else
+						{
+							logger.Append("failed.\n");
+						}
+						#endif
 					}
-				}
+
+					dataQueue.RemoveAll(i => dataStored.Contains(i));
+
+					logger.AppendFormat("\t{0} data left in queue.", dataQueue.Count);
+				}
+
+				logger.Print();
 
 				if (dataQueue.Count > 0)
 				{
@@ -433,6 +482,8 @@
 					}
 
 					ScreenMessages.PostScreenMessage(msg.ToString(), 4f, ScreenMessageStyle.UPPER_LEFT);
+
+					Tools.PostDebugMessage(msg.ToString());
 				}
 
 				this.PostCannotTransmitError ();

--- a/Properties/AssemblyInfo.cs
+++ b/Properties/AssemblyInfo.cs
@@ -39,7 +39,7 @@
 // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
 // The form "{Major}.{Minor}.*" will automatically update the build and revision,
 // and "{Major}.{Minor}.{Build}.*" will update just the revision.
-[assembly: AssemblyVersion("1.4.3.*")]
+[assembly: AssemblyVersion("1.5.*")]
 // The following attributes are used to specify the signing key for the assembly,
 // if desired. See the Mono documentation for more information about signing.
 //[assembly: AssemblyDelaySign(false)]