Jump to content

Can't make my cfg file work correctly, please take a look . . .


VapourPhase

Recommended Posts

Hi everyone,

I'm trying to make a VERY simple cfg file, and I can't get the damn thing to work right. I just want to modify the electrical charge and cargo capacity of a simple part -

@PART[kv1Pod]
{
    @author = C.McDowall
    
    @RESOURCE[ElectricCharge]
    {
    amount = 500 // 10x ORIGINAL VALUE
    maxAmount = 500 // 10x ORIGINAL VALUE
    }
    
    @MODULE[ModuleInventoryPart]
    {
    InventorySlots = 3 // 3 FOR EACH KERBAL
    packedVolumeLimit = 100 // 100 FOR EACH KERBAL
    }
}

The second part for Inventory slots works fine, but not the eclectrical charge ? I'm obviously doing something wrong, but I can't for the life of me work out what ??

Could someone please take a look and advise :)

Thanks in advance

Link to comment
Share on other sites

1 hour ago, VapourPhase said:

Hi everyone,

I'm trying to make a VERY simple cfg file, and I can't get the damn thing to work right. I just want to modify the electrical charge and cargo capacity of a simple part -

@PART[kv1Pod]
{
    @author = C.McDowall
    
    @RESOURCE[ElectricCharge]
    {
    amount = 500 // 10x ORIGINAL VALUE
    maxAmount = 500 // 10x ORIGINAL VALUE
    }
    
    @MODULE[ModuleInventoryPart]
    {
    InventorySlots = 3 // 3 FOR EACH KERBAL
    packedVolumeLimit = 100 // 100 FOR EACH KERBAL
    }
}

The second part for Inventory slots works fine, but not the eclectrical charge ? I'm obviously doing something wrong, but I can't for the life of me work out what ??

Could someone please take a look and advise :)

Thanks in advance

The default operation for Module Manager is "insert" so without an operator added to the line, it's simply adding a second set of amount definitions to the existing ElectricCharge node. If it's working for the Inventory bit I would guess there aren't already definitions in place or your lines got dropped in before the existing ones. At any rate you should just need a couple more @ operators.

@PART[kv1Pod]
{
    @author = C.McDowall
    
    @RESOURCE[ElectricCharge]
    {
    @amount = 500 // 10x ORIGINAL VALUE
    @maxAmount = 500 // 10x ORIGINAL VALUE
    }
    
    @MODULE[ModuleInventoryPart]
    {
    InventorySlots = 3 // 3 FOR EACH KERBAL
    packedVolumeLimit = 100 // 100 FOR EACH KERBAL
    }
}

Link to comment
Share on other sites

  • 2 weeks later...

I'm trying to streamline this now to apply to all pods with 3 crew capacity instead of having one for each part, but I'm u sure of the commands to replace the

@PART[]

I've seen it somewhere as @PART[*]Has...

Or something like that, but I'm damned if I can find it now.

Any clues please Amigos ?

Link to comment
Share on other sites

why not try it this way:

PART[*]:HAS[#CrewCapacity[>0]:FOR[Me]
{
	@RESOURCE[ElectricCharge]
	{
		@amount *= #$../CrewCapacity$
		@maxAmount *= #$../CrewCapacity$
	}

	@MODULE[ModuleInventoryPart]
	{
		%InventorySlots = 3
		@InventorySlots *= #$../CrewCapacity$

		%packedVolumeLimit = 100
		@InventorySlots *= #$../CrewCapacity$
	}
}

EVA Fuel as well ?

Edited by zer0Kerbal
Link to comment
Share on other sites

2 hours ago, zer0Kerbal said:

why not try it this way:

PART[*]:HAS[#CrewCapacity[>0]:FOR[Me]
{
	@RESOURCE[ElectricCharge]
	{
		@amount *= #$../CrewCapacity$
		@maxAmount *= #$../CrewCapacity$
	}

	@MODULE[ModuleInventoryPart]
	{
		%InventorySlots = 3
		@InventorySlots *= #$../CrewCapacity$

		%packedVolumeLimit = 100
		@InventorySlots *= #$../CrewCapacity$
	}
}

EVA Fuel as well ?

Could you explain what the %, # and $ parts are doing, I have no clue what effects they are having lol I'm new to all this, so it might as well be writen in hieroglyphs at the moment :confused:. Is it something to do with multiplying the base amount ? I'd love to know how these codes all work.

Massive thanks for helping out, I really appreciate it : )

Link to comment
Share on other sites

certainly - IIRC (and sometimes they mean different things in different situations)

PART[*]:HAS[#CrewCapacity[>0]:FOR[Me]
{
	@RESOURCE[ElectricCharge] // means look at this NODE with this [KEY]
	{
		@amount *= #$../CrewCapacity$ // means look at this NODE and multiply (*=) its value by LOOKUP NODE [PART.CrewCapacity] (like a file directory - walk up one level with ../)
		@maxAmount *= #$../CrewCapacity$
	}

	@MODULE[ModuleInventoryPart]
	{
		%InventorySlots = 3 // means ADD or MODIFY NODE with this value (= 3) NOTE: & means ONLY ADD if doesn't exist
		@InventorySlots *= #$../CrewCapacity$

		%packedVolumeLimit = 100
		@InventorySlots *= #$../CrewCapacity$
	}
}

hopefully the comments help. :D

also have you seen this?

https://github.com/sarbian/ModuleManager/wiki/Module-Manager-Syntax

and you are most certainly welcome!

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