Jump to content

[1.8.x-1.12.x] Module Manager 4.2.3 (July 03th 2023) - Fireworks season


sarbian

Recommended Posts

Just now, sarbian said:

Or using the version built for 1.1 works better on 1.1.

oh well, that's your fault for not making the mod universally compatible with all KSP builds

:)

(I'm joking of course, please don't 2.3.f me :D)

Link to comment
Share on other sites

this is probably the wrong thread to ask this, but I have absolutely no idea where to ask so....

 

Would it be possible to make solar panels produce Ec/s when deployed regardless of solar irradiation? like they were RTGs

Link to comment
Share on other sites

4 hours ago, Sigma88 said:

this is probably the wrong thread to ask this, but I have absolutely no idea where to ask so....

 

Would it be possible to make solar panels produce Ec/s when deployed regardless of solar irradiation? like they were RTGs

Probably.  I'd look at the configs for the stock radiators.

Link to comment
Share on other sites

Question! What happens if I apply a multiplication to a field that has multiple values? For example:

SomeModule
{
    key = 0 100
    key = 1 1000
}

Assume I want to write a patch that, for both keys, multiplies the second value with 0.5. Usually in this case I'd go @fieldName *= 0.5. But these fields have two values in them. I would fully expect the first value to be multiplied, and I don't want that, because it screws up the second key.

Is there a way I can do this without "hardcoding" the new values? The multiplier is meant to be variable.

 

Edited by Streetwind
Link to comment
Share on other sites

2 minutes ago, Streetwind said:

Question! What happens if I apply a multiplication to a field that has multiple values? For example:


SomeModule
{
    key = 0 100
    key = 1 1000
}

Assume I want to write a patch that, for both keys, multiplies the second value with 0.5. Usually in this case I'd go @fieldName *= 0.5. But these fields have two values in them. I would fully expect the first value to be multiplied, and I don't want that, because it screws up the second key.

Is there a way I can do this without "hardcoding" the new values? The multiplier is meant to be variable.

 

Yes

@key,1[*, ] /= 2

 

@key,1        targets the second key

[*, ]            selects all the elements of that key

/= 2         divides them by 2

Link to comment
Share on other sites

Nice, ModuleManager delivers as usual.

But how would I write it if I wanted to select not all elements, but specifically the second element in a list of elements? I'm not clear on the syntax of that selection statement.

 

Edited by Streetwind
Link to comment
Share on other sites

1 minute ago, Streetwind said:

Nice, ModuleManager delivers as usual.

But how would I write it if I wanted to select not all elements, but specifically the second element in a list of elements? I'm not clear on the syntax of that selection statement.

 

The square brackets specify which elements you want to edit

In a comma separated list ( key = A,B,C )

You can just put the number of the element you want to edit

So

@key[0]

Will target the first element (A)    [1] the second (B) and so on

Since you have a space separated list you need to use [1, ]

If instead of using  number you use * your patch will target all the elements

Link to comment
Share on other sites

Okay, while I'm in the business of asking questions:

Is there a way I can reload my MM patches without restarting the client, for example to import changes I've just made? KSP has a button to reload the base config files, but that doesn't include patches.

Edited by Streetwind
Link to comment
Share on other sites

9 minutes ago, Streetwind said:

Okay, while I'm in the business of asking questions:

Is there a way I can reload my MM patches without restarting the client, for example to import changes I've just made? KSP has a button to reload the base config files, but that doesn't include patches.

Alt+F11 from the main menu or space center -> "Reload Database" or "Quick Reload Database" (the only difference I'm aware of is that quick reload doesn't re-render drag cubes).

Link to comment
Share on other sites

14 minutes ago, blowfish said:

Alt+F11 from the main menu or space center -> "Reload Database" or "Quick Reload Database" (the only difference I'm aware of is that quick reload doesn't re-render drag cubes).

That is the stock KSP buttion I mentioned in my post. It does not reload MM patches - in fact, it overwrites previously applied patches with the base configs again. =/

 

Edited by Streetwind
Link to comment
Share on other sites

Just now, Streetwind said:

That is the stock KSP buttion I mentioned in my post. It does not reload MM patches - in fact, it overwrites previously applied patches with the base configs again. =/

 

Alt+F11 should open up a window titled "Module Manager" (plus some version information) with 3 buttons.  Does it not?

Link to comment
Share on other sites

@sarbian

I have a user who is saying that some changes I sent him aren't being applied.  So I'd like to see what the final cfg for a part is after all changes.

