Jump to content

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


sarbian

Recommended Posts

So does anyone know what to add or adress with a patch wich forces it to take my textures instead?

You have to remove the mesh value and add a MODEL node that loads the model and rename the textures. So something like :


@PART[parachuteLarge]
{
!mesh = delete
MODEL
{
model = Squad/Parts/Utility/parachuteMk1/model
texture = model000, MyTexture/myTexture000
texture = model001, MyTexture/myTexture001
}
}

Link to comment
Share on other sites

I'm attempting to mod a stock engine, and I want it to produce the same amount of electricity the engine does at full throttle. Using ModuleManager, is it possible to capture the rate from ModuleAlternator before it remove ModuleAlternator from the part?

Link to comment
Share on other sites

I'm attempting to mod a stock engine, and I want it to produce the same amount of electricity the engine does at full throttle. Using ModuleManager, is it possible to capture the rate from ModuleAlternator before it remove ModuleAlternator from the part?

Using the LV-T30 "Reliant" as an example:


@PART[liquidEngine]
{
%MODULE[ModuleMyAlternator]
{
capturedRate = #$../MODULE[ModuleAlternator]/RESOURCE[ElectricCharge]/rate$
}
-MODULE[ModuleAlternator] {}
}

Some notes:

I'm using the edit-or-create syntax with the "%" instead of just defining it. This is a personal preference of mine, you can just as easily do


@PART[liquidEngine]
{
MODULE
{
name = ModuleMyAlternator
capturedRate = #$../MODULE[ModuleAlternator]/RESOURCE[ElectricCharge]/rate$
}
-MODULE[ModuleAlternator] {}
}

Make sure you do it in that order, so that you grab it before you delete it.

What this is doing is saying "capturedRate equals [go up one level (to the PART node), select node MODULE[ModuleAlternator], select node RESOURCE[ElectricCharge], select value of 'rate']".

Link to comment
Share on other sites

What does the :FOR (colon FOR, to make this more searchable later) directive do, exactly? I've seen references for it, and there's a mention in the documentation on github, but it's not explained very well. Does it just mean that any node with :FOR[foo] will be found later with a :NEEDS[foo] directive?

Link to comment
Share on other sites

Looking for some advice on changing settings for the Alternate Resource Panel. I'd like to ship the BioMass mod so that the solid resources appear in kg vs the default setting, but the structure of the settings.cfg for ARP has me wondering if it's possible.

The cfg structure is (simplified):

Settings{
ResourceStorage{
Item{
name = someResourceName
...
DisplayValueAs = [Units, Kilograms, Tonnes, Liters]
}
}
}

Would I use something like:

@Settings:FOR[AlternateResourcePanel]{
@ResourceStorage:HAS[@Item[someResourceName]]{
@DisplayValueAs = Kilograms
}
}

Halp?

Link to comment
Share on other sites

What does the :FOR (colon FOR, to make this more searchable later) directive do, exactly? I've seen references for it, and there's a mention in the documentation on github, but it's not explained very well. Does it just mean that any node with :FOR[foo] will be found later with a :NEEDS[foo] directive?

If :FOR[foo] exists anywhere, then all :NEEDS[foo] requirements will be satisfied. (which kinda sucks if you are using :NEEDS to be sure that a mod exists as the mod could be absent but :FOR[foo] will make it seem as though it is present)

More than that though, patch nodes can be ordered, if you need them to occur in a specific order.

The order is

:FIRST

:LEGACY

:BEFORE[Foo]

:FOR[Foo]

:AFTER[Foo]

:FINAL

where Foo equals any mod (including Module Manager)

Legacy doesn't actually need to be defined; any patch that you DONT specify the order in will occur during the :LEGACY pass.

- - - Updated - - -

Looking for some advice on changing settings for the Alternate Resource Panel. I'd like to ship the BioMass mod so that the solid resources appear in kg vs the default setting, but the structure of the settings.cfg for ARP has me wondering if it's possible.

The cfg structure is (simplified):

Settings{
ResourceStorage{
Item{
name = someResourceName
...
DisplayValueAs = [Units, Kilograms, Tonnes, Liters]
}
}
}

Would I use something like:

@Settings:FOR[AlternateResourcePanel]{
@ResourceStorage:HAS[@Item[someResourceName]]{
@DisplayValueAs = Kilograms
}
}

Halp?

No, you didn't actually specify the Item to patch after checking for its existence


@Settings:FOR[AlternateResourcePanel]
{
@ResourceStorage:HAS[@Item[someResourceName]]
{
@Item[someResourceName]
{
@DisplayValueAs = Kilograms
}
}
}

Uhm question, does that mod actually use config nodes loaded from cfg files? (that are not in PluginData)

I can't tell from looking at it really and it has to be like that

Link to comment
Share on other sites

Uhm question, does that mod actually use config nodes loaded from cfg files? (that are not in PluginData)

I can't tell from looking at it really and it has to be like that

I put an example settings.cfg that ARP makes at https://www.dropbox.com/s/7zx72f4zuvo4mnb/settings.cfg?dl=0

I'm unsure MM will be able to figure out how to replace things in that, which is why I swung by here to ask. If I can confirm MM won't be able to cope, I'll pass a feature request along

Link to comment
Share on other sites

If :FOR[foo] exists anywhere, then all :NEEDS[foo] requirements will be satisfied. (which kinda sucks if you are using :NEEDS to be sure that a mod exists as the mod could be absent but :FOR[foo] will make it seem as though it is present)

More than that though, patch nodes can be ordered, if you need them to occur in a specific order.

The order is

:FIRST

:LEGACY

:BEFORE[Foo]

:FOR[Foo]

:AFTER[Foo]

:FINAL

where Foo equals any mod (including Module Manager)

Legacy doesn't actually need to be defined; any patch that you DONT specify the order in will occur during the :LEGACY pass.

Hmm. I thought it might be something like that. It looks like it's both a sequencer and a...needs-satisfier or whatever you want to call it? Weird. Actually wait, does it actually have to be a mod that exists, or can it be any tag? And I was aware of BEFORE, AFTER, and FINAL, but not FIRST and LEGACY... FIRST would be the opposite of FINAL, I'd assume, but is there anything special about LEGACY?

Link to comment
Share on other sites

I put an example settings.cfg that ARP makes at https://www.dropbox.com/s/7zx72f4zuvo4mnb/settings.cfg?dl=0

I'm unsure MM will be able to figure out how to replace things in that, which is why I swung by here to ask. If I can confirm MM won't be able to cope, I'll pass a feature request along

I am quite sure Alternate Resource Panel loads the file with its code so any MM change will be ignored.

Link to comment
Share on other sites

hi sarbian,

would it be possible to do math using values coming from different keys?

example:


MODULE
{
name = radius
value = 2
}
MODULE
{
name = pi
value = 3.14
}
MODULE
{
name = area
value = #$../MODULE[radius]/value$ * #$../MODULE[radius]/value$ * #$../MODULE[pi]/value$
}

or something like that

EDIT

I guess this is the post I was looking for.

Yes, INTERNAL are doable.
Edited by Sigma88
Link to comment
Share on other sites

I don't know how often you get it Sarbian but I just wanted to say thanks for being awesome and running such a core and depended upon mod. Transitioning from a user to a modder whose mod is dependent on this mod teaches one the full use of Module Manager. Thank you :D

Link to comment
Share on other sites

hi sarbian,

would it be possible to do math using values coming from different keys?

example:


MODULE
{
name = radius
value = 2
}
MODULE
{
name = pi
value = 3.14
}
MODULE
{
name = area
value = #$../MODULE[radius]/value$ * #$../MODULE[radius]/value$ * #$../MODULE[pi]/value$
}

or something like that

EDIT

I guess this is the post I was looking for.

Of course you can if you go with intermediate steps :


MODULE
{
name = area
value=#$../MODULE[radius]/value$
@value*=#$../MODULE[radius]/value$
@value*=#$../MODULE[pi]/value$
}

Link to comment
Share on other sites

Of course you can if you go with intermediate steps :


MODULE
{
name = area
value=#$../MODULE[radius]/value$
@value*=#$../MODULE[radius]/value$
@value*=#$../MODULE[pi]/value$
}

yeah, after I posted the question I noticed that I could do it that way

thanks anyway tho :)

Link to comment
Share on other sites

I have another question:

is it possible to load a value inside an :HAS[] check?

example:

PART
{
DELETER
{
savedVAR = deleteME
}
MODULE
{
Description = deleteME
// I want to delete this MODULE
}
MODULE
{
Description = DONTdeleteME
// I DONT want to delete this MODULE
}
}
[HR][/HR]@PART
{
!MODULE:HAS[#Description[#$/DELETER/savedVAR$]] {}
}

Link to comment
Share on other sites

wow, quick answer :D

thanks.

I'll have to see if I can find a way around it then :)

--edit--

btw, I'm learning how to write stuff for MM and I have to say, I love your syntax.

I really think you don't get enough credit for what you are doing :)

Edited by Sigma88
Link to comment
Share on other sites

A potential bug: In theBioMass plugin, users can choose a difficulty level. The difficulty is controlled by a cfg meant to be read by module manager, so after the player picks a difficulty, they reload the database and the changes in what parts are available and how they work has taken effect.

We'd built all this in prior to MM 2.5.2, and it seems like something about how newer MM is caching info in causing weirdness. Does MM look at cached data on forced database reloads? If so, is there a way to tell it not to?

Link to comment
Share on other sites

err... is there any way to download older versions of it? Because some of my favorite mods haven't been updated for 1.0 and i'm having issues so i want to try out the latest version for 0.9 which is 2.5.13, but i can't find it anywhere

Link to comment
Share on other sites

G_glop: Welcome to the forums!

https://ksp.sarbian.com/jenkins/job/ModuleManager/

On the left, the build history. That's all MM builds. Click on the #n for each build to see what MM version it corresponds to.

LostOblivion:

@atmosphereCurve

{

@key,0 = new_vals

//etc

}

Note that @NODE[nodename] is just a shortcut for @NODE:HAS[#name[nodename]], there's nothing particularly magic about it

Edited by NathanKell
Link to comment
Share on other sites

Okay I give up I have tried everything I can think of. I am trying to get my KIS iva fix patch perfect. I want to target parts without the INTERNAL node at all and without having any other INTERNAL node already. I always seem to get some parts with 2 INTERNAL nodes the normal and placeholder. I tried to make a patch to clean up instead, and just remove the placeholder from parts with placeholder INTERNAL and any other INTERNAL, but end up losing all placeholder INTERNALs instead of targeting just parts with 2 INTERNAL nodes. Thanks


@PART
[*]:HAS[#CrewCapacity
[*],~CrewCapacity[0],!INTERNAL[],!INTERNAL
[*]]:FINAL
{
INTERNAL
{
name = Placeholder
}
}

and this was my attempted clean up.


@PART
[*]:HAS[@INTERNAL[Placeholder],@INTERNAL
[*]]:FINAL
{
!INTERNAL:HAS[#name[Placeholder]] {}
}

Link to comment
Share on other sites

Okay I give up
I have tried everything I can think of. I am trying to get my KIS iva fix patch perfect. I want to target parts without the INTERNAL node at all and without having any other INTERNAL node already. I always seem to get some parts with 2 INTERNAL nodes the normal and placeholder. I tried to make a patch to clean up instead, and just remove the placeholder from parts with placeholder INTERNAL and any other INTERNAL, but end up losing all placeholder INTERNALs instead of targeting just parts with 2 INTERNAL nodes. Thanks


@PART
[*]:HAS[#CrewCapacity
[*],~CrewCapacity[0],!INTERNAL[],!INTERNAL
[*]]:FINAL
{
INTERNAL
{
name = Placeholder
}
}

and this was my attempted clean up.


@PART
[*]:HAS[@INTERNAL[Placeholder],@INTERNAL
[*]]:FINAL
{
!INTERNAL:HAS[#name[Placeholder]] {}
}

try this


@Part
[*]:FINAL
{
@INTERNAL[Placeholder]
{
@name = my_swag_internals_name
}
}

or this


@Part
[*]:FINAL
{
!INTERNAL[Placeholder] {}
}

oh wait, that's not what you are trying to do.... derp...

how do you get parts with 2 internal modules? I thought all stock parts had just one "INTERNAL" module

Edited by Sigma88
Link to comment
Share on other sites

try this


@Part
[*]:FINAL
{
@INTERNAL[Placeholder]
{
@name = my_swag_internals_name
}
}

or this


@Part
[*]:FINAL
{
!INTERNAL[Placeholder] {}
}

oh wait, that's not what you are trying to do.... derp...

how do you get parts with 2 internal modules? I thought all stock parts had just one "INTERNAL" module

The patch I tried wasn't clean and hit parts it wasn't supposed to. I am asking for help to tighten my search so it only hits the nessasry parts. KIS needs all all crewed vessel to have Iva for the inventory to work properly. Maybe I am using VSR as it seemed to hit parts that added an Iva change.

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