Jump to content

[1.5.1] Engine Lighting (1.5.1) Little Config Update (13 October)


tajampi

Recommended Posts

So, perhaps this is rude, but I modified and re-compiled this wonderful mod for 1.2

I fixed lights affecting Kerbin from orbit, added RAPIER support and made hot engines glow (more details in release). It doesn't seem slower - but I have a fast-ish computer and haven't tested with 2000part rockets, ymmv.

Pictures:

http://imgur.com/a/Laf8N

I sent tajampi a message about a week ago offering to give them my changes and they've not replied (they did say they'd be busy I suppose) so unless/until they ask me to take it down you can find my 101% Unofficial version here: https://github.com/ToXik-yogHurt/EngineLightUnofficial/releases/tag/v1.0.0-gamma

Link to comment
Share on other sites

4 hours ago, ToXik-yogHurt said:

So, perhaps this is rude, but I modified and re-compiled this wonderful mod for 1.2

I fixed lights affecting Kerbin from orbit, added RAPIER support and made hot engines glow (more details in release). It doesn't seem slower - but I have a fast-ish computer and haven't tested with 2000part rockets, ymmv.

Pictures:

http://imgur.com/a/Laf8N

I sent tajampi a message about a week ago offering to give them my changes and they've not replied (they did say they'd be busy I suppose) so unless/until they ask me to take it down you can find my 101% Unofficial version here: https://github.com/ToXik-yogHurt/EngineLightUnofficial/releases/tag/v1.0.0-gamma

I really hope this stays up, great work!

Link to comment
Share on other sites

  • 2 weeks later...
1 hour ago, PmThay said:

@ToXik-yogHurt sorry to bother you but i'm not sure which folder to use from your patch to overwrite the original mod. could you help me?

 In the Github link for "Source code (zip)", the file you'll find the file "EngineLightUnofficial-1.0.0-gamma.zip".

Inside that you'll find the directory "EngineLightUnofficial-1.0.0-gamma\release\EngineLight"

Grab the "EngineLight" directory and copy it into your GameData directory.

Link to comment
Share on other sites

57 minutes ago, Padrone said:

 In the Github link for "Source code (zip)", the file you'll find the file "EngineLightUnofficial-1.0.0-gamma.zip".

Inside that you'll find the directory "EngineLightUnofficial-1.0.0-gamma\release\EngineLight"

Grab the "EngineLight" directory and copy it into your GameData directory.

Thanks very much for the info :)

Link to comment
Share on other sites

Updated mod to version 1.5 with Toxik-yogHurt changes!

It will be available in CKAN in a few moments. The code in github is not yet updated!

 

EDIT: I will keep updating the mod as i'm getting back to KSP. Don't expect too many updates, but I will keep it up to date :wink:

 

 

Thank you for the amazing work :)

 

Edited by tajampi
Link to comment
Share on other sites

I've decided I'm going to start poking other coders about this: 

Next time you compile, please take a moment and update AsemblyInfo.cs with a line like

[assembly: AssemblyVersion("2.1.12.*")]

So when an end user right clicks the DLL and checks the properties they don't see version 1.0.0.0!  Right now users should see v1.5.???.???, it helps at least some users such as myself to follow which version they have installed.  (and yes, I do this on my own DLLs)

Link to comment
Share on other sites

  • 4 weeks later...

Oh alright! I will change it next release!
 

For now updated the mod on SpaceDock to 1.2.2, no changes in code!

 

For next update i'm planning to add some particle effects (sparks) to decouplers as the "engine lighting" part of the mod is pretty much done (Thanks ToXik-yogHurt !).

Should be easy with the stuff SQUAD added to import stuff from Unity into the game.

Here is the particle effect (Horrible recording, sorry about that!):

http://imgur.com/a/YMeGz

Will try to get it into the game.

Edited by tajampi
Link to comment
Share on other sites

On 11/28/2016 at 8:34 PM, tg626 said:

I've decided I'm going to start poking other coders about this: 

Next time you compile, please take a moment and update AsemblyInfo.cs with a line like


[assembly: AssemblyVersion("2.1.12.*")]

So when an end user right clicks the DLL and checks the properties they don't see version 1.0.0.0!  Right now users should see v1.5.???.???, it helps at least some users such as myself to follow which version they have installed.  (and yes, I do this on my own DLLs)

You can do what I'm doing, have it updated automatically from the .version file.  This is also a great reason to have a .version file.

I do my builds with Visual Studio.

I have a Text Template, which is executed before every build. The file follows, just create it in the project, call it AssemblyVersion.tt:

<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ import namespace="System.IO" #>
<#@ output extension=".cs" #>

<#@ assembly name="EnvDTE" #><# /* This assembly provides access to Visual Studio project properties. */ #>
<#

	// Instructions
	// 1.  Add a new Text Template to the project
	// 2.  Copy this file into the new template
	// 3.  Update the string: versionfile with the complete path to the .version file
	// 4.  Remove the following line from the file AssemblyInfo.cs (usually located in the "Property" folder inside your C# project):
	//        [assembly: AssemblyFileVersion("1.0.0.0")]
	// 5.  Add the following to the PreBuild steps:
	//		set textTemplatingPath="%CommonProgramFiles(x86)%\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe"
	//
	//		if %textTemplatingPath%=="\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe" set textTemplatingPath="%CommonProgramFiles%\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe"
	//
	//		%textTemplatingPath% "$(ProjectDir)AssemblyVersion.tt"

    int major = 0; 
    int minor = 0; 
    int build = 0; 
	int patch = 0;
	bool versionSection = false;
	int i = 0;
	int i2 = 0;
	string s;

	string versionfile =  @"D:\Users\jbb\github\DangIt\source\DangIt.version";
	if (!File.Exists(versionfile))
	{
		Write("File: " + versionfile + " missing\n");		
	}

	try
	{
		foreach (var line in File.ReadAllLines(versionfile))
		{
			if (line != null)
			{
				if (!versionSection)
				{
					if (line.Contains("\"VERSION\""))
						versionSection = true;
				}
				else
				{
					if (line.Contains("}"))
							versionSection = false;
					i = line.IndexOf(":");
					i2 = line.IndexOf(",");
					if (i2 == -1)
						i2 = line.Length;
					if (i >= 0 && i2 >= 0)
					{
						s = line.Substring(i + 1, i2 - i - 1);

						if (line.Contains("MAJOR"))			
							Int32.TryParse(s, out major);			
			
						if (line.Contains("MINOR"))			
							Int32.TryParse(s, out minor);
			
						if (line.Contains("PATCH"))			
							Int32.TryParse(s, out patch);
			
						if (line.Contains("BUILD"))			
							Int32.TryParse(s, out build);
					}
				}
			}
		}
         
     }
     catch
     {
         major = 1; 
         minor = 0; 
         patch = 0; 
         build = 0; 
     }
	 //Write("File done");

 #>
 // This code was generated by a tool. Any changes made manually will be lost
 // the next time this code is regenerated.
 // 
  
 using System.Reflection;

 [assembly: AssemblyVersion("<#= major #>.<#= minor #>.<#= patch #>.<#= build #>")]

 

Link to comment
Share on other sites

  • 4 weeks later...

Hello!  Just popping in to say that I noticed an issue with one of the configs:

@PART[*]:HAS[@MODULE[ModuleEngines*],!PROPELLANT[IntakeAir]]:FOR[EngineLight]

This will check wither the part has a PROPELLANT node with name = IntakeAir, which will always be false, since the PROPELLANT node is on the ModuleEngines.  I think you want

@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[IntakeAir]]]:FOR[EngineLight]

The nested HAS block will check the ModuleEngines* for that PROPELLANT node

Link to comment
Share on other sites

  • 4 weeks later...
On 1/22/2017 at 2:12 PM, blowfish said:

Hello!  Just popping in to say that I noticed an issue with one of the configs:

@PART[*]:HAS[@MODULE[ModuleEngines*],!PROPELLANT[IntakeAir]]:FOR[EngineLight]

