Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceCapacity and Resource.Quantity returns 0 values #702

Open
hawkengineer opened this issue Feb 22, 2021 · 0 comments
Open

ResourceCapacity and Resource.Quantity returns 0 values #702

hawkengineer opened this issue Feb 22, 2021 · 0 comments

Comments

@hawkengineer
Copy link

Using the code below, CC returns a value of 0 for both capacity and quantity of any resource for the target vessel. Target vessel selected has resources greater than 0.

DATA
{
	type = Vessel
	requiredValue 	= true
	uniquenessCheck = CONTRACT_ACTIVE
	targetVessel1	 = AllVessels().Where(v => v.VesselType() == Station && v.IsOrbiting() ).SelectUnique()

	title = Select Space Station that is in orbit about a orbital body
}

DATA
{
	type = Double
	requiredValue 	= true
	rcap 			= @/targetVessel1.ResourceCapacity(MonoPropellant)
	rcur 			= @/targetVessel1.ResourceQuantity(MonoPropellant)
	rspace 			= @/rcap - @/rcur
	rpercent 		= @rcur/@rcap
	//
	MonoAdd			= Round(@/rspace * 0.80)   		// Increase to 80% of avaialable space
	MonoNew			= Round(@/rcur + @/MonoAdd)   	// Determine the final amount on the station after the resupply mission
	
	title 			= Get current status on resource on the station and calculate amount to add to resupply
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant