Jump to content

[1.12.x] Antenna Helper Adopted: Math your Antenna Range and Signal Strength


linuxgurugamer

Recommended Posts

8 hours ago, pmborg said:

I thought that tweakscale from @Lisias was doing that "automatically" to all antennas by default, actually in pass there are several issues about the re-scaled antennas are a bit overpower... maybe I am missing some important detail about this re-scale issue.

There's no automatic scaling on TweakScale, one needs to provide a receipt to it, so it knowns how and what to scale the thing.

 

1 hour ago, pmborg said:

There are some threads talking about antenna scaling like this for example

That thread happened due KSP 1.8, when a UI widget got mangled on the prefab and broke TweakScale in general, but some parrs from BDB managed to got through without problems and these thread was about what it.

To scale the Antenna Range, you need to change the ModuleDataTransmitter attributes on the part's config.

Link to comment
Share on other sites

11 minutes ago, Lisias said:

There's no automatic scaling on TweakScale, one needs to provide a receipt to it, so it knowns how and what to scale the thing.

 

That thread happened due KSP 1.8, when a UI widget got mangled on the prefab and broke TweakScale in general, but some parrs from BDB managed to got through without problems and these thread was about what it.

To scale the Antenna Range, you need to change the ModuleDataTransmitter attributes on the part's config.

Thankyou for your reply Lisias!

" To scale the Antenna Range, you need to change the ModuleDataTransmitter attributes on the part's config. "

Do you have an example for this?

Until now I just saw this example: "GameData_Notused\Bluedog_DB\Compatibility\Tweakscale\tweakscale_Antennas.cfg"

But don't know yet exactly how it works.

Edited by pmborg
Link to comment
Share on other sites

3 minutes ago, pmborg said:

Do you have an example for this?

Until now I just saw this example: "GameData_Notused\Bluedog_DB\Compatibility\Tweakscale\tweakscale_Antennas.cfg"

This is a receipt for TweakScale. If you are building your own part (as it appears), edit directly the ModuleDataTransmitter section for the part (otherwise you would need TweakScale installed just for using it!). For example, the longAntenna (GameData/Squad/Parts/Utility/commsDish16/commsAntenna16.cfg - Commutron 16) has the following :

Quote

        MODULE
        {
                name = ModuleDataTransmitter
                antennaType = DIRECT
                packetInterval = 0.6
                packetSize = 2
                packetResourceCost = 12.0
                requiredResource = ElectricCharge
                DeployFxModules = 0
                antennaPower = 500000  // <--- HERE !!!
                antennaCombinable = True
                antennaCombinableExponent = 1
        }
 

The config for your Antenna should have something like this. Edit the antennaPower to the value that gives you the result you want.

The Power is given in Range in Meters, as it appears, as the Information Window for this part says its rating is 500K.

Link to comment
Share on other sites

40 minutes ago, Lisias said:

This is a receipt for TweakScale. If you are building your own part (as it appears), edit directly the ModuleDataTransmitter section for the part (otherwise you would need TweakScale installed just for using it!). For example, the longAntenna (GameData/Squad/Parts/Utility/commsDish16/commsAntenna16.cfg - Commutron 16) has the following :

The config for your Antenna should have something like this. Edit the antennaPower to the value that gives you the result you want.

The Power is given in Range in Meters, as it appears, as the Information Window for this part says its rating is 500K.

"otherwise you would need TweakScale installed just for using it! "

I have it installed, and is one of my favorite mods and from all community I think :)

Is possible for TweakScale scale this automatically, without having to create a new antenna cfg file just to scale it to 400% for example?

Like default scale:

antennaPower = 500000  // <--- HERE !!!

TweakScale to 200%:

antennaPower = 500000 x 4  // 200% for example.

 

I was expecting this simple scaling to work, like mentioned in some posts before and checking the updated values with "antenna-helper" mod:

 

Edited by pmborg
Link to comment
Share on other sites

  • 2 weeks later...
2 minutes ago, Tivec said:

@linuxgurugamer There is a compatibility issue with NearFuture Exploration. They replace all ModuleDataTransmitter with ModuleDataTransmitterFeedeable. Do you think it would be possible to add support for this in AntennaHelper?

Not at the present time, I'll have to contact @Nertea about it

5 hours ago, woeller said:

No indication of any dependencies...
... loading KSP...
Antenna Helper is on strike...
@linuxgurugamerWould you please add ClickThroughBlocker and ToolbarControll to the thread to prevent this from happening to others?

done

Link to comment
Share on other sites

Just now, linuxgurugamer said:

Not at the present time, I'll have to contact @Nertea about it

