Jump to content

[1.12.x] Aviation Lights v4.1.3 (29 January 2023) - available for adoption


MOARdV

Recommended Posts

Hi,

 

The red beacon seems to be a little broken, when trying to put one on a ship, the game spam dozens of beacons everywhere the mouse pass by :o

 

The other lights works fine thoug ;) (didn't test the amber beacon yet)

Link to comment
Share on other sites

Mmmm, didn't find any log_output in my KSP_x64_data folder. Weird. (for the other question, the mod was installer with CKAN so I believe it's up-to-date and correctly installed)

 

I'll try to look tomorrow in the Alt-F12 menu log.

Link to comment
Share on other sites

  • 3 weeks later...

I often make very large craft, and would like to tweakscale these things.. i figured it out once on my own and made an MM patch to do this, but I can't remember how I did it, and I lost my computer in a house fire, so I have no frame of reference.  would it maybe make sense to add tweakscale support by default?  If not, can someone please tell me the correct way to write an MM patch for this because I can't seem to remember it now :( 

 

thanks

Link to comment
Share on other sites

8 hours ago, ss8913 said:

would it maybe make sense to add tweakscale support by default? 

I don't use tweakscale, so I can't help with writing the patch.  If someone has a patch they're willing to share, I can include it in the next AL release (whenever that is).

Speaking of which, I've thought about changing the editor PAW for Aviation Lights.  Here's what it looks like for the configurable light:

pnyUw2.jpg

Here's what it'd look like instead:

4XuYdS.png

I'd replace the four Toggle buttons and the caption with a selector below Color Preset, and keep a single Toggle button that updates when you change modes - if you change Light Mode to Double Flash, the button changes to Toggle Double Flash, for example.

I'm not sure what to do with the Action Groups panel, though.  It currently looks like this:

URTv5a.jpg

Do I simplify this to "Toggle Light", "Turn Light On", and "Turn Light Off", where the Light Mode in the PAW decides what those actions do?  Or do people use more than one mode in the Action Groups?

The primary motivation for simplifying this is that it also allows me to make "Toggle Light" default to the Lights action group, and the toggle will use whatever mode the light is in.  If I keep all of the AG options, I need to add at least one more option to toggle the currently-selected Light Mode, and another option to activate it, and I need to come up with short names that make sense.

Link to comment
Share on other sites

@MOARdV I figured out the tweakscale patch.  In your 'patches' directory in the mod's folder, make a file like AviationLightsTweakScale.cfg, with the following contents.  This will allow precision scaling to any % value of the original size of the part.  Great for larger space stations!  It causes no issues with functionality or compatibility that I have yet found.  The below is MM code so if people do not have tweakscale installed it should just get ignored.

@PART[light_aviation] // aviation light
{
    %MODULE[TweakScale]
    {
        type = free
    }
}

 

Link to comment
Share on other sites

1 hour ago, ss8913 said:

@MOARdV I figured out the tweakscale patch.  In your 'patches' directory in the mod's folder, make a file like AviationLightsTweakScale.cfg, with the following contents.  This will allow precision scaling to any % value of the original size of the part.  Great for larger space stations!  It causes no issues with functionality or compatibility that I have yet found.  The below is MM code so if people do not have tweakscale installed it should just get ignored.


@PART[light_aviation] // aviation light
{
    %MODULE[TweakScale]
    {
        type = free
    }
}

 

I would do it a bit different:

@PART[light_aviation] // aviation light
{
    %MODULE[TweakScale]:NEEDS[TweakScale]
    {
        %type = free
    }
}

The :NEEDS would apply the patch only when TweakScale is installed, otherwise the patch is ignored. This avoids cluttering the GameDatabase with useless information. Also, it's better to use "%" on the value name you are editing. If by some reason someone else has patched this part and you add a value without the "%", a new entry with the same value name is added and you will have a double entry, and this will triggers a "Houston" on the TweakScale Sanity Checks.

Alternatively, if @MOARdV decides to add the patch on his Add'On as default, I would do what follows instead:

@PART[light_aviation]:FOR[AviationLights] // aviation light
{
    %MODULE[TweakScale]:NEEDS[TweakScale]
    {
        type = free
    }
}

Now, doesn't matter too much using the "%" on the value name. When you use :FOR you are saying "This patch belongs to AviationLights, and it's a default patch for it". Now it's up to everybody else to prevent double patching the part, as MOARDV had defined what he thinks is the standard for this part.

Technically, this is all I have to say about the patch. What follows below is not a TweakScale "official" recommendation. :) 

