Jump to content

Module Manager help [Resource funny business]


Recommended Posts

Hey there everybody!

I am looking for help with a project I am working on.

I have successfully created a new resource, which has a negative mass. This is in hopes of making a mass-reducing set of parts.

The annoying thing is, I cannot reduce the mass of any part that does not have access to this resource.

So, I was wondering if anybody out there could help me with a couple ideas:

A) A script/mod that will put a value of my resource on every attached part of the ship, with a max value = to its mass.

or

B) going off a "fuel lines" idea, I would also be OK if the part I made only reduced the mass of its self, and the part it's attached to (right now its a surface attached part.)

and, in addition to those above,

C) I'd love for this resource to "Decay" rather quickly. And while I could write it as a generator (of a negative value) onto the part, it wouldn't help much when the player could get the ship to 0 mass, and then just eject the generators, and not worry about the decay. So, I'd like help getting the shortened life-span as part of the "RESOURCE_DEFINITION.cfg" or perhaps the resourcename.cfg file.

Thank you in advance for any help you can offer!

- A

Link to comment
Share on other sites

Question A is doable, you will just have to find the MM script for all parts, it's something like:

@PART
{
RESOURCE
}

But find a reference on GitHub, that just from memory and probably has a typo.

On B, that is doable, but would require a PartModule with custom code on each part you wanted to reduce the mass on.

And C would require a ModuleGenerator of some sort, either your own custom one or the stock ModuleGenerator. There is no code in the stork resource system for resource decay, you have to do it yourself.

One catch is to make sure that the stock resource system can even handle negative numbers, zero is an empty tank and there may be a check to make sure the tank resource amount can never go below that.

D.

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