Since ModuleDataTransmitterFeedable is a subtype, would it not be possible to grab derived part types in GetPartList (in AHShipList.cs)? I'm not up to speed on C# coding, but pretty sure you can use Enumerator.OfType<ModuleDataTransmitter> or similar.

Link to comment
Share on other sites

9 minutes ago, Tivec said:

Since ModuleDataTransmitterFeedable is a subtype, would it not be possible to grab derived part types in GetPartList (in AHShipList.cs)? I'm not up to speed on C# coding, but pretty sure you can use Enumerator.OfType<ModuleDataTransmitter> or similar.

I didn't say it couldn't be done. But its time and effort which I  don't  have right now. If someone would do a PR, I'd  be happy to accept it

Link to comment
Share on other sites

17 minutes ago, linuxgurugamer said:

I didn't say it couldn't be done. But its time and effort which I  don't  have right now. If someone would do a PR, I'd  be happy to accept it

I’ll see what I can do :)

Link to comment
Share on other sites

  • 3 weeks later...

@linuxgurugamer So, I've been trying to get this set up for dev, but I am completely unable to get this compiled. 

I keep getting this error:
 

The command "set textTemplatingPath="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\texttransform.exe"

%textTemplatingPath% "S:\Games\Kerbal Space Program\Mod Development\Antenna-Helper\AntennaHelper\AssemblyVersion.tt"" exited with code 1.

Looking at the prebuild and post build settings, the repo also does not contain the deploy and buildRelease batch files. Where do I find those, and what could be the cause for the error above?

Edit: Ok, got it working by forcing it to NOT generate a AssemblyVersion.cs file but rather run the T4 command in the build menu, and then remove all pre-build and post-build stuff.

 

Pull request is up!

Edited by Tivec
Link to comment
Share on other sites

4 hours ago, Tivec said:

@linuxgurugamer So, I've been trying to get this set up for dev, but I am completely unable to get this compiled. 

I keep getting this error:
 


The command "set textTemplatingPath="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\texttransform.exe"

%textTemplatingPath% "S:\Games\Kerbal Space Program\Mod Development\Antenna-Helper\AntennaHelper\AssemblyVersion.tt"" exited with code 1.

Looking at the prebuild and post build settings, the repo also does not contain the deploy and buildRelease batch files. Where do I find those, and what could be the cause for the error above?

Edit: Ok, got it working by forcing it to NOT generate a AssemblyVersion.cs file but rather run the T4 command in the build menu, and then remove all pre-build and post-build stuff.

 

Pull request is up!

I hope you excluded the project file from the pr.  Regardless, I’ll look at it later.

Just so you know, I’m in the process of updating the pre/post build steps in all my mods to make it easier for others to build.  This one has not yet been updated, which is why you had problems

Link to comment
Share on other sites

30 minutes ago, Poodmund said:

Looks interesting, I’ll read it.  But I already have a workflow similar to it for all my mods.  The problem he ran into was that this mod currently has an older build configuration.  My concern about the csproj file is that it is used both to do local development and as a reference for the files to be referenced and compiled on my Jenkins server.

I have my build info documented here: https://github.com/linuxgurugamer/KSP-Build-Scripts

with the exception of my local Jenkins config file.

42 minutes ago, Poodmund said:

Correct me if I’m wrong, but using this seems to require that the mod be compiled outside of this process?  If this is so, then I may be able to use it as an addition to my current process

Link to comment
Share on other sites

15 hours ago, linuxgurugamer said:

Correct me if I’m wrong, but using this seems to require that the mod be compiled outside of this process?  If this is so, then I may be able to use it as an addition to my current process

That is correct, basically it just allows you to create a PR against a branch of your repo and it automatically builds and packages the mod from the files on the repo and deploys it as a github and spacedock release simultaneously. I saw you said that you were still doing spacedock releases by hand so thought this might be of interest.

For reference this build method (and git repo) is from Nertea and is used for all his mods and also ReStock; it allows any authorised contributor on the repo to initialize the build and release process.

Edited by Poodmund
Link to comment
Share on other sites

Question. What controls whether Antenna Helper's UI button is displayed on the in-flight toolbar or not?

I'm having an issue where I have three relay satellites, all using the same antenna configuration and all orbiting Kerbin at a 500x500 altitude, spaced out at roughly 122° relative to each other. Two of them see and talk to each other just fine, but the third refuses to talk to either of the other two, only to the KSC and the other relays in Kerbin's SOI.

The two working satellites both display the Antenna Helper icon on the toolbar, the misbehaving one doesn't. It's not a signal strength issue either because all three Kerbin relays briefly connect to the Mun relays during closest approach and the latter are slightly less powerful. And when I'm having the Tracking Station display signal radius for all three relays, the misbehaving one ignores the other two as relays.