From a personal point of view, I find "free scaling" cumbersome for some parts, as I end using them most of the time on a very strict set of sizes. So perhaps a SCALETYPE would be a better way? You are not locked into a preset value from the Scale Type, you can select intermediary scales the same way - but you would also have some most commonly used presets to make your life easier on the day to day building.

Also note that "type = free" make no change on the luminosity. You would need a new TWEAKSCALEBEHAVIOUR to teach TweakScale to make the light stronger or dimmer while scaling - not to mention the Electrical Power consumption.

Link to comment
Share on other sites

On 8/31/2019 at 5:45 AM, MOARdV said:

I don't use tweakscale, so I can't help with writing the patch.  If someone has a patch they're willing to share, I can include it in the next AL release (whenever that is).

Speaking of which, I've thought about changing the editor PAW for Aviation Lights.  Here's what it looks like for the configurable light:

pnyUw2.jpg

Here's what it'd look like instead:

4XuYdS.png

I'd replace the four Toggle buttons and the caption with a selector below Color Preset, and keep a single Toggle button that updates when you change modes - if you change Light Mode to Double Flash, the button changes to Toggle Double Flash, for example.

I'm not sure what to do with the Action Groups panel, though.  It currently looks like this:

URTv5a.jpg

Do I simplify this to "Toggle Light", "Turn Light On", and "Turn Light Off", where the Light Mode in the PAW decides what those actions do?  Or do people use more than one mode in the Action Groups?

The primary motivation for simplifying this is that it also allows me to make "Toggle Light" default to the Lights action group, and the toggle will use whatever mode the light is in.  If I keep all of the AG options, I need to add at least one more option to toggle the currently-selected Light Mode, and another option to activate it, and I need to come up with short names that make sense.

 