This will check wither the part has a PROPELLANT node with name = IntakeAir, which will always be false, since the PROPELLANT node is on the ModuleEngines.  I think you want

@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[IntakeAir]]]:FOR[EngineLight]

The nested HAS block will check the ModuleEngines* for that PROPELLANT node

Just came here to post the exact same thing. ^_^

@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[IntakeAir]]]:FOR[EngineLight]

As @blowfish said, the above is correct. I made the change and it works as intended.

Edited by Rhedd
Link to comment
Share on other sites

  • 2 weeks later...

 

On 18.2.2017 at 7:33 AM, Rhedd said:

@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[IntakeAir]]]:FOR[EngineLight]

Hehe, Me3 - I thought I was original for reporting that... While you're at it, can you make it HAS[!PROPELLANT[IntakeAir],!PROPELLANT[FanIntakeAir]]? That way it skips all the props and turbopros and fans I have installed.

Link to comment
Share on other sites

  • 2 weeks later...

I'm just adding to the above really, but for overview, the (corrected) exception list should look for:

  • IntakeAir (Typical LF Jets)
  • IntakeAtm (Non-oxygen jets & many fans)
  • FanIntakeAir (Other fans)

In the end, I'm guessing it'd be:

@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[IntakeAir]|!PROPELLANT[IntakeAtm]|!PROPELLANT[FanIntakeAir]}]:FOR[EngineLight]

Dunno, if the !PROPELLANT[] can take Boolean expressions. If it can, then you could shrink it to:

@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[IntakeAir|IntakeAtm|FanIntakeAir]}]:FOR[EngineLight]

BTW, are all the FORs necessary? I can't tell if you're trying to tell KSP all the changes are meant to be part of  a mod called EngineLight (which is what FOR actually does and MM assumes via a mod's main folder name or dll name) or if you're trying to make sure the configs take place only if EngineLight is installed/loaded first (which FOR sounds like it does), but that's actually NEEDS. At least, this is my understanding of how FOR and NEEDS work for MM from the references I read.

Link to comment
Share on other sites

For the time until the Config update, what would I have to put in a Module Manager patch to prevent the AirPlane Plus and Firespitter prop engines from receiving lighting effects? I think only some of the FS engines have lighting effects.

Edited by Galahir950
Link to comment
Share on other sites

On 13/03/2017 at 6:09 AM, StahnAileron said:

I'm just adding to the above really, but for overview, the (corrected) exception list should look for:

  • IntakeAir (Typical LF Jets)
  • IntakeAtm (Non-oxygen jets & many fans)
  • FanIntakeAir (Other fans)

In the end, I'm guessing it'd be:


@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[IntakeAir]|!PROPELLANT[IntakeAtm]|!PROPELLANT[FanIntakeAir]}]:FOR[EngineLight]

Dunno, if the !PROPELLANT[] can take Boolean expressions. If it can, then you could shrink it to:


@PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[IntakeAir|IntakeAtm|FanIntakeAir]}]:FOR[EngineLight]

