Jump to content

Resource needs of a vessel Part.


Recommended Posts

Hello. I cant figure it out by myself i am searching on google for hours and nothing :( So maybe somebody know :)

By "part.Resources" list i can get the resources which are being hold by the current part. But how can i get the resource needs of the current part ( that value which is shown in VAB , like ElectricCharge : 0.4/s )

THX

Link to comment
Share on other sites

I poked around for a minute and didn't find exactly what you want... but..... but my GUESS is that since the resource requirement is tucked inside the partmodule definitions in the .cfg files that you're going to have to iterate through all of the partmodules in the part to find it. I found the fancy text version that the VAB displays -

foreach (Part part in this.vessel.parts){

foreach (PartModule pm in part.Modules)

{

ScreenMessages.PostScreenMessage(pm.GetInfo().ToString());

}

}

But that shows you all of the VAB info lines, and they're formatted as descriptive text... something like "-Electric Charge - 27.0/minute." You could certainly work backwards from here, but I'm sure there's a way to get at the actual use rate. It may be somewhere in the partmodule fields collection?

Link to comment
Share on other sites

Yes i need something like that , i am working on a mode for Remote Tech 2 , this use rate will be a helping info panel inside VAB. It will calculate the longest night time your satellite will occur after that iterate through all of the partmodules and sum all the Electric Charges frome there it will tell you how many batteries you will need or how manny extra you need to add in case you already have batteries placed on it.

Anyway it would be great if there is a direct way , getting the value out from the text would be very tricky.

Edited by bandi94
Link to comment
Share on other sites

Potential gotcha: the rate given for resource consumption in the Editor (VAB/SPH) is for max consumption. Actual rate in flight may vary due to throttle and other factors (not necessarily linearly!).

Yes , i need the max consumption , but how can i actually get that value , preferable in double value.

Link to comment
Share on other sites

It will calculate the longest night time your satellite will occur after that iterate through all of the partmodules and sum all the Electric Charges frome there it will tell you how many batteries you will need or how manny extra you need to add in case you already have batteries placed on it.

Does Fusebox provide the functionality you want?

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