Is there any way I can do that?  I thought dumping the database would do that (alt-f11), but when I looked at my system's output, the changes which I knew had been applied weren't there, it appeared to be the original cfg.

Thanks

Link to comment
Share on other sites

5 hours ago, linuxgurugamer said:

@sarbian

I have a user who is saying that some changes I sent him aren't being applied.  So I'd like to see what the final cfg for a part is after all changes.

Is there any way I can do that?  I thought dumping the database would do that (alt-f11), but when I looked at my system's output, the changes which I knew had been applied weren't there, it appeared to be the original cfg.

Thanks

The ModuleManager.ConfigCache has the whole config. 

Link to comment
Share on other sites

14 hours ago, blowfish said:

Alt+F11 should open up a window titled "Module Manager" (plus some version information) with 3 buttons.  Does it not?

Ooohhh... Alt+F11, not F12!

It was near midnight and I was having the dumb, apparently. :blush: You are of course correct.

 

Edited by Streetwind
Link to comment
Share on other sites

10 hours ago, Stone Blue said:

I dont know if any one else noticed, but with 1.1, if you DONT want KSP to run in the background if you switch windows, now the game also DOES NOT LOAD, while focusing on a different window... So, so much for surfing the web, or playing MS Solitaire while it takes 15 mins for your heavily modded install to load.
Either you have to stay focused on the loading screen, and go do something NOT on your computer while you wait, OR you HAVE to have KSP run in the background if you switch windows during gameplay, OR you have to go into the Settings menu EVERY time you start your game, AND EVERY time before you CLOSE your game to switch the setting... :(

Squad, if possible, PLEASE make the Simulate in Background setting ONLY affect gameplay, and NOT game loading like it always has been pre-1.1... :wink:

6 minutes ago, sarbian said:

 Can you post in ModuleManager thread so I don't forget about it ? I ll add something to force the value until the main menu

Link to comment
Share on other sites

On 8/12/2014 at 1:20 AM, NonWonderDog said:

I think that and a bit of cleverness would allow any math people anyone would reasonably want to do. With clever enough use of regexes it might even turn out to be Turing complete. (No, wait, we'd still need a way to make a loop...)

On 2/16/2016 at 10:52 PM, sarbian said:

Ok, new features time. v2.619

1. "MM_PATCH_LOOP {}" nodes. They will have the current node loop on the active top node until the HAS condition is not valid anymore. It has some really specific use from complex patch and can easily lead to infinite loops.

And thus we have another case of accidental Turing-completeness.

Proof—see also gist:

Machine {
  State {
    state = a
  }
}

@Machine:HAS[@State:HAS[~state[halt]]] {
  MM_PATCH_LOOP{}
  // Clean up the mess.
  !MM_PATCH_LOOP{}

  @State:HAS[~stepped[*]] {
    stepped = false
  }
  @State:HAS[~left_tape[*]] {
    left_tape = ...
  }
  @State:HAS[~right_tape[*]] {
    right_tape = ...
  }
  @State:HAS[~symbol[*]] {
    symbol = 0
  }

  // Feed tape for one step.
  @State:HAS[~left_tape[*,...]] {
    @left_tape = 0,...
  }
  @State:HAS[~right_tape[*,...]] {
    @right_tape = 0,...
  }
  // We step only once per iteration, that way the tape fed above is enough.
  @State {
    @stepped = false
  }

  // Transition table (3-state 2-symbol busy beaver).

  @State:HAS[#symbol[0],#state[a],#stepped[false]] {
    // Write 1, move left
    @right_tape = #1,$right_tape$
    @symbol     = #$left_tape[0]$
    @left_tape ^= /[^,]+,(.*)/$1/
    @state = b
    @stepped = true
  }

  @State:HAS[#symbol[0],#state[b],#stepped[false]] {
    // Write 1, move right
    @left_tape   = #1,$left_tape$
    @symbol      = #$right_tape[0]$
    @right_tape ^= /[^,]+,(.*)/$1/
    @state = a
    @stepped = true
  }

  @State:HAS[#symbol[0],#state[c],#stepped[false]] {
    // Write 1, move right
    @left_tape   = #1,$left_tape$
    @symbol      = #$right_tape[0]$
    @right_tape ^= /[^,]+,(.*)/$1/
    @state = b
    @stepped = true
  }

  @State:HAS[#symbol[1],#state[a],#stepped[false]] {
    // Write 1, move right
    @left_tape   = #1,$left_tape$
    @symbol      = #$right_tape[0]$
    @right_tape ^= /[^,]+,(.*)/$1/
    @state = c
    @stepped = true
  }

  @State:HAS[#symbol[1],#state[b],#stepped[false]] {
    // Write 1, move left
    @right_tape = #1,$right_tape$
    @symbol     = #$left_tape[0]$
    @left_tape ^= /[^,]+,(.*)/$1/
    @state = b
    @stepped = true
  }

  @State:HAS[#symbol[1],#state[c],#stepped[false]] {
    @state = halt
    @stepped = true
  }
}

// Cleanup.
@Machine:HAS[@State:HAS[#state[halt]]] {
  @State {
    !stepped = delete
  }
}

// Output:
//  Machine {
//    State {
//      state      = halt
//      left_tape  = 1,1,0,...
//      right_tape = 1,1,1,0,...
//      symbol     = 1
//    }
//  }

The above is the 3-state 2-symbol busy beaver, but it is straightforward to encode any Turing machine in a similar manner.

As an immediate corollary, whether ModuleManager will halt on a given set of cfg files is undecidable.

Thanks to @Sigma88 for helping me understand ModuleManager's features.

Edited by eggrobin
Link to comment
Share on other sites

20 minutes ago, eggrobin said:

And thus we have another case of accidental Turing-completeness.

Proof—see also gist:


Machine {
  State {
    state = a
  }
}

@Machine:HAS[@State:HAS[~state[halt]]] {
  MM_PATCH_LOOP{}
  // Clean up the mess.
  !MM_PATCH_LOOP{}

  @State:HAS[~stepped[*]] {
    stepped = false
  }
  @State:HAS[~left_tape[*]] {
    left_tape = ...
  }
  @State:HAS[~right_tape[*]] {
    right_tape = ...
  }
  @State:HAS[~symbol[*]] {
    symbol = 
  }

  // Feed tape for one step.
  @State:HAS[~left_tape[*,...]] {
    @left_tape = ,...
  }
  @State:HAS[~right_tape[*,...]] {
    @right_tape = ,...
  }
  // We step only once per iteration, that way the tape fed above is enough.
  @State {
    @stepped = false
  }

  // Transition table (3-state 2-symbol busy beaver).

  @State:HAS[#symbol[],#state[a],#stepped[false]] {
    // Write 1, move left
    @right_tape = #1,$right_tape$
    @symbol     = #$left_tape[0]$
    @left_tape ^= /[^,]+,(.*)/$1/
    @state = b
    @stepped = true
  }

  @State:HAS[#symbol[],#state[b],#stepped[false]] {
    // Write 1, move right
    @left_tape   = #1,$left_tape$
    @symbol      = #$right_tape[0]$
    @right_tape ^= /[^,]+,(.*)/$1/
    @state = a
    @stepped = true
  }

  @State:HAS[#symbol[],#state[c],#stepped[false]] {
    // Write 1, move right
    @left_tape   = #1,$left_tape$
    @symbol      = #$right_tape[0]$
    @right_tape ^= /[^,]+,(.*)/$1/
    @state = b
    @stepped = true
  }

  @State:HAS[#symbol[1],#state[a],#stepped[false]] {
    // Write 1, move right
    @left_tape   = #1,$left_tape$
    @symbol      = #$right_tape[0]$
    @right_tape ^= /[^,]+,(.*)/$1/
    @state = c
    @stepped = true
  }

  @State:HAS[#symbol[1],#state[b],#stepped[false]] {
    // Write 1, move left
    @right_tape = #1,$right_tape$
    @symbol     = #$left_tape[0]$
    @left_tape ^= /[^,]+,(.*)/$1/
    @state = b
    @stepped = true
  }

  @State:HAS[#symbol[1],#state[c],#stepped[false]] {
    @state = halt
    @stepped = true
  }
}

// Cleanup.
@Machine:HAS[@State:HAS[#state[halt]]] {
  @State {
    !stepped = delete
  }
}

// Output:
//  Machine {
//    State {
//      state      = halt
//      left_tape  = 1,1,0,...
//      right_tape = 1,1,1,0,...
//      symbol     = 1
//    }
//  }

The above is the 3-state 2-symbol busy beaver, but it is straightforward to encode any Turing machine in a similar manner.

As an immediate corollary, whether ModuleManager will halt on a given set of cfg files is undecidable.

What a geek :)

Link to comment
Share on other sites

11 hours ago, blowfish said:

I can walk you through creating it.  How much about MM patches do you know already?

 

I'd call myself a novice.  I know enough to go find all the parts with a text editor and make changes manually.

I'm wondering if there's code that just says, "for all parts with reaction wheels, multiply torque values by x"

Link to comment
Share on other sites

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