BTW, are all the FORs necessary? I can't tell if you're trying to tell KSP all the changes are meant to be part of  a mod called EngineLight (which is what FOR actually does and MM assumes via a mod's main folder name or dll name) or if you're trying to make sure the configs take place only if EngineLight is installed/loaded first (which FOR sounds like it does), but that's actually NEEDS. At least, this is my understanding of how FOR and NEEDS work for MM from the references I read.

Tried with the boolean expressions and it did NOT work... :P

ETA1: Actually, neither worked... :(

ETA2: It seems the following patch works, though...

@PART[*]:HAS[@MODULE[ModuleEngines*],!PROPELLANT[IntakeAir],!PROPELLANT[IntakeAtm],!PROPELLANT[FanIntakeAir]]:FOR[EngineLight] {

 

Edited by jlcarneiro
Link to comment
Share on other sites

I have been trying to get this patch to work for the past couple hours. It would removed the engine lighting from any engine created by the two manufacturers from the AirPlanes Plus and Firespitter mods, but it would also affect the 2-3 jet engines in the AirPlanes Plus mod, which I am fine with. I am, however, running into issues where nothing changes with the patch applied and the engine light still emits, is there something I am supposed to be doing extra?

@PART[*]:[#manufacturer[Kerbal?Standard],#manufacturer[Bitesized?Industries]]:FOR[EngineLight]:FINAL
{
	MODULE
	{
		name = EngineLightEffect
		%enableEmissiveLight = False
	}
}

EDIT: I just double checked the documentation and I saw that "|" is used for OR, should I have put that instead of a comma? I'll try it in the morning.

EDIT 2: I tried the above and I tried the below and neither worked.

@PART[*]:HAS[#manufacturer[Kerbal?Standard]]:FOR[EngineLight]:FINAL
{
	MODULE
	{
		name = EngineLightEffect
		%enableEmissiveLight = false
	}
}
@PART[*]:HAS[#manufacturer[Bitesized?Industries]]:FOR[EngineLight]:FINAL
{
	MODULE
	{
		name = EngineLightEffect
		%enableEmissiveLight = false
	}
}

EDIT 3: THIS WORKS, I confused Emissive and Exhaust as meaning the same thing.

@PART[*]:HAS[#manufacturer[Kerbal?Standard]]:FOR[EngineLight]:FINAL
{
	@MODULE[EngineLightEffect]
	{
        @enableEmissiveLight = false
        @exhaustRed = 0
        @exhaustGreen = 0
        @exhaustBlue = 0
	}
}
@PART[*]:HAS[#manufacturer[Bitesized?Industries]]:FOR[EngineLight]:FINAL
{
	@MODULE[EngineLightEffect]
	{
        @enableEmissiveLight = false
        @exhaustRed = 0
        @exhaustGreen = 0
        @exhaustBlue = 0
	}
}

 

Edited by Galahir950
Link to comment
Share on other sites

On 3/15/2017 at 1:05 AM, Galahir950 said:

EDIT 3: THIS WORKS, I confused Emissive and Exhaust as meaning the same thing.

have you tried just deleting the module entirely instead?

@PART[*]:HAS[#manufacturer[Kerbal?Standard]]:FOR[EngineLight]:FINAL
{
  !MODULE[EngineLightEffect] {}
}
@PART[*]:HAS[#manufacturer[Bitesized?Industries]]:FOR[EngineLight]:FINAL
{
  !MODULE[EngineLightEffect] {}
}

 

Link to comment
Share on other sites

14 minutes ago, Drew Kerman said:

have you tried just deleting the module entirely instead?


@PART[*]:HAS[#manufacturer[Kerbal?Standard]]:FOR[EngineLight]:FINAL
{
  !MODULE[EngineLightEffect] {}
}
@PART[*]:HAS[#manufacturer[Bitesized?Industries]]:FOR[EngineLight]:FINAL
{
  !MODULE[EngineLightEffect] {}
}

 

Yeah, that would probably work.

Link to comment
Share on other sites

On ‎3‎/‎14‎/‎2017 at 9:20 PM, jlcarneiro said:

Tried with the boolean expressions and it did NOT work... :P

ETA1: Actually, neither worked... :(

ETA2: It seems the following patch works, though...


@PART[*]:HAS[@MODULE[ModuleEngines*],!PROPELLANT[IntakeAir],!PROPELLANT[IntakeAtm],!PROPELLANT[FanIntakeAir]]:FOR[EngineLight] {

 

Ahaha! I'm stupid. The reason why they don't work is because I used a close curly brace "}" in them here instead of a square close bracket "]" near the end. And since I copied-pasted the first to make the second, it would invalidate both. The first version works in my install of KSP, so I was wondering why it didn't work for you. So yeah, dumb typo. Sorry for that.

4 hours ago, Galahir950 said:

Yeah, that would probably work.

You could also do a NOT function (!) in the initial filter to never mod those parts to begin with: HAS[!manufacturer[NAME]].

And I'm really starting to think the FOR[EngineLight] should be a NEEDS[EngineLight] instead...

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