Jump to content

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


sarbian

Recommended Posts

I can't see anything syntactically wrong (though obviously there must be something wrong) however I'm wondering why you're setting the maxAmount, and then multiplying it by 2? Why not just set it to the multiplied by 2 amount?

If I had to guess, I'd say that's the problem. Maybe ModuleManager doesn't expect you to reference the same variable twice.

Well thats because the code comes from the original TACLS add resources file. That file that adds life support supplies to all capsules (but because Mk3-9 doubles as pod, has a minimum crew = 0, which eliminates it from passing TACLS's check, and does doesn't get resources by default). Heres that code:


@PART[*]:HAS[#CrewCapacity[>0],@MODULE[ModuleCommand]:HAS[#minimumCrew[>0]],!RESOURCE[Food]]:FOR[TacLifeSupport]
{
RESOURCE
{
name = Food
amount = 1.097
maxAmount = 1.097
@amount *= #$/CrewCapacity$
@maxAmount *= #$/CrewCapacity$
}
RESOURCE
{
name = Water
amount = 0.725
maxAmount = 0.725
@amount *= #$/CrewCapacity$
@maxAmount *= #$/CrewCapacity$
}
RESOURCE
{
name = Oxygen
amount = 111.038
maxAmount = 111.038
@amount *= #$/CrewCapacity$
@maxAmount *= #$/CrewCapacity$
}
RESOURCE
{
name = CarbonDioxide
amount = 0
maxAmount = 95.913
@maxAmount *= #$/CrewCapacity$
}
RESOURCE
{
name = Waste
amount = 0
maxAmount = 0.1
@maxAmount *= #$/CrewCapacity$
}
RESOURCE
{
name = WasteWater
amount = 0
maxAmount = 0.924
@maxAmount *= #$/CrewCapacity$
}
}

Now changing the conditions at the top, to nothing but @PART[mk3-9pod]:FINAL and having nothing happen, I assumed the "#$/CrewCapacity$" might be the problem, due to the mk3-9's minimum crew = 0, and changed it to "2" as thats the pods crew capacity. Still nothing. Heres the code I'm using now, and its still not working:


@PART[mk3-9pod]:FINAL
{
RESOURCE
{
name = Food
amount = 2.194
maxAmount = 2.194
}
RESOURCE
{
name = Water
amount = 1.450
maxAmount = 1.450
}
RESOURCE
{
name = Oxygen
amount = 222.076
maxAmount = 222.076
}
RESOURCE
{
name = CarbonDioxide
amount = 0
maxAmount = 191.826
}
RESOURCE
{
name = Waste
amount = 0
maxAmount = 0.2
}
RESOURCE
{
name = WasteWater
amount = 0
maxAmount = 1.848
}
}

Link to comment
Share on other sites

Have you tried keeping the original :FOR[TacLifeSupport] instead of :FINAL ?

I have vague memories of people suggesting not using :FINAL if you could avoid it in any possible way, and instead always use the :FOR clause instead.

I believe I added the ":FINAL", again because things weren't working. I'll give it a try now. On another topic. Is there a way to delete a "module" from a part? I have been trying various things, but nothing seem to be working. (Trying to delete the Orbital Survey module from the SurveyScanner. I'm using Scansat, so I won't need the Orbital Survey part)

EDIT:

just tried the following, with no luck

@PART[mk3-9pod]:FOR[TacLifeSupport]
{
RESOURCE
{
name = Food
amount = 2.194
maxAmount = 2.194
}
RESOURCE
{
name = Water
amount = 1.450
maxAmount = 1.450
}
RESOURCE
{
name = Oxygen
amount = 222.076
maxAmount = 222.076
}
RESOURCE
{
name = CarbonDioxide
amount = 0
maxAmount = 191.826
}
RESOURCE
{
name = Waste
amount = 0
maxAmount = 0.2
}
RESOURCE
{
name = WasteWater
amount = 0
maxAmount = 1.848
}
}

Link to comment
Share on other sites

I believe I added the ":FINAL", again because things weren't working. I'll give it a try now. On another topic. Is there a way to delete a "module" from a part? I have been trying various things, but nothing seem to be working. (Trying to delete the Orbital Survey module from the SurveyScanner. I'm using Scansat, so I won't need the Orbital Survey part)

EDIT:

just tried the following, with no luck

@PART[mk3-9pod]:FOR[TacLifeSupport]
{
RESOURCE
{
name = Food
amount = 2.194
maxAmount = 2.194
}
RESOURCE
{
name = Water
amount = 1.450
maxAmount = 1.450
}
RESOURCE
{
name = Oxygen
amount = 222.076
maxAmount = 222.076
}
RESOURCE
{
name = CarbonDioxide
amount = 0
maxAmount = 191.826
}
RESOURCE
{
name = Waste
amount = 0
maxAmount = 0.2
}
RESOURCE
{
name = WasteWater
amount = 0
maxAmount = 1.848
}
}

Potentially stupid question

Have you checked that the name of the part is correct? ModuleManager is case sensitive

Link to comment
Share on other sites

Potentially stupid question

Have you checked that the name of the part is correct? ModuleManager is case sensitive

No I found the problem, and its quite embarrassing. There was a "}" missing from a previous entry. I figured something like that had to be the problem, as yet another seemingly perfect modification didn't work. Live and learn I guess

Link to comment
Share on other sites

I have another question. I want to make a drill, using the stock drill, that extracts MetalicOre, but also changes its textures, so its visually different. This is my attempt;

// Make Stock Drill for EPL //

+PART[RadialDrill]:NEED[ExtraplanetaryLaunchpads]
{
@name = RadialMetalicDrill
-mesh = TriBitDrill.mu
@title = 'Drill-O-Matic' Metalic Ore Excavator
MODEL
{
model = Squad/Parts/Resources/RadialDrill/TriBitDrill
texture = PersonalChanges/MetalicDrill
}
@MODULE[ModuleResourceHarvester]
{
@ResourceName = MetalOre
@StartActionName = Start Metalic Ore Harvester
@StopActionName = Stop Metalic Ore Harvester
}
}

Functionally its working, but the texture does change. I have tried saving the texture both as png, and dds, but it doesn't work either way. Naturally I have made sure the pathing and names are correct.

Link to comment
Share on other sites

I have another question. I want to make a drill, using the stock drill, that extracts MetalicOre, but also changes its textures, so its visually different. This is my attempt;

// Make Stock Drill for EPL //

+PART[RadialDrill]:NEED[ExtraplanetaryLaunchpads]
{
@name = RadialMetalicDrill
-mesh = TriBitDrill.mu
@title = 'Drill-O-Matic' Metalic Ore Excavator
MODEL
{
model = Squad/Parts/Resources/RadialDrill/TriBitDrill
texture = PersonalChanges/MetalicDrill
}
@MODULE[ModuleResourceHarvester]
{
@ResourceName = MetalOre
@StartActionName = Start Metalic Ore Harvester
@StopActionName = Stop Metalic Ore Harvester
}
}

Functionally its working, but the texture does change. I have tried saving the texture both as png, and dds, but it doesn't work either way. Naturally I have made sure the pathing and names are correct.

I think you need to define the name of the texture like this:

MODEL
{
model = [COLOR=#333333]Squad/Parts/Resources/RadialDrill/TriBitDrill
texture = [/COLOR][COLOR=#ff0000]original_texture_name[/COLOR][COLOR=#333333], [/COLOR][COLOR=#333333]PersonalChanges/MetalicDrill
}

I did it like that in my mini mods and it works :)

Link to comment
Share on other sites

I think you need to define the name of the texture like this:

MODEL
{
model = [COLOR=#333333]Squad/Parts/Resources/RadialDrill/TriBitDrill
texture = [/COLOR][COLOR=#ff0000]original_texture_name[/COLOR][COLOR=#333333], [/COLOR][COLOR=#333333]PersonalChanges/MetalicDrill
}

I did it like that in my mini mods and it works :)

Yes that worked like a charm! However now the problem is my texture is all weird. I took the original texture, re-saturated it (so it became blue), and saved it with photoshop. Do I have to do some middle step, in order to make sure the game knows how to load the texture probably?

Link to comment
Share on other sites

Yes that worked like a charm! However now the problem is my texture is all weird. I took the original texture, re-saturated it (so it became blue), and saved it with photoshop. Do I have to do some middle step, in order to make sure the game knows how to load the texture probably?

idk about that, I would need to see the old texture compared to the new one

Link to comment
Share on other sites

idk about that, I would need to see the old texture compared to the new one

Basically its the same, except all the brown has turned blue. But I noticed the MKS is already config'd to work with both NFT and EL, so I have no need to dabble in making a drill myself. On another note though. If I wanted to change the electrical input needed for a drill with the code:


MODULE
{
name = ModuleResourceHarvester
HarvesterType = 0
Efficiency = 1
ResourceName = Substrate
ConverterName = Substrate Drill
StartActionName = Start Substrate Drill
StopActionName = Stop Substrate Drill
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 6
}
}

MODULE
{
name = ModuleResourceHarvester
HarvesterType = 0
Efficiency = 1
RecipeInputs = ElectricCharge,6
ResourceName = MetallicOre
ConverterName = MetallicOre Drill
StartActionName = Start MetallicOre Drill
StopActionName = Stop MetallicOre Drill
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 6
}
}

MODULE
{
name = ModuleResourceHarvester
HarvesterType = 0
Efficiency = 1
RecipeInputs = ElectricCharge,6
ResourceName = Uraninite
ConverterName = Uraninite Drill
StartActionName = Start Uraninite Drill
StopActionName = Stop Uraninite Drill
INPUT_RESOURCE
{
ResourceName = ElectricCharge
Ratio = 6
}
}

But only change, say the Uraninite drill process. How would I go about changing it? I'm assuming I'll have to check for the "uraninite", or define that its the 3th module I want to change, the question is how though. My efforts has only allowed me to change the first one, that is the substract, doing the following;


@PART[MKS_DRILL_*]:NEED[ExtraplanetaryLaunchpads]:FINAL
{
@MODULE[ModuleResourceHarvester]
{
@RecipeInputs = ElectricCharge,10
@INPUT_RESOURCE
{
@Ratio = 10
}
}
}

Link to comment
Share on other sites

Is it possible to insert a new module into a specific index in the part.cfg file with MM? (It states so in the instructions, but I have not been able to get it working).

I am needing this for a partModule that has functions that need to run before other modules initialize (specifically, it needs to populate models and transforms prior to moduleEngines initializing and grabbing its transforms; hence my module needs to be inserted before the moduleEngines).

for example:


+PART[partName]
{
@name = exampleClonedPart
MODULE,0
{
name = insertedModuleName
//rest of the inserted module fields
}
//rest of the patch
}

results in a URL/database dump of (excerpted for brevity)


PART
{
name = exampleClonedPart

//all the other stuff from the original file + patches are here, and exactly as they are supposed to be, except...
//then, at the end of the file, it inserts the new/inserted module.... with the index value still attached, which does not load properly
MODULE,0
{
name = insertedModuleName
//the rest of the module fields are intact and correct
}
}

I did a fairly extensive search on the thread regarding this issue, and all I came across were multiple posts with the syntax examples saying that it is possible/supported. Is this in error, or is my patch structure incorrect, or?

(https://github.com/sarbian/ModuleManager/wiki/Module-Manager-Syntax#insert)

Thanks for your help and understanding.

Link to comment
Share on other sites

Is it possible to insert a new module into a specific index in the part.cfg file with MM? (It states so in the instructions, but I have not been able to get it working).

I am needing this for a partModule that has functions that need to run before other modules initialize (specifically, it needs to populate models and transforms prior to moduleEngines initializing and grabbing its transforms; hence my module needs to be inserted before the moduleEngines).

I did a fairly extensive search on the thread regarding this issue, and all I came across were multiple posts with the syntax examples saying that it is possible/supported. Is this in error, or is my patch structure incorrect, or?

(https://github.com/sarbian/ModuleManager/wiki/Module-Manager-Syntax#insert)

Thanks for your help and understanding.

I haven't used that feature myself. From comparing your example with the syntax article, it looks like it should work.

I tried it out myself and I couldn't get it to work either. I even tried cloning the part without inserting the module during a :FIRST pass and then going back and inserting it in a :FINAL pass (just in case there's some weird issue with doing it in a cloning operation) and that didn't work either.... so it looks like a bug to me. Unless the article itself is wrong.

Link to comment
Share on other sites

I haven't used that feature myself. From comparing your example with the syntax article, it looks like it should work.

I tried it out myself and I couldn't get it to work either. I even tried cloning the part without inserting the module during a :FIRST pass and then going back and inserting it in a :FINAL pass (just in case there's some weird issue with doing it in a cloning operation) and that didn't work either.... so it looks like a bug to me. Unless the article itself is wrong.

Okay, thanks for your quick response and confirmation.

I suppose I'll have to see if I can work around this on the plugin end of things then.

Link to comment
Share on other sites

Interesting bug occurs : Place a '/' in any [#author] field for something to not load. Log file. EDIT : whee im dumb. Player.log

And the patch I'm doing it with

@PART
[*]:HAS[#author[BahamutoD],HAS[#author[LORDPrometheus],HAS[#author[LORDPrometheus/ BahamutoD],HAS[#author[Harpwner],HAS[#author[VintageXP],HAS[#author[Max Simm],[!MODULE[BDAdjustableLandingGear],!MODULE[ModuleWheel],!MODULE[Animated*]]:AFTER[BDArmory]:NEEDS[BDArmory]
{
@category = none
}

yey i read the op after posting ooo

Edited by DuoDex
Link to comment
Share on other sites

You have a space after the /. That would be even more evil in MM eyes.

edit :

[LOG 17:53:31.318] Config(RESOURCE_DEFINITION) BDArmory/Resources/Countermeasures/CMChaff

[LOG 17:53:31.318] Config(@PART[*]:HAS[#author[bahamutoD],HAS[#author[LORDPrometheus],HAS[#author[LORDPrometheus/) BDArmorySorting/BDArmorySorting/@PART[*]:HAS[#author[bahamutoD],HAS[#author[LORDPrometheus],HAS[#author[LORDPrometheus/

[LOG 17:53:31.318] Config(PART) BahaSP/Parts/125vectorjet/part/bd125vectorjet

Line cut at space !

Link to comment
Share on other sites

Replace the space with a "?"

Tried per logfile's suggestion, still won't load, but with a different error, logfile on request.

EDIT : Okay, so there were two spaces. Sue me ;). This why I don't code, and need to take a course entitled "Introductory Lessons on Not Being A Stupid Jackass". Thanks for your help!

EDIT 2 : I'm back, with 100% more stupidity! It still wont' load ;_;

Edited by DuoDex
Link to comment
Share on other sites

EDIT 2 : I'm back, with 100% more stupidity! It still wont' load ;_;

In addition to the space, there is a mismatching number of brackets. For every [ there must be a matching ]

The syntax there also looks a bit screwy; not sure it's legal to separate HAS[] with commas... I'm still trying to wade through that line

Edit: Maybe if you describe what the desired and expected result is?

Edited by Starwaster
Link to comment
Share on other sites

In addition to the space, there is a mismatching number of brackets. For every [ there must be a matching ]

The syntax there also looks a bit screwy; not sure it's legal to separate HAS[] with commas... I'm still trying to wade through that line

Edit: Maybe if you describe what the desired and expected result is?

I was hoping to remove the category from every part with those authors excepting the parts with the mentioned modules.

@PART
[*]:HAS[#author[BahamutoD],!MODULE[BDAdjustableLandingGear],!MODULE[ModuleWheel],!MODULE[Animated*]]:AFTER[BDArmory]:NEEDS[BDArmory]
{
@category = none
}

works, but I'm not sure how to expand it.

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