Jump to content

[1.2.2] Crew Light : An automatic Light manager [1.0] (12 Jan 2017)


Li0n

Recommended Posts

@Skalou To light a part with ModuleAnimateGeneric I check if "actionGUIName" == "Toggle Lights" or "startEventGUIName" == "Lights On". In your .cfg you call those fields "Toggle Lights Hatch" and "Lights Hatch On" so they aren't seeing as light animation.

You can obviously change those but you'll end up with two buttons labeled "Lights On/Off" in the right click menu, not convenient. Can you make it so there is only one ModuleAnimateGeneric for both hatch and regular light ? I imagine it will also be better for people that don't use my mod so they have one button for both lights. No idea if this doable tho...

On my hand I could (should) use a regex to check if "actionGUIName" contains the word "light", it will solve this problem and probably with others mods that don't spell those fields exactly like in stock part.

Link to comment
Share on other sites

thank you for the fast answer :wink:,

unfortunately i tried to rename these fields to "Toggle Lights"  and "Lights On" /Off, but it doesn't work better, i also tried to to delete the stock model and readd it latter after mine in the module manager patch so my model is the 1st to be read, but not better.

maybe i should recompile the whole part as you said ( i wanted to save RAM and keep  the lowest possible model, and be compatible with other revamp mods too, but having 2 lights is maybe worst than this)

Link to comment
Share on other sites

15 minutes ago, Skalou said:

unfortunately i tried to rename these fields to "Toggle Lights"  and "Lights On" /Off, but it doesn't work better, i also tried to to delete the stock model and readd it latter after mine in the module manager patch so my model is the 1st to be read, but not better.

Just tried and my plugin only toggle one light animation per part. I'll draft a new release tomorrow if I have some time. Until then nothing you can do about it, sorry.

 

21 minutes ago, Skalou said:

maybe i should recompile the whole part as you said ( i wanted to save RAM and keep  the lowest possible model, and be compatible with other revamp mods too, but having 2 lights is maybe worst than this)

Modeling/Animation are the "dark side of the force" to me but maybe B9 Part Switch can help with that ?

Link to comment
Share on other sites

thank's for the advices,

but i shouldn't have any problem with the stock modules, i can build the whole part in 1 model node with a special plugin for blender to catch the stock, it was my choice to do it separately.

and for me Codding is on the other side of the force. :D

Link to comment
Share on other sites

@Skalou I got time now so, here is a new version that can recognize every part with "light" somewhere in theirs actionGUIName's field. It also check for several light per part.

I just quick tested it (obviously :wink: ) so watch for the bees

Link to comment
Share on other sites

v0.7 The Sun Light edition

Thanks to @RealGecko for the idea, the light are now toggled when the sun rises/falls. This will only affect light in a part without crew capacity and not belonging to the light action group.

Hmm... in fact if you try right now it won't work...
By default all lights are assigned to the Light action group so for this function to have any effect you need to remove lights from the action group. You can do it in the editor or in flight with the mod Action Group Extended.

Others change include support for part with multiple light and a better detection of light related animation, to support MK1 Cabin Hatch by @Skalou and probably others too.

I also rewrote the OP to better explain how the different part/light will behave. Now all I need is some videos or gif...

You can grab it on SpaceDock or on GitHub

As always please report any issues/bugs or suggestions :)

Link to comment
Share on other sites

@Li0n Wow, I'm so happy about the lights automation :3 You're my hero.

I remember myself proposing this idea in Smart Parts, but the author vanished and new maintainers never got around to implement it.

You deserve a badge!

meBlcQN.png

@RealGecko many thanks, dude, for coming up with and bringing this idea into the right hands 

Edited by Enceos
Link to comment
Share on other sites

Nice update :wink:

here is some small suggestion to improve it:

- Do not include the source files in the download, most user don't need it: lower  Ec and mits, better for the planet :P

you can check here to be sure:

Quote

3. Source code

All plugins which are made available on the services maintained by Squad that serve the KSP Community must have their source code be made publicly available. This can be achieved by posting it on a public code repository and linking this repository in every location you offer the plugin for download. Including the source code in the download file itself instead of hosting it on a public code repository also satisfies this requirement.

- compatibility with KSP-AVC Add-on Version Checker , i made it in my mods, so i can help you and send you some pull requests on github with everything if you like the idea. :)

Link to comment
Share on other sites

21 minutes ago, Skalou said:

Nice update :wink:

here is some small suggestion to improve it:

- Do not include the source files in the download, most user don't need it: lower  Ec and mits, better for the planet :P

you can check here to be sure:

- compatibility with KSP-AVC Add-on Version Checker , i made it in my mods, so i can help you and send you some pull requests on github with everything if you like the idea. :)

Source files : I bundled them before I made my github account, you're right no point to keep them in the download anymore.

"Ec and mits" : I assume you talking about EC consumption of the lights ? Not something I wish to change for my use and I don't feel like it belongs to this mod. I see it like a simple light manager that don't change part.

AVC : it is planned for next release.

Thanks for the suggestions :)

Link to comment
Share on other sites

v0.8 The MOAR Sun Light edition

  • Nearby vessel's lights are now toggled when the sun rise/fall
  • Lights are toggled when the craft reach a certain depth
  • Small fixes, see download link for more info

Grab it on SpaceDock or on GitHub

With this update I think Crew Light's feature are complete, do you guys see any light related stuff I could add ?

 

Edit : @Enceos thanks for the badge :cool:

Edited by Li0n
Link to comment
Share on other sites

Just found a bug in the v0.8 with KIS, it happens when you remove or attach a container to a mount. The game keep working but the performance suffer. Probably an infinite loop, haven't dig in the code yet.

If you got too bad fps : F5/F9 or turn "use_sun_light" to false in GameData/CrewLight/PluginData/Settings.cfg

Link to comment
Share on other sites

  • 2 weeks later...

v0.9 The BETTER Sun Light edition

  • Lights on Kerbal's helmet are now toggled as the sun rise/fall, can be tweaked in settings.cfg so lights are always on when in space or landed
  • Better handling of the sunlight feature, mostly for building / modifying vessel with KIS
  • Correct a typo in the .version file, KSP-AVC should now give the right link when a new version comes up

Grab it on SpaceDock or on GitHub

In this version I rewrote a good bunch of the code so please report any issues or inconsistencies. 

For the next version I plan on adding the ability for kerbals to switch lights when on EVA (almost three years of playing KSP and I just noticed I can't do that :confused: )

Enjoy :D

Link to comment
Share on other sites

v0.10 The EVA Light edition

Grab it on SpaceDock or on GitHub

If you have any suggestion about light *stuff* please share, and of course report to me any bug or UFI*

* Unidentified Flying Insect

Link to comment
Share on other sites

8 hours ago, wasml said:

FYI: Went to update the settings in the new 0.10 settings.cfg and didn't find it - assumed this was an oversight and copied the 0.90 settings file.

Thanks for sharing this mod.

I don't include the settings.cfg, it's created when the game starts. The purpose being to merge the CrewLight folder of the download with the one in GameData without losing your settings.

Link to comment
Share on other sites

7 hours ago, Li0n said:

I don't include the settings.cfg, it's created when the game starts. The purpose being to merge the CrewLight folder of the download with the one in GameData without losing your settings.

If you like, I can generate a CKAN file for you.

Let me know

Link to comment
Share on other sites

6 minutes ago, linuxgurugamer said:

If you like, I can generate a CKAN file for you.

Let me know

Thanks for the offer but I prefer to wait a little longer, continue testing, squashing bug with a hammer, all that... I consider it still a WIP project.

Edited by Li0n
Link to comment
Share on other sites

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