Jump to content

[1.12.x] IndicatorLights v1.8.3: Small, convenient, informative.


Snark

Recommended Posts

Sorry Folks for 2 boring Questions. I just found this mod and I'm wondering, if I can deactivate each LED i would (not just the one in the OP Pictures). And is there somme issues if I try install this on a running career game and then uninstall it again (will it "block" my builded Vessels withit?)

Mayby someone can answer? Thanks a lot and yes english isn't my native language :blush:

Link to comment
Share on other sites

On 4/13/2020 at 9:55 AM, releansol said:

And is there some issues if I try install this on a running career game and then uninstall it again (will it "block" my builded Vessels with it?)

If you used the extra "BL-01 Indicator Light" part in one of your builds, you'll have to re-save the vessel before launch without this part before you can launch it (I had this once with Kopernicus solar panels). Otherwise, you should be fine.

Link to comment
Share on other sites

  • 4 weeks later...

Would it be possible to add capability to fade in and out an emissive texture map, instead of just changing the emissive colour?

Edit: Actually this should work already by having a grey-scale emmisive texture, and the emmisive colour would multiply that for intensity, right?

Edited by Rodger
Link to comment
Share on other sites

Ok, so I'm trying to make an indicator for commandstate for an unmanned command probe, but ether I'm doing something dumb, or this isn't going to work? This just made the light flash with the error colours.

    MODULE
	{
        name = ModuleBooleanIndicator
        controllerName = commandstate
        input = ModuleControlState@ModuleCommand(Nominal, PartialProbe)
	activeColor = if(ModuleControlState@ModuleCommand(Nominal), #00FF00, #FFFF00)
        inactiveColor = $Off
    }
    MODULE
	{
        name = ModuleBooleanIndicator
        controllerName = commandhib
        input = hibernation@ModuleCommand
        activeColor = #003399
        inactiveColor = commandstate
        emissiveName = Commandindicator
    }

 

The hibernation part works fine. I've just been looking here https://kerbalspaceprogram.com/api/class_module_command.html and guessing things that might work lol.

If it's not possible with boolean indicators, maybe it would be a nice feature to add, to have different colours for these?

NONE, PARTIAL_UNMANNED, PARTIAL_MANNED, FULL 

Edit: Ok so looking into it some more, I think I'd just need Game state: Vessel.ControlLevel added to Parameterized Toggle.

Edited by Rodger
Link to comment
Share on other sites

  • 2 weeks later...

Hi @Rodger!  Apologies for the delay in responding; IRL has been busy of late.

On 5/17/2020 at 12:13 PM, Rodger said:

Ok, so I'm trying to make an indicator for commandstate for an unmanned command probe, but ether I'm doing something dumb, or this isn't going to work?

Not currently supported.

From reading your example of what you've tried, above, it sounds as though you probably were working from the documentation here:

...specifically, the part where it says,

Quote
  • By field & module name: You can specify any arbitrary boolean field of any PartModule with syntax like this: fieldname@modulename.
    • Example: motorEnabled@ModuleWheelMotor
    • This syntax variant is useful in that it allows you to toggle any boolean field of any PartModule (not just IndicatorLights modules): e.g. stock modules, or even modules from other mods.
    • However, it does have some important limitations to be aware of. It only works on public fields that are annotated as "KSPField". Also, for non-IndicatorLights module, there's no way to distinguish individual modules by name-- only by module type. So if you target someField@ModuleFoo, it will just use the first ModuleFoo that it finds; there's no way to pick "which one" if there happens to be more than one ModuleFoo on the part.
    • See example file ArbitraryFieldInputs.cfg for how to use this syntax.

The thing is, that syntax only works on boolean fields.

It does not work on multi-value (i.e. enum) fields, such as ModuleControlState.  When you try to do this,

Quote

input = ModuleControlState@ModuleCommand(Nominal, PartialProbe)

...that's not going to work, because the ModuleControlState field on ModuleCommand isn't a boolean.  You'll also note that you've tried to tack on some values in parentheses there, which isn't part of this syntax.

So I see what you're trying to do... and it's a reasonable thing to want to be able to do... but it's simply not supported right now.

(So I'll regard this as a feature request.)  ;)

On 5/17/2020 at 12:13 PM, Rodger said:

This just made the light flash with the error colours.

Yep, due to exactly that problem.  Not supported.

Incidentally, something that may be useful to know when you're trying to debug "why isn't this working" type of problems with IndicatorLights:

Any time you see the "error pattern" colors flash... IndicatorLights will always log a specific error saying what it's unhappy about.

So whenever you see those error colors, open up the log (either via the file, or from the Alt+F12 console).  You'll see an IndicatorLights message that hopefully should give you a pretty accurate idea of exactly what's wrong.

On 5/17/2020 at 12:13 PM, Rodger said:

Edit: Ok so looking into it some more, I think I'd just need Game state: Vessel.ControlLevel added to Parameterized Toggle.

That would be one way to do it, yes.  Would need to mull it over.

Link to comment
Share on other sites

@Snark This just occurred to me: solar panel sun-exposure indicator lights. If the panel is exposed to the sun, the light would be green; if it's blocked, the light would be red. Perhaps it could even be more dynamic: the light could be red, amber or green depending on the percentage of sun exposure.

Consider that my feature request :)

Edited by RealKerbal3x
Link to comment
Share on other sites

1 hour ago, RealKerbal3x said:

@Snark This just occurred to me: solar panel sun-exposure indicator lights. If the panel is exposed to the sun, the light would be green; if it's blocked, the light would be red. Perhaps it could even be more dynamic: the light could be red, amber or green depending on the percentage of sun exposure.

Consider that my feature request :)

