Jump to content

How to use PartResourceList


Recommended Posts

Hello everyone! 

I have a question about PartResourceList. I am wondering how to implement this into my code, right now it looks like this, but is throwing a CS0120 error. I am trying to remove the resource capacity from the fuel tanks that this partModule is implemented on, and then add it back later. 

Can anyone give any advice for how to fix this?

Edited by Benjamin Kerman
Link to comment
Share on other sites

You want to remove it from your part, not some arbitrary place. So 

PartResourceList.Remove(Fuel1Name);

 should be 

part.Resources.Remove(Fuel1Name); 

Same thing line 140.

What 's that supposed to do ? 

 

Also line 24 :

public double FuelTypes; //FuelTypes is either equal to one or two to say how many types of fuel there are stored in the tank. 

If it is the number of fuel type then it should be an int. You can not have 1.5 fuel types.

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