Jump to content

Can someone have a look at this FSFuelSwitchPatch?


MatterBeam

Recommended Posts

Hi.

I'm trying to add Metal and RocketParts to every tank which originally holds Ore.

@PART[*]:HAS[@RESOURCE[Ore],!MODULE[FSfuelSwitch]] 
{   
    %Ore = #$RESOURCE[Ore]/maxAmount$
    Metal = #$RESOURCE[Ore]/maxAmount$
	RocketParts = #$RESOURCE[Ore]/maxAmount$
    
    %totalCap = #$RESOURCE[Ore]/maxAmount$
    @totalCap += #$RESOURCE[Metal]/maxAmount$
	@totalCap += #$RESOURCE[RocketParts]/maxAmount$
    
    %tempVar = 0
    %dryCost = 0
    
    @dryCost = #$cost$
    
    %OreCost = 0
    MetalCost = 0
	RocketPartsCost = 0
    
    // Cost Ore
    @tempVar = #$RESOURCE[Ore]/maxAmount$
    @tempVar *= 0.8
    
    @dryCost -= #$OreCost$
    @cost -= #$OreCost$
    
    // Cost Metal
    @tempVar = #$totalCap$
    @tempVar *= 0.8
    @MetalCost += #$tempVar$
    
    // Cost RocketParts
    @tempVar = #$totalCap$
    @tempVar *= 0.18
    @RocketPartsCost += #$tempVar$
    
    @tempVar = 0
    MODULE {
        name = FSfuelSwitch


        resourceNames = Ore,Metal;RocketParts


        resourceAmounts = #$../Ore$,$../Metal$;$../RocketParts$;$../totalCap$


        tankCost = #$../OreCost$;$../MetalCost$;$../RocketPartsCost$
        displayCurrentTankCost = true


        hasGUI = true
        showInfo = true
        
        availableInFlight = false
        availableInEditor = true


        basePartMass = #$../mass$
        tankMass = 0;0;0;0;0
    }
    
    !RESOURCE[Ore] {}
    !RESOURCE[Metal] {}
	!RESOURCE[RocketParts] {}
    
}

I don't understand any of the totalcap stuff, but I think I made the rest of the modifications correctly.

Please tell me if I did everything alright. Thanks.

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