Jump to content

How to Change All Engine Fuel Consumption


Recommended Posts

How to change all engine Fuel Consumption? i try config like this

@Part[*]:HAS[@Module[@ModuleEngine*]]:HAS[@Propellant[*]]:AFTER[@Module[@ModuleEngine*]]

{

     @ModuleEngine[*]

     {

          @Propellant[*]

          {

               @ratio *= 0.1

          }

     }

}

This Config only change first engine propellant ratio. how to change all engine propellant ratio?

Link to comment
Share on other sites

I can see English is not your first language. I will try to explain in simple words, but I'm not sure that you will understand. This is a very complicated thing.

See, there are many mistakes in your code. Every line has a mistake, except one. But even without mistakes, it would not work. You are changing the wrong thing. "ratio" does not do what you think it does.

And if you find out what you must change... then you still can't get it to work. But it is not your fault. The special code you need to write to make this change is undocumented. You cannot look it up anywhere. At least, I have never seen it anywhere. You must ask someone who knows. Thankfully, I know :wink: But only because I asked the mod author himself about it in the past.

Because it is difficult to explain, I will give you a working patch. If you want to understand why it must be done like this, ask me about it, and I will explain, but it will get complicated. If you just want it to work, go ahead and use this:

@PART[*]:HAS[@MODULE[ModuleEngines*]]:FINAL
{
	@MODULE[ModuleEngines*],*
	{
		@atmosphereCurve
		{
			@key,*[1, ] *= 10
		}
	}
}

I tested this myself, and verified it works even on multi-mode engines like the RAPIER.

 

Edited by Streetwind
Link to comment
Share on other sites

yes, i not. i am from Indonesian and using Indonesian Language. because This language is International language in my school teach this language. (so... sorry for wrong word, i still need learn more about this language)

 

 

@MODULE[ModuleEngines*],* // what is mean of ,* (is that refer to engine id, is'nt?) why we cannot use @MODULE[ModuleEnginesFX]?

Link to comment
Share on other sites

The asterisk (the * symbol) has two uses. Both are used in making MM patches.

In the case of mathematics, it is used to multiply numbers.

In the case of computer programming, it is a so-called 'wildcard'. That means it is a symbolic stand-in for "anything and everything".

 

In the line   @MODULE[ModuleEngines*]  this means: look for a module that starts with the text "ModuleEngines", and the * acts as a wildcard that says "any other text that follows this is also acceptable". So this command hits both ModuleEngines and ModuleEnginesFX. It catches every engine, no matter which variant it uses.

Then after that, you have   ,*   which is a counter. An engine like the RAPIER has two ModuleEnginesFX. Because computers count from 0, the first one of those two modules would be targeted with  ,0  and the second one would be targeted  ,1  ...But you don't want to target only one of them. You want to target all of them. But you also want your code to work with engines that only have one, not two. So you use the * as a wildcard again, to let it say: "any number is fine".

To sum up,  @MODULE[ModuleEngines*],*  means: "change any and all of the modules that are named ModuleEngines and anything after that". In that one single line, you capture all possible combinations of all possible engine modules, meaning that you can be sure that it hits absolutely every engine in the entire game.

 

(That's the easy part of the patch by the way :wink:)

 

Edited by Streetwind
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...