Jump to content

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


sarbian

Recommended Posts

11 hours ago, Gordon Dry said:

@sarbian can I change game parameters with a patch?

Like ReentryHeatScale ?
It's for the RSS-without-RO setup when using DeadlyReentry, to have it automatically applied to a new game.

If it is part of the Save then no.

Link to comment
Share on other sites

Hi everyone. Just a quick question/explanation I was hoping someone could help me with

Spoiler

@PART:HAS[@MODULE[ModuleDeployableCentrifuge]]
{
    DeployedMass = #$mass$
    @mass *= 0.4
    
    @MODULE[ModuleDeployableCentrifuge]
    {
        DeployResource = ElectricCharge
        DeployResourceAmount = #$../DeployedMass$
        @DeployResourceAmount *= 600
        %DeployedMassModifier = #$../DeployedMass$
        @DeployedMassModifier *= 0.6
    }
}

The part in question weighs in the editor- 4.5t and the EC required to deploy is 6750

now I can only assume weight is calculated by kg and not tons. So..

4500kg/0.4 = 11,250kg

11,250*0.6 = 6750 EC required

But Im a bit confused...given the way it looks in the spoiler..it should have been like this??

4500kg*0.4 = 1800kg

1800*0.6 = 1080 EC required

Where does the 600 come into play?

Im also confused by what #$../DeployedMass$ and #$mass$ does(Actually I just came across this, so ignore that for now I guess lol)

Cheers! and Thank You!

Edited by Jesusthebird
Link to comment
Share on other sites

8 hours ago, Jesusthebird said:

Hi everyone. Just a quick question/explanation I was hoping someone could help me with

  Hide contents

@PART:HAS[@MODULE[ModuleDeployableCentrifuge]]
{
    DeployedMass = #$mass$
    @mass *= 0.4
    
    @MODULE[ModuleDeployableCentrifuge]
    {
        DeployResource = ElectricCharge
        DeployResourceAmount = #$../DeployedMass$
        @DeployResourceAmount *= 600
        %DeployedMassModifier = #$../DeployedMass$
        @DeployedMassModifier *= 0.6
    }
}

 

The part in question weighs in the editor- 4.5t and the EC required to deploy is 6750

now I can only assume weight is calculated by kg and not tons. So..

4500kg/0.4 = 11,250kg

11,250*0.6 = 6750 EC required

But Im a bit confused...given the way it looks in the spoiler..it should have been like this??

4500kg*0.4 = 1800kg

1800*0.6 = 1080 EC required

Where does the 600 come into play?

Im also confused by what #$../DeployedMass$ and #$mass$ does(Actually I just came across this, so ignore that for now I guess lol)

Cheers! and Thank You!

 

#$<variable>$

# - tells MM we're looking for a variable

$...$ - mark the start and end of the desired variable

@ - indicates which node to look in for the desired variable

../ - drills down one subnode

So, for this config ...

For any part (@PART) that HAS the MODULE{ModuleDeployableCentrifuge};

set 'DeployedMass' to the mass of the part (#$mass$) then reduce that part's mass to 40%;

in NODE where DeployResource = ElectricCharge, change (@) DeployResourceAmount to be 600x the DeployedMass (or #$mass$) of the part;

Rinse&RepeatTM for DeployResourceAmount.

 

So, if mass - 4500kg

DeployedMass = 4500kg & mass (new) = 1800kg;

DeployResourceAmount = 4500 * 600 = 2700000(ec?);

DeployedMassModifier = 4500 * 0.6 = 2700.

 

(Subject to validation by someone who is more intimately familiar.)

Edited by TranceaddicT
Link to comment
Share on other sites

@TranceaddicT Your workflow seems to make sense up until the final output being 2700. Because the part requires 6750 ec to deploy. I had the right number output originally but only by dividing in the first phase which is why im a bit confused since the syntax for deployed mass and deployed mass modifier are the same. Why divide in one area and multiply in the other?? Hmm

Link to comment
Share on other sites

44 minutes ago, Jesusthebird said:

@TranceaddicT Your workflow seems to make sense up until the final output being 2700. Because the part requires 6750 ec to deploy. I had the right number output originally but only by dividing in the first phase which is why im a bit confused since the syntax for deployed mass and deployed mass modifier are the same. Why divide in one area and multiply in the other?? Hmm

I'm more confused by why you're saying you're doing division at all when the entire quoted section only includes multiplication:

11 hours ago, Jesusthebird said:

The part in question weighs in the editor- 4.5t and the EC required to deploy is 6750

now I can only assume weight is calculated by kg and not tons. So..

4500kg/0.4 = 11,250kg

11,250*0.6 = 6750 EC required

 

Why have you written it out this way, when the code snippet shows that to be a multiplication, just as TranceaddicT has based their work on:

2 hours ago, TranceaddicT said:

   DeployedMass = #$mass$
    @mass *= 0.4

If you want the result of this equation to give 11,250kg then the part's original DeployedMass would have to be 28,125kg, not 4,500kg. 

Link to comment
Share on other sites

57 minutes ago, Jesusthebird said:

@TranceaddicT Your workflow seems to make sense up until the final output being 2700. Because the part requires 6750 ec to deploy. I had the right number output originally but only by dividing in the first phase which is why im a bit confused since the syntax for deployed mass and deployed mass modifier are the same. Why divide in one area and multiply in the other?? Hmm

Hey, the math is the math.

You are conflating a "modifier" (DeployedMassModifier) with a "value" (DeployedMass).  There are actually three (3) mass variables:  mass, DeployedMass, DeployedMassModifier.

TOTAL GUESS: Not knowing what part we're talking about makes this a little difficult, but I'm betting the difference between 'mass' & 'DeployedMass' has more to do with the relative size than the actual mass. The DeployedMassModifier is used to account for that.

Example (after the above config):

Stowed configuration mass = 1800kg

Deployed configuration mass = 4500kg

Deployment Differential = 2700kg (= 4500 - 1800)

The logic behind the values resides with the config creator.

Link to comment
Share on other sites

35 minutes ago, JH4C said:

I'm more confused by why you're saying you're doing division at all when the entire quoted section only includes multiplication:

Why have you written it out this way, when the code snippet shows that to be a multiplication, just as TranceaddicT has based their work on:

If you want the result of this equation to give 11,250kg then the part's original DeployedMass would have to be 28,125kg, not 4,500kg. 

Because unless im missing something..I wasnt able to figure out how the output is 6750 without using division. Thats why im confused lol because I see nothing but multiplication going on here as well. 

@TranceaddicT the part im looking at is the pioneer centrifuge from the stationparts expansion redux mod. the cfg author is @JadeOfMaar maybe he can chime in if he isnt too busy :). Its the MKS patch located in said mods patch folder. All I did to it was swap MaterialKits for ElectricCharge and remove the NEEDS pass.

I wasnt aware of a 'stowed mass' either..but considering its ment 'for deployment' so im not sure if that should be considered or not?

 

The 2 constant variables here are it weighing 4500kg and that it requires 6750ec 'for deployment' or MaterialKits if using the patch as it was originally created to do.

 

Thank you for helping too btw guys..I do appriciate all of this!

Link to comment
Share on other sites

1 hour ago, Jesusthebird said:

I wasnt aware of a 'stowed mass' either..but considering its ment 'for deployment' so im not sure if that should be considered or not?

Like I said, complete guesswork on the 'stowed' vs 'deployed' thingy.

=====

Two things for you to do:

1. install KSPDev Logconsole

     This will help isolate problems.  It simplifies KSP.log by creating separate INFO, WARNING, and ERRORS & EXCEPTIONS logs (<KSProot>/GameData/KSPDev/logs).

2. If you launch from CKAN, change the launch command

   Settings:KSP command-line: ./KSP.x86_64 -single-instance -mm-dump

This will make MM generate <KSProot>/GameData/ModuleManage.ConfigCache & mirror GameData in <KSProot>/_MMCfgOutput/..

=====

I'm not finding a "Pioneer Centrifuge" but if it's the "Pilgrim Centrifuge" (/home/scott/Games/KSP_test_TC/GameData/StationPartsExpansionRedux/Parts/Extendable/extendable-375/sspx-expandable-centrifuge-375-2.cfg) .  The config by @JadeOfMaar is SSPXR-MKS-Extras.cfg (/home/scott/Games/KSP_test_TC/GameData/StationPartsExpansionRedux/Patches/SSPXR-MKS-Extras.cfg).

here's what I've got from my practice run ...

        mass = 4.5
        DeployedMass = 11.25     (#$mass$/0.4)
        DeployResourceAmount = 6750 (DeployedMass*600)
        DeployedMassModifier = 6.75 (DeployedMass*0.6)

So, yeah, it is performing a division even tho the math says multiplication.  Go figure.  (Lucy's got some 'splainin' to do.)

Link to comment
Share on other sites

@Jesusthebird Sadly there's nothing I can help you with re: deployment resource. My contribution to MKS configs is limited to fair guesses at kerbal months and hab multiplication, and ISRU stuff (I have only ever used MKS to gain some understanding of compatibility configs). However, I confidently assume that your efforts to use ElectricCharge may fail due to ElectricCharge being massless.

Edited by JadeOfMaar
Link to comment
Share on other sites

32 minutes ago, JadeOfMaar said:

@Jesusthebird Sadly there's nothing I can help you with re: deployment resource. My contribution to MKS configs is limited to fair guesses at kerbal months and hab multiplication, and ISRU stuff (I have only ever used MKS to gain some understanding of compatibility configs). However, I confidently assume that your efforts to use ElectricCharge may fail due to ElectricCharge being massless.

Hi Jade! Sorry to bother you. Thankfully, I have been successful in using the deploy animation with electric charge rather than materialkits; without MKS being needed. Im really just trying to understand the math behind the mentioned section of the cfg

That said..the editor is being a bit misleading it seems..When you place the part (fully deployed) it will show the full 11.25t weight value. When you retract it, it will show the "deployed mass" value. So thats even more confusing lol, so it looks like the patch is having the opposite effect. But thats something I can post in the other thread. Currently though..Im just trying to wrap my head around how the math is working in that particular section of the cfg which is why I posted here as I didnt think it was directly related to the mod but rather..MM doing math based off cfg parameters. Anyways..once I can understand it better, I can tweak it to my liking for ElectricCharge usage. I hope that makes sense? 

Thank you for responding!

Link to comment
Share on other sites

50 minutes ago, LupinoArts said:

Is there a way to select all parts that ship with a specific Mod? Say, I want to remove all Parts included in KerbalField from the Utility-Category and move them the BDA-Category. Is that possible?

If the mod uses a particular manufacturer you could target the manufacturer with @PART[*]:HAS[#manufacturer[modManufacturer]]

If the mod specifies different manufacturers for various parts then you would have to include conditionals for each manufacturer.

If any of those manufacturers are stock manufacturers or that are present in other mods then you will get false positives from this method and will target the wrong parts.

Link to comment
Share on other sites

1 minute ago, Starwaster said:

If any of those manufacturers are stock manufacturers or that are present in other mods then you will get false positives from this method and will target the wrong parts.

Thanks for the replay. I've gone the long way and selected by BD Modul name, that was a close enough match.

Would be a great addition to MM, thou, if you could select nodes by Mod folder.

Link to comment
Share on other sites

6 hours ago, Burning Kan said:

would u mind sharing it here,sounds nice useing EC to deploy

sure thing!

Fair warning tho, Ive noticed a few bugs involving the math I think. but here it is anyways. The patch below has been simplified for the time being until I can figure out exactly whats going on. Its also safe to assume these patches are NOT compatible with MKS currently, But I haven't tested it to that extent yet. Currently Im only working with SSPXR and its dependencies as a 'stockalike patch'

Spoiler

@PART:HAS[@MODULE[ModuleDeployableCentrifuge]]
{
    @mass *= 0.4
    
    @MODULE[ModuleDeployableCentrifuge]
    {
        DeployResource = ElectricCharge
        DeployResourceAmount = #$../mass$
        @DeployResourceAmount *= 100
        
        @CrewSkillNeeded =
    }
}

I will use the Pilgrim Centrifuge as an example; Editing the mass to 0.4 original mass. It becomes 4500kg(4.5t). However the DeployResourceAmount doesn't calculate with kg as the unit but rather the TON unit. It took me a bit to figure it out, but for this reason Ive kept things as simple as I can before moving forward with a more complicated patch. at 4500kg(4.5t) the DeployResourceAmount*100 becomes 450EC. Weird right?

Patch snip below; located in StationPartsExpansionRedux\Patches\SSPXR-MKS-Extras. Un-Modified with the exception of the NEEDS pass being removed and changing MaterialKits to Electric Charge. However it causes the deploy amount required to be way more than I would like, which is why Ive simplified it to my liking..for now.

Spoiler

@PART:HAS[@MODULE[ModuleDeployableCentrifuge]]
{
    DeployedMass = #$mass$
    @mass *= 0.4
    
    @MODULE[ModuleDeployableCentrifuge]
    {
        DeployResource = ElectricCharge
        DeployResourceAmount = #$../DeployedMass$
        @DeployResourceAmount *= 600
        %DeployedMassModifier = #$../DeployedMass$
        @DeployedMassModifier *= 0.6
    }
}

Cheers! Ohh Ive also added the lack of needing engineers to deploy, but of course you can always delete "@CrewSkillNeeded =" and keep it at its default requirements. But it makes it easier for me to test either way.

Edited by Jesusthebird
Link to comment
Share on other sites

Thanks for the warning ,test it when i start my kerbalismcareer(few weeks),i dont want to use MKS that why i need to deploy with EC

7 hours ago, Jesusthebird said:

doesn't calculate with kg as the unit but rather the TON unit

AFAIK in ksp all is calculated in metric tons so 1kg is 0.001

and nice ,will try it with engineer depency when the time come ,Cheers

Link to comment
Share on other sites

Hello everyone. I have a little question to ask. Is relates to variable, and giving them a value by picking it up from other file.

Situation:

Spoiler

a.cfg is a file located in /GameData/
b.cfg is a file located in /GameData/c/d/e

Code in a.cfg is:
F
{
G = h // where G is say name and h = bar
}

Code in b.cfg is:
I
{
//some stuff
%J = #$../../../F[G]$ //create variable
MODULE:HAS[#J[h]]
{
// some more stuff, including name = say foo
}
!J = 0 // delete variable
}

A few questions:

Spoiler

1. Is $../../../ the correct level to interact with code in a.cfg?
2. Will %J = #$../../../F[G]$ pick up the value of h (i.e. bar) from a.cfg?
3. Is the :HAS test a valid test to see if G from a.cfg is h (i.e. bar)?
4. Will MODULE:HAS[#J[h]] create a MODULE called foo?

Thanks for taking a look and I hope I am have it right :)

Link to comment
Share on other sites

31 minutes ago, Apaseall said:

Hello everyone. I have a little question to ask. Is relates to variable, and giving them a value by picking it up from other file.

A few questions:

  Hide contents

1. Is $../../../ the correct level to interact with code in a.cfg?
2. Will %J = #$../../../F[G]$ pick up the value of h (i.e. bar) from a.cfg?
3. Is the :HAS test a valid test to see if G from a.cfg is h (i.e. bar)?
4. Will MODULE:HAS[#J[h]] create a MODULE called foo?

Thanks for taking a look and I hope I am have it right :)

  1. You want %J = #$@F[g]/h$ to paste a variable from a different top-level node (@ tells it to look at the top level)
  2. You're missing the /h part
  3. :HAS is not valid when creating a node.  It checks the node you're modifying, so if you had @MODULE:HAS[...] that would check the conditions on the existing MODULE node
  4. See 3
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...