Jump to content

[0.23] Targetron - Target or command vessel from a list of active flights!


Jarcikon

Recommended Posts

Great plugin! I just released v1.3.1 which adds support.

Nice! I've added it to my list of supporting plugins.

Edit: Just a minor nitpick on your code: You don't need to set a visibility for GameScenes.FLIGHT since Targetron is running during the flight scene only. And since you are destroying the toolbar button when your plugin is destroyed, you can just go without explicitly setting a visibility. It doesn't hurt, but it's also not necessary.

Edited by blizzy78
Link to comment
Share on other sites

Great Mod, use it all the time... :)

Kinda wish there was a way to hi-light the different docking ports on the target tho, having a list of ports and not knowing which one is which kinda starts getting a little confusing.. - pity you can't have the docking port light up when you select it via the mod so you can see which one it is :)

Kerbal Crew Manifest can do it when you transfer crom from one part to another. Perhaps the same can be done here when targeting a docking port.

I actually do this in Ship Manifest, which is based on Crew manifest. Crew manifest experiences an issue where a highlighted part will become "de-highlighted" after you mouse over it and move away. So, I also added mouse exit event handlers to deal with mouse overs in the scene, so that parts don't end up de-highlighted. very clean and very visual. easy to find parts that way, especially on space stations.

Docking port illumination would indeed be a very nice feature.

Edited by Papa_Joe
Link to comment
Share on other sites

Nice! I've added it to my list of supporting plugins.

Edit: Just a minor nitpick on your code: You don't need to set a visibility for GameScenes.FLIGHT since Targetron is running during the flight scene only. And since you are destroying the toolbar button when your plugin is destroyed, you can just go without explicitly setting a visibility. It doesn't hurt, but it's also not necessary.

Thanks blizzy! I tried removing it but found it stays visible after I leave flight mode. It looks like [KSPAddon(KSPAddon.Startup.Flight, false)] only affects when the plugin is started. It isn't getting destroyed until the game is exited. Not sure if I'm missing something or if that is the intended behavior.

I actually do this in Ship Manifest, which is based on Crew manifest. Crew manifest experiences an issue where a highlighted part will become "de-highlighted" after you mouse over it and move away. So, I also added mouse exit event handlers to deal with mouse overs in the scene, so that parts don't end up de-highlighted. very clean and very visual. easy to find parts that way, especially on space stations.

Docking port illumination would indeed be a very nice feature.

Actually I just added this in the last major release. If you right click a listing that is in range (< 200m) and mouse over a listed docking port, the actual port will highlight red. At this point I don't have a problem with de-highlighting since it doesn't stay highlighted, but I plan to have any targeted docking ports highlight another color at some point. I'll check out Ship Manifest and see how you did it.

Link to comment
Share on other sites

Targetron GUI window seems to be open every time I launch something, even of I close it out to go in toolbar. I don't know if that is the way it was meant to be.

That was not the intended behavior, more an oversight on my part. I just released version 1.3.3 to fix this. It should now save the toggle state properly. Thanks!

Link to comment
Share on other sites

There is a problem with 1.3.3. If I close out Targetron GUI it will show in Toolbar like normal, even when I set out another flight. Problem is when I close out game and come back to play game, Targetron icon in Toolbar is gone.

I'm using the latest Toolbar 1.3.0

Thanks again. I'll get it right one of these times! Version 1.3.4 should fix this.

Link to comment
Share on other sites

Targetron 1.3.4 seems to spam the output_log with the following:

InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1+Enumerator[Targetron.Target].VerifyState () [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1+Enumerator[Targetron.Target].MoveNext () [0x00000] in <filename unknown>:0

at Targetron.Targetron.Update () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

Link to comment
Share on other sites

Targetron 1.3.4 seems to spam the output_log with the following:

InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1+Enumerator[Targetron.Target].VerifyState () [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1+Enumerator[Targetron.Target].MoveNext () [0x00000] in <filename unknown>:0

at Targetron.Targetron.Update () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

I've been seeing this message on occasion ever since KSP updated to 0.23. I seem to only get it two or three times in a row then nothing. I'll do some more investigating and see if I can find what triggers it.

Link to comment
Share on other sites

In Targetron.Update(), you're doing this:


foreach (Target t in targets)
{
if (!FlightGlobals.fetch.vessels.Contains(t.vessel) || t.vessel.Equals(FlightGlobals.fetch.activeVessel))
targets.Remove(t);
}

Never modify a list you are iterating over at the same time.

Blizzy, you are the man! I assumed as long as I don't try to access "t" after removing I would be fine. Learn something new every day

Link to comment
Share on other sites

  • 3 weeks later...

Another feature request: Celestial bodies. Would make life much easier when you know the launch window and transfer angle and just want to burn manually or are running MJ and want to quickly set up a burn without having to switch to map; wait for render; select target; swap back to flight; wait for render; wait for physics load; select correct MJ setting; hope you aren't clicking too fast that it unfocuses the planet or moon you're attempting to transfer to and have to re-do the whole thing.

Link to comment
Share on other sites

Feature Request: 'Focus' Button

Would it be possible to get a 3rd button next to 'target' and 'control' that focuses the map view on the craft in question?

Sounds like a good idea, but I'm not sure if/how this can be done. I'll do some investigating. Anyone know of any mods that currently do something like this?

Another feature request: Celestial bodies. Would make life much easier when you know the launch window and transfer angle and just want to burn manually or are running MJ and want to quickly set up a burn without having to switch to map; wait for render; select target; swap back to flight; wait for render; wait for physics load; select correct MJ setting; hope you aren't clicking too fast that it unfocuses the planet or moon you're attempting to transfer to and have to re-do the whole thing.

Another good idea. I can add a new filter type for celestials, or one for planets/one for moons. I'll work on this for the next major release.

Link to comment
Share on other sites

Sounds like a good idea, but I'm not sure if/how this can be done. I'll do some investigating. Anyone know of any mods that currently do something like this?

I read Cilph had managed to switch focus to change dish configuration on other crafts in map view in the latest RemoteTech2 version.

Link to comment
Share on other sites

Personally I wish there was an option to set the Map view to hide every other object EXCEPT the active vessel and the target. I'm about 4-1/2 years into my current Career Save and I have far too many objects (tugs, stations, several interplanetary vessels that have returned and parked for possible re-use) in LKO. Now, I will almost certainly do a few things differently when 0.24 comes and I start over, but for now, it can be a real pain to keep situational awareness through the Map for a rendezvous when the Map is crowded.

Link to comment
Share on other sites

  • 1 month later...

Is this still alive?

The last reply to this thread was in January and a bug in 1.3.4 hasn't been fixed as of yet.

I'd like to play around with the code a bit, maybe even put it up on github, but there is no license for the image assets. Can these be redistributed together with modified source? (@Jarcikon: If you haven't thought of a license, might I suggest CC-BY-SA?)

Minor nitpick: The phrase "Source code is free to use for non-commercial purposes under GPL3." means that the code is in fact not GPL3, but actually a custom license based on the GPL ("modified GPL"), since the GPL itself allows no further restrictions.

While it is your right as the original author to state any license terms you want, this probably wasn't your intention.

Also, this restriction is in all likelihood invalid since you combined your plugin with todacious' ToolbarWrapper which essentially puts the whole project under "pure" GPL3 anyways. (If you're curious pay special attention to section 7 and section 10 of the GPL3 :))

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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...