Jump to content

part.GetConnectedResourceTotals not returning all resource amounts


Recommended Posts

I'm working on bringing back the Engine Ignitor mod, and am a bit stuck on this.

It has a resource called HypergolicFluid

The engine ignitors have some, and I'm adding tanks which contain more of it.

The following code is only returning the amount of the resource in the part itself, it isn't getting any of it in the additional tanks, even though the tanks are surface-attached to a LFO tank which the engine is attached to.  The debug statement is showing that only the resource in the part itself is considered, it isn't getting anything else

int hypergolicFluidId = PartResourceLibrary.Instance.GetDefinition("HypergolicFluid").id;

if (part != null)
       part.GetConnectedResourceTotals(hypergolicFluidId, out _hypergolicFluidAmount, out _hypergolicFluidMaxAmount);

Debug.Log("hypergolicFluidId: " + hypergolicFluidId.ToString() +
	", _hypergolicFluidAmount: " + _hypergolicFluidAmount.ToString() +
	", _hypergolicFluidMaxAmount: " + _hypergolicFluidMaxAmount.ToString());

Anybody have any idea why this isn't working?

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