Thank you, though I think I'd be unlikely to add this-- it just doesn't seem necessary.  If I want to see whether a panel is exposed to the sun, then I just see whether, y'know, the sun is shining on it.  It's right there, it's pretty visible, doesn't seem like it needs an indicator to me.  (Yes, technically speaking it's not 100% certain whether it's "in" or "out" if it's partially shaded, but that's a minor nit and not important in the majority case, so simply not worth bothering about to me.)

Plus, whether any given solar panel is in sunlight or not simply isn't very important for gameplay purposes.  What's important is the overall amount of electricity being produced for the whole vessel... and that's already visible at a glance in the game's UI, so doesn't need any extra help from IndicatorLights, as far as I'm concerned.

(Also, I haven't gone rummaging through all the fields of the modules that are on the solar panel, but I wouldn't be surprised if there's a way to cobble together what you want with config anyway, using parameterized toggle syntax-- e.g. "toggle is on when electricity production is greater than zero", something like that.)

So, my criteria for considering a feature request tend to boil down to,

  • is it actually necessary?  (Or is there already a good way to get that info in-game)
  • is it important for gameplay?
  • could someone do it even without help from me, just using config?
  • ...and of course the really big one is, "would I myself like to have this in my own gameplay" ;)

...and in this case, I think this particular request is zero for four, at least from my perspective.

Thank you for the suggestion, though!

Link to comment
Share on other sites

Haha, yeah I discovered basically all the stuff you said after I first posted that. Thanks for the excellent wiki!

If you do implement adding Vessel.ControlLevel to Parameterized Toggle, I can probably make some patches for stock and restock probe cores. 

Also, I have a little mesh for an LED with a built in glow I could PR if you want:

 bV2j0uA.png

Though it's a little more complicated for people to use, as it's actually two meshes and materials - one with "Emissive/Specular" for a base LED, and a 2nd one with "Alpha/Translucent Additive" for the glow, which uses tint colour. Also only really works on a flat surface.

Link to comment
Share on other sites

  • 3 weeks later...

@Snark Over in Navyfish's Docking Port Alignment Indicator thread there was a discussion going on about how do you know orientation of the ports?  This has bugged me a little bit for a while especially with ReStock, the discussion finally prompted me to do something about it.  It occurred to me that a simple change to IL would fix this issue.  It still turned out to be several hours of trial and error to get everything looking right across stock and ReStock parts.

I created a PR.  Until Snark updates IL or if he reject the PR, they are available on my fork.  

largePort.cfg

mediumPort.cfg

smallPort.cfg

I also have updated the ReStock variants  under the IL Community Extensions mod.

MDScqry.jpg

This photo show how the lights are arranged to show what should be the "UP" orientation for the different docking ports.  The lights form arrows to point "UP" for the default zero roll port orientation. Up being the dorsal side or hatch side of the stock capsules.

CPIWseB.jpg

 

Edited by Tonka Crash
Link to comment
Share on other sites

  • 2 weeks later...

Hi gang,

Well, at (very) long last, it's IndicatorLights v1.7, updated for KSP 1.10 compatibility!

Here's what's new:

magnetometer.png

  • Adds an indicator light to the shiny new magnetometer from KSP 1.10.  :)
  • Fixed a Unity startup bug.  Thanks to @linuxgurugamer for raising the issue (and providing a fix!)
  • Eliminate the CrewIndicatorDefaultStatus config option; it now just defaults to true.
  • Change the default behavior of the crew indicator lights so that they're toggleable only in the editor, to eliminate UI clutter in flight.  (Anyone who doesn't like this can change it back to the way it was via ModuleManager config.)
  • Add a new controlLevel() parameterized syntax for toggles.  See wiki for details.  (Thanks to @Rodger for the feature suggestion!)
  • Update all ModuleManager part patches to correctly use the :FOR[IndicatorLights] syntax.  This should make IL play nicer with MM relative-order directives.
  • Update to ModuleManager 4.1.3

 

(Note that this update does not include @Tonka Crash's cool which-way-is-up patch for the docking ports.  Tonka, that's a neat idea, but I'd prefer to keep that more as an optional sort of thing-- could you please submit it over at IndicatorLights Community Extensions?  I've been horribly remiss keeping that up to date, but expect to be updating it Soon™, and would be happy to include it over there.)

Hope folks enjoy the update, and my apologies I've been so long-- IRL has been pretty busy of late.

Have fun! :)

Link to comment
Share on other sites

7 minutes ago, Snark said:

(Note that this update does not include @Tonka Crash's cool which-way-is-up patch for the docking ports.  Tonka, that's a neat idea, but I'd prefer to keep that more as an optional sort of thing-- could you please submit it over at IndicatorLights Community Extensions?  I've been horribly remiss keeping that up to date, but expect to be updating it Soon™, and would be happy to include it over there.)

I won't be able to restructure and test it for a the Community Extensions until Friday at the earliest.

Link to comment
Share on other sites

On 5/30/2020 at 7:27 AM, Rodger said:

Haha, yeah I discovered basically all the stuff you said after I first posted that. Thanks for the excellent wiki!

If you do implement adding Vessel.ControlLevel to Parameterized Toggle, I can probably make some patches for stock and restock probe cores. 

Also, I have a little mesh for an LED with a built in glow I could PR if you want:

 bV2j0uA.png

Though it's a little more complicated for people to use, as it's actually two meshes and materials - one with "Emissive/Specular" for a base LED, and a 2nd one with "Alpha/Translucent Additive" for the glow, which uses tint colour. Also only really works on a flat surface.

Sorry, I forgot all about this little gem!  @Rodger, feel free to contribute this over at IndicatorLights Community Extensions!

Link to comment
Share on other sites

  • 5 months later...

Thank you for this mod, it is extremely helpful, but it does one additional thing.

It changes the tech tree from vanilla to interstellar. I don't have interstellar installed and i have a lot of empty tech tree nodes with this mod. If i paste it without "ModuleManager.4.1.3.dll" it dosent work, with it - interstelar tech tree.
Maybe its only my problam, but i would be very greatful if you could do somethnig about it.
Thank You

Link to comment
Share on other sites

Hello, and welcome to the forums!  :)

52 minutes ago, PawelP said:

It changes the tech tree from vanilla to interstellar. I don't have interstellar installed and i have a lot of empty tech tree nodes with this mod. If i paste it without "ModuleManager.4.1.3.dll" it dosent work, with it - interstelar tech tree.

Glad you find it useful!

I have no idea what you mean by "interstellar" here, I'm guessing some other mod.  My guess is that this is some issue with your particular installation.

IndicatorLights has zero external dependencies, other than ModuleManager itself-- I haven't included anything from any other mods, and in any case, IndicatorLights contains no code or config to affect the tech tree at all.