I like the proposed PAW a lot better. It's much cleaner and easier to understand. The current buttons aren't very clear (I can't simply look at the window and see how the light is configured to behave).

I like the idea of being able to change the light mode via an AG, but would it be possible to simplify the list a bit to:

  • On
  • Off
  • Toggle On/Off
  • Steady Mode
  • Flash Mode
  • Double-Flash Mode
  • Interval Mode

I think that would cover all AG setup cases.

*   *   *

Also, if I may, a feature request:

Any chance of a mode that produces an extremely narrow spot, like only a degree or two wide (maybe configurable)? I'd love something that allows me to better align the claw with where it's going to grab an object, such as the irregular surface of an asteroid. i.e., it would basically mimic a laser sight.

Thanks.

Link to comment
Share on other sites

3 hours ago, BlueLineSwinger said:

Also, if I may, a feature request:

Any chance of a mode that produces an extremely narrow spot, like only a degree or two wide (maybe configurable)? I'd love something that allows me to better align the claw with where it's going to grab an object, such as the irregular surface of an asteroid. i.e., it would basically mimic a laser sight.

I think using MM to create a "docking spot" might be a better approach - I don't think a specialized mode is quite in the spirit of the Aviation Lights mod.  For that matter, you could use MM to add an Aviation Lights module to docking ports, and set it up with a narrow spot cone - that saves the trouble of adding a separate part.

I think this would add the docking spot light using the current aviation light model, with a spot angle narrowed to 1.5 degrees (I haven't tested it).

+PART[light_aviation]
{
	@name = docking_light
	@title = Docking Spotlight
	@description = Narrow-width spotlight for docking port alignment.


	@MODULE[ModuleNavLight]
	{
		@SpotAngle = 1.5
	}
}

 

Link to comment
Share on other sites

12 hours ago, MOARdV said:

I think using MM to create a "docking spot" might be a better approach - I don't think a specialized mode is quite in the spirit of the Aviation Lights mod.  For that matter, you could use MM to add an Aviation Lights module to docking ports, and set it up with a narrow spot cone - that saves the trouble of adding a separate part.

I think this would add the docking spot light using the current aviation light model, with a spot angle narrowed to 1.5 degrees (I haven't tested it).


+PART[light_aviation]
{
	@name = docking_light
	@title = Docking Spotlight
	@description = Narrow-width spotlight for docking port alignment.


	@MODULE[ModuleNavLight]
	{
		@SpotAngle = 1.5
	}
}

 

Thanks, I'll give that a shot. I've not played with custom MM configs before so I'll have to read up on that.

Link to comment
Share on other sites

1 hour ago, BlueLineSwinger said:

Thanks, I'll give that a shot. I've not played with custom MM configs before so I'll have to read up on that.

Just copy everything from +PART down to the last line (with the last bracket), open Notepad or any text editor, paste, save the file with any name you want (AviationLights_dockingport) or something descriptive, add .cfg at the end of the name, and click save... save anywhere in the /GameData folder, or any subfolder...
Thats it.

Link to comment
Share on other sites

On 9/3/2019 at 5:29 AM, MOARdV said:

I think using MM to create a "docking spot" might be a better approach - I don't think a specialized mode is quite in the spirit of the Aviation Lights mod.  For that matter, you could use MM to add an Aviation Lights module to docking ports, and set it up with a narrow spot cone - that saves the trouble of adding a separate part.

I think this would add the docking spot light using the current aviation light model, with a spot angle narrowed to 1.5 degrees (I haven't tested it).


+PART[light_aviation]
{
	@name = docking_light
	@title = Docking Spotlight
	@description = Narrow-width spotlight for docking port alignment.


	@MODULE[ModuleNavLight]
	{
		@SpotAngle = 1.5
	}
}

 

 

So this actually works out fairly well. Since the light tends to shine through most parts I was able to hide it dead-center behind the Claw. Very helpful for figuring out where to grab an asteroid.

Images:

Spoiler

The laser spot trained onto the dark side of an asteroid to be captured, with a bit of white light from other forward-facing lights. Red color preset, 50 m reach, 8 intensity (i.e., maxed out):

8cBEiUF.png

 

A little closer, and from a different angle. This is a terrible place to try and grab hold of the rock:4VyBPsg.png

 

A much better spot to grab on to. This close, the dot gets a little too small and a bit washed out from the other forward lights, a wider angle (currently at 1°) might work better:

7I4YDoc.png

 

*   *   *

I completely get not wanting to add a second part just for such a limited application. However, if there's a chance of adding a (advanced tweakable) slider to the PAW to adjust the angle of the spot, that would work great too were you so inclined.

Thanks again.

Edited by BlueLineSwinger
Link to comment
Share on other sites

So, continuing with this, I stumbled upon an issue that you may want to be aware of (since this is due to a MM-altered part, I'm not really looking for support or a fix).

Playing around with the laser spots I'd configured, I figured a small array on the front of the vessel, configured somewhat like crosshairs, would be useful. However, I discovered there seems to be a hard limit of eight. Otherwise, something goes goofy and they seem to lose their focus.

Images taken using a test craft I made to verify it wasn't some other part (normal Aviation Lights or otherwise) that were conflicting:

Spoiler

The face of the craft, with nine spots (1 deg. focus, 50 m range, 8 brightness). Nothing seemingly complicated:hmcAxZn.png

 

Note how the spots illuminate the entire face of what they're pointing at. The spots themselves are flickering some, which is why a couple seem to be missing in this pic:dzdMNzR.png

 

Manually turning off any one or more (bringing the number to eight or fewer), and things look correct:28UwF2P.png

8N9xzqd.png

(craft is somewhat closer in the second pic here, hence the brighter/smaller dots.)

There are no other lights on this craft, Aviation Lights mod or otherwise, though that doesn't seem to be a factor as the craft I first found this issue on has a number of the Aviation Lights and the limit of eight spots stands. Color, intensity, range, angle, or positioning of the modified lights don't appear to be a factors either. It also doesn't matter what they're pointing at, as the same thing happens on the launch pad as well.

Anyways, not a big deal, just thought you should know. Thanks.

Link to comment
Share on other sites

7 hours ago, BlueLineSwinger said:

However, I discovered there seems to be a hard limit of eight. Otherwise, something goes goofy and they seem to lose their focus.

If you want to use more lights, you need to adjust the setting in KSP's Settings menu.  IIRC , 8 is the default maximum number of pixel lights in KSP.

Link to comment
Share on other sites

On 9/9/2019 at 5:10 AM, MOARdV said:

If you want to use more lights, you need to adjust the setting in KSP's Settings menu.  IIRC , 8 is the default maximum number of pixel lights in KSP.

Yep, that works, thanks.

Though it's interesting (at least to me, not being so well versed in the intricacies of Unity and KSP modding) that the presence/absence of the standard Aviation Lights on the craft seemed irrelevant.

Link to comment
Share on other sites

@MOARdV, I've been using these lights a lot lately due to their flexibility (and lack of many other good options for light mods these days) and because I love good, well placed lighting on spacecraft. However, I recently noticed when trying to place them on spaceplanes, that the basic, very flexible aviation light (Light, Aviation) has a max temperature of 1400, where as all the others have a max temperature of 3200. Would you be able to make the Light, Aviation also have a max temperature of 3200?

Link to comment
Share on other sites

14 hours ago, AmpCat said:

@MOARdV, I've been using these lights a lot lately due to their flexibility (and lack of many other good options for light mods these days) and because I love good, well placed lighting on spacecraft. However, I recently noticed when trying to place them on spaceplanes, that the basic, very flexible aviation light (Light, Aviation) has a max temperature of 1400, where as all the others have a max temperature of 3200. Would you be able to make the Light, Aviation also have a max temperature of 3200?

Sure, I'll raise it for the next release.  I normally use them on the first stage of launchers as warning beacons, so they never get exposed to reentry / high speed airflow conditions.

Link to comment
Share on other sites

Thanks! I like them because invariably I end up having to land or do a docking maneuver on the night side of an object, so I need to see. And your lights allow me to tune lighting for being splash lighting against the hull, or spotlights to illuminate docking targets or the ground. And, good lighting looks pretty epic when you have proper dark shadows in space. :)

Edit: Oh, and despite yours and other people's help, I never was able to properly integrate your lighting options in with stock or other light mods. At this point I'll wait to dig deeper into learning modding for KSP 2.

Edited by AmpCat
Link to comment
Share on other sites

  • 4 weeks later...

So, KSP 1.8.0 happened today.

Over on Github, I've posted Aviation Lights 4.1.0, which is recompiled for KSP 1.8.x / .NET 4.0.  It includes the editor PAW changes I posted a couple of months ago.

Currently, I don't plan on releasing future updates for Aviation Lights - I've got other things I need to spend my spare time on, and I honestly don't know what else this mods needs besides some localization files.

Link to comment
Share on other sites

  • 2 weeks later...

There are changes to the lights since 1.8.1 for some reason. I have all the lights set in the VAB to solid on. Once in  space after I turn the vehicle lights on via "U" key, the vehicle and docking LED lights go on but all the lights I had set go off and I have manually turn them all back on one by one. It's never done that before.

 

Unrelated to this but I have the weirdest issue now since 1.8.1. When my ship in on the launch pad, there is a small purple square underneath the ship sticking halfway in the ground and half up. When I launch I can see the small purple square still sitting on the ground. Once I get into space, the purple square appears again sticking out of the command module docking port. It stays there on the entire trip to the Mun and as I am coming in for landing, at a certain altitude the purple square just separates from the craft and appears to hurtle back into orbit.  Purple square is then gone as long as I'm on the Mun but once I blast off back into space, sure enough it reappears again sticking back out the command module. Needless to say this sucks.

Edited by MikeO89
Link to comment
Share on other sites

9 hours ago, MikeO89 said:

Once in  space after I turn the vehicle lights on via "U" key, the vehicle and docking LED lights go on but all the lights I had set go off and I have manually turn them all back on one by one. It's never done that before.

One feature request I've seen several times over the last couple of years was a way to tie Aviation Lights to the Lights action group by default.  This last release (4.1.0) includes that feature, although I forgot to mention that in the release note.  Check in the VAB that the Aviation Lights aren't in your Lights action group.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 1 month later...
On 8/11/2019 at 7:23 PM, Cassin said:

Hi,

 

The red beacon seems to be a little broken, when trying to put one on a ship, the game spam dozens of beacons everywhere the mouse pass by :o

 

The other lights works fine thoug ;) (didn't test the amber beacon yet)

I had this issue last night on 1.8.1, didn't catch the log file simply because I have a heavily modded instance and the logs have some errors and null references related to other mods but the game works fine so I assume other mod developers know what they are doing. But the aviation light (red one with black outshell) spams like crazy when you try to put one on the ship ! I didn't try other ones and just removed them one by one manually, closed the game and uninstalled the mod :( this was always one of my must have mods, not sure why it behaves like this now.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...