I dug through the persistent.sfs file and ran a diff between the misbehaving relay and other other ones, but there doesn't seem to be anything missing. Just a couple of different values.

Link to comment
Share on other sites

5 hours ago, Fraktal said:

The two working satellites both display the Antenna Helper icon on the toolbar, the misbehaving one doesn't.

This could seem like there's something wrong in loading the mod - would you mind attaching the KSP.log file?

Link to comment
Share on other sites

Found these in the Player.log file, both of them several times:

NullReferenceException: Object reference not set to an instance of an object
  at Part.FindModulesImplementing[T] () [0x00031] in <3e135473f56a45478d738eb041ebd6cb>:0 
  at AntennaHelper.AHShipList.GetPartList () [0x00022] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at AntennaHelper.AHShipList.DoStart () [0x00023] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at AntennaHelper.AHShipList.UpdateLoadedGame () [0x0000a] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at AntennaHelper.AHShipListListener.Start () [0x00000] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at AntennaHelper.AHFlight.SetActiveConnect () [0x001b0] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at AntennaHelper.AHFlight+<StartSecond>c__Iterator0.MoveNext () [0x00132] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00027] in <5aeafee3fea24f37abd1315553f2cfa6>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

The first might be connected to a bug I've had with this mod for a long time, where Antenna Helper stops detecting antennas being removed in the VAB and still including no-longer-present antennas in the range calculations until I load a different vessel. Just yesterday I was fiddling with this particular relay satellite design I'm having trouble with, consisting of 4 HG-5 antennas in quadruple radial symmetry on an OKTO core. When I removed the four antennas and put on only one, Antenna Helper correctly stated that the craft has 2 antennas of which 1 is combinable. But when I removed this sole antenna, it still stated the same configuration and when I restored the quadruple symmetry, it now said I had 6 antennas with 5 combinable, refusing to remove the missing one until I dumped the current vessel and reloaded the design from a subassembly. I've also seen several times when it just flat-out stops updating the detected antenna configuration until I exit and reenter the VAB.

Link to comment
Share on other sites

On 2/25/2020 at 7:54 AM, Fraktal said:

Found these in the Player.log file, both of them several times:


NullReferenceException: Object reference not set to an instance of an object
  at Part.FindModulesImplementing[T] () [0x00031] in <3e135473f56a45478d738eb041ebd6cb>:0 
  at AntennaHelper.AHShipList.GetPartList () [0x00022] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at AntennaHelper.AHShipList.DoStart () [0x00023] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at AntennaHelper.AHShipList.UpdateLoadedGame () [0x0000a] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at AntennaHelper.AHShipListListener.Start () [0x00000] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at AntennaHelper.AHFlight.SetActiveConnect () [0x001b0] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at AntennaHelper.AHFlight+<StartSecond>c__Iterator0.MoveNext () [0x00132] in <40d5f50e553d4ef7987fc6b0c2f33aa3>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00027] in <5aeafee3fea24f37abd1315553f2cfa6>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

The first might be connected to a bug I've had with this mod for a long time, where Antenna Helper stops detecting antennas being removed in the VAB and still including no-longer-present antennas in the range calculations until I load a different vessel. Just yesterday I was fiddling with this particular relay satellite design I'm having trouble with, consisting of 4 HG-5 antennas in quadruple radial symmetry on an OKTO core. When I removed the four antennas and put on only one, Antenna Helper correctly stated that the craft has 2 antennas of which 1 is combinable. But when I removed this sole antenna, it still stated the same configuration and when I restored the quadruple symmetry, it now said I had 6 antennas with 5 combinable, refusing to remove the missing one until I dumped the current vessel and reloaded the design from a subassembly. I've also seen several times when it just flat-out stops updating the detected antenna configuration until I exit and reenter the VAB.

Ummm, it would be helpful to have a log file.  Also, if the save file doesn't use too many mods, a copy of that would also be helpful

20 minutes ago, Probus said:

Has this always had the color circles in map mode?

As far as I know. is there a problem?

Link to comment
Share on other sites

43 minutes ago, Probus said:

Has this always had the color circles in map mode?

21 minutes ago, linuxgurugamer said:

As far as I know. is there a problem?

No problem.  It's great!  I don't remember it being there before, way back when.

 

Link to comment
Share on other sites

Just a minor heads up, but this one is showing as incompatible to my 1.9.1 on CKAN.

It seems to be something about how CKAN checks for compatibility, as it does say "any" for max version.

Ninja edit: (it shows as compatible with 1.9 but not 1.9.1)

Edited by luizsilveira
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...