Jump to content

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


sarbian

Recommended Posts

It seems the % (create-or-change) operator is not working on nodes?

My code is:


@PART[foo]
{
%MODULE[ModuleGimbal]
{
%gimbalTransformName = thrustTransform
%gimbalRange = 0.5
}
}

But the engine still shows up having no vectoring range in VAB. It works if I add it directly to the part cfg.

Link to comment
Share on other sites

Suggestion on syntax:

When modifying, @NODE[blah] {...} affects a node, while !NODE[blah] removes a node; likewise, @PROPERTY=... affects a property, while !PROPERTY removes a property.

For consistency's sake, when searching, :HAS[@NODE[blah]] should match on having a node, while :HAS[!NODE[blah]] should match on not having a node. Likewise, :HAS[@PROPERTY] should match on having a property, while :HAS[!PROPERTY] should match on not having that property (note the lack of [] if it's a property).

So this:


@PART[*]:HAS[~TechRequired[]]:Final

should really look like this:


@PART[*]:HAS[!TechRequired]:Final

if we want a tight, consistent language.

That said, it's of course your baby right now - but I'd strongly advise considering my recommendation; I know a thing or two about language and script design.

One thing you need to be very mindful of, is that eventually Squad will catch up with you - and on that day, you want them to be able to implement their own version of your parser from scratch, without your help, so that mod authors everywhere won't have to redo everything in their cfg files. Every change you make to ModuleManager's CFG syntax is a change that needs to make absolute intuitive sense, AND be easy to write a parser for, or you open the temptation for Squad to just do their own thing and throw your design out the window.

Edited by ialdabaoth
Link to comment
Share on other sites

Fair points. I have no idea to why I used ~

You are right that as I add new feature the need for a true parser is rising. It just seems going overboard for such a simple addon. If you have an advice on a tool/method I should use I would welcome it.

I would be glad if squad catched up, since right now some feature are impossible with the public API.

Link to comment
Share on other sites

Fair points. I have no idea to why I used ~

You are right that as I add new feature the need for a true parser is rising. It just seems going overboard for such a simple addon. If you have an advice on a tool/method I should use I would welcome it.

I would be glad if squad catched up, since right now some feature are impossible with the public API.

I assume you used ~ because that's how I did it when I submitted my code fragment and I did it that way because it was a quick way for me to work around the bracket issue with properties while staying within the confines of how the parser worked at the time. (back when it was 1.3 + Sarbian's MM Extensions)

Consistifying the syntax is definitely a good thing. (yeah I know, that's not really a word...)

Link to comment
Share on other sites

I'm trying to alter the energy usage of the command and I can't seem to get it to work. The following appears to have no effect:

@PART[*]:HAS[@MODULE[ModuleCommand],#CrewCapacity[3]]:Final
{
@MODULE[ModuleCommand]
{
@RESOURCE[ElectricCharge]
{
@rate = 1 // 0.5 for coms, 0.1666666 for operation per kerbal
}
}
}

Link to comment
Share on other sites

Because there is no RESOURCE block to change. They exist only for the unmanned pods where command modules cost EC; manned pods' command modules don't.

% was created for just this reason (create-or-change) but above SFJackBauer mentions issues with creating subnodes.

Link to comment
Share on other sites

Because there is no RESOURCE block to change. They exist only for the unmanned pods where command modules cost EC; manned pods' command modules don't.

% was created for just this reason (create-or-change) but above SFJackBauer mentions issues with creating subnodes.

Huh. Okay. So where does a manned pod's default electrical usage come from? I need to change it!

Link to comment
Share on other sites

There isn't any, stock. :)

Instead do:

@PART[*]:HAS[@MODULE[ModuleCommand],#CrewCapacity[3]]:Final
{
@MODULE[ModuleCommand]
{
RESOURCE
{
name = ElectricCharge
rate = 1 // 0.5 for avionics, 0.1666666 for operation per kerbal
}
}
}

(Also I changed it to avionics, since the command module is avionics, and RT2 antenna module would represent comms. Plus, where's the extra 1kW coming from? It should be ~2EC/sec usage for a 3-person pod, IMO.)

Link to comment
Share on other sites

(Also I changed it to avionics, since the command module is avionics, and RT2 antenna module would represent comms. Plus, where's the extra 1kW coming from? It should be ~2EC/sec usage for a 3-person pod, IMO.)

I'm trying to make the other 1kW come from IonCross but at present I've not been able to successfully get its power consumption to change. I think it might be because I'm adding IonCross support to all pods in another .cfg file and this other one might be loading first. I'll try and combine them and see if that works.

Link to comment
Share on other sites

Is there a way to prioritize :Final blocks? I have a patch I want to apply but it's being overridden by RealismOverhaul. I thought I saw somewhere there was a way to do this, but I've digging through forum posts to no avail.

Link to comment
Share on other sites

Another question. The following block should, as far as I can tell, only apply to parts that do not have a LifeSupportModule module, and that do have a crew capacity of 1:

@PART[*]:HAS[!MODULE[LifeSupportModule], #CrewCapacity[1]]:Final
{
MODULE
{
name = LifeSupportModule
}
}

However, this gets applied to every part. What did I miss?

Link to comment
Share on other sites

Remove the space after the coma

RealismOverhaul hsuld not use :Fianl, but they may have the need to. If you want a patch to be applied last you should try to put it in a directory named zzz_something

Edited by sarbian
Link to comment
Share on other sites

Remove the space after the coma

Whoa, really? Does nobody trim their tokens anymore?...

... I'm a grumpy old coder, stop laughing at me. :)

RealismOverhaul hsuld not use :Fianl, but they may have the need to. If you want a patch to be applied last you should try to put it in a directory named zzz_something

I'll give it a shot. Thank you!

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