So if you're seeing some content from some other mod showing up in the tech tree, then my guess is that you've got some sort of detritus from another mod in your GameData folder, and it's interacting oddly in some way.  My suggestion would be to check your GameData folder carefully, and make sure you have everything installed in the correct place and don't have any leftover files from any mods that you might have uninstalled.

Link to comment
Share on other sites

  • 5 months later...

I added some lights (mk2cockpitinline.cfg):

 

// Adds occupancy indicators to the Mk2 cockpit.

@PART[mk2Cockpit_Inline]:FOR[IndicatorLights] {

	// We have to re-specify the model for the stock part, because this is
	// an older part that uses the "mesh =" syntax in its .cfg file instead
	// of the newer "MODEL" syntax. The "mesh =" syntax doesn't allow having
	// multiple models as part of the same part, which would prevent this mod
	// from adding meshes for the indicator lights.
	MODEL
	{
		model = Squad/Parts/Command/mk2CockpitInline/model
	}

	//-------------------------------------------------------------------------
	// INDICATOR MESHES
	//-------------------------------------------------------------------------

	MODEL
	{
		model = IndicatorLights/Meshes/nubbinLamp
		scale = 0.65, 0.65, 0.5
		position = 0, 0.551, -1.086
		rotation = -10, 180, 0
	}

	MODEL
	{
		model = IndicatorLights/Meshes/nubbinLamp
		scale = 0.65, 0.65, 0.5
		position = 0, 0.471, -1.101
		rotation = -5, 180, 0
	}

	//-------------------------------------------------------------------------
	// CONTROLLABLE EMISSIVES
	//-------------------------------------------------------------------------

	MODULE {
		name = ModuleControllableEmissive
		target = IndicatorLights/Meshes/nubbinLamp:0
		emissiveName = indicator0
	}

	MODULE {
		name = ModuleControllableEmissive
		target = IndicatorLights/Meshes/nubbinLamp:1
		emissiveName = indicator1
	}

	//-------------------------------------------------------------------------
	// CONTROLLERS
	//-------------------------------------------------------------------------

	MODULE {
		name = ModuleCrewIndicatorToggle
		toggleName = indicatorToggle
	}

	MODULE {
		name = ModuleCrewIndicator
	    controllerName = crewController0
		toggleName = indicatorToggle
	}
	
	MODULE {
		name = ModuleCrewIndicator
	    controllerName = crewController1
		toggleName = indicatorToggle
	}

    MODULE
    {
        name = ModuleScienceAvailabilityIndicator
		controllerName = availability0
        experimentID = crewReport
        lowValueColor = crewController0
        mediumValueColor = highValueColor
        highValueColor = blink(lowValueColor, 200, $Off, 200)
    }

    MODULE
    {
        name = ModuleScienceAvailabilityIndicator
		controllerName = availability1
        experimentID = crewReport
        lowValueColor = crewController1
        mediumValueColor = highValueColor
        highValueColor = blink(lowValueColor, 200, $Off, 200)
    }

	MODULE {
		name = ModuleScienceDataIndicator
        experimentID = crewReport
        emissiveName = indicator0
		dataColor = crewController0
		emptyColor = availability0
	}

	MODULE {
		name = ModuleScienceDataIndicator
        experimentID = crewReport
        emissiveName = indicator1
		dataColor = crewController1
		emptyColor = availability1
	}
}

 

Link to comment
Share on other sites

  • 2 weeks later...
16 hours ago, 0Pat said:

In KSP 1.12 this mode breaks couplers making them transparent.

I assume you mean docking ports. ;) 

Known issue, I'm working on it.  Should have a fix Soon™.

Link to comment
Share on other sites

Hi all,

I'm pleased to release IndicatorLights v1.8! :)

No major new features, this is mainly a KSP 1.12 compatibility update.  Here's what's changed:

Enjoy!

Link to comment
Share on other sites

...aaaaand here's one more IndicatorLights release, v1.8.1.

This is a minor release that fixes a bug I just now discovered (caused by a breaking change to KSP), in which the orbital survey scanner's indicator malfunctions and spams endless error messages to the log file.

(Sigh.  Naturally I don't see this until after already releasing 1.8, grumble grumble...)  :huh:

If you're running KSP 1.12, you should update to this version.  Enjoy!

Link to comment
Share on other sites

  • 4 months later...
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...