Jump to content

[1.8.1] Stock RewardFunds are broken???


Recommended Posts

I've got a very simple contract:

    // ************************ PARAMETERS ************************
    PARAMETER {
        name = VesselGroup
        type = VesselParameterGroup        
        title = Build and fly a rocket        
        PARAMETER {
            name = NewVessel
            type = NewVessel
            title = Launch a New Vessel
        }        
        PARAMETER {
            name = Crewmembers
            type = HasCrew
            minCrew = 0
            maxCrew = 0
            title = Uncrewed
        }        
        PARAMETER {
            name = ReachStateFlying
            type = ReachState
            situation = FLYING
            minRateOfClimb = 250
        }
           PARAMETER {
            name = ReachStateLaunch
            type = ReachState
            minAltitude = 2500
            title = Reach @minAltitude meters
            hideChildren = true
        }
           PARAMETER {
            name = ReachStateLaunch2
            type = ReachState
            minAltitude = 5000
            title = Reach @minAltitude meters
            hideChildren = true
            optional = true
            rewardFunds = 2500
        }
           PARAMETER {
            name = ReachStateLaunch3
            type = ReachState
            minAltitude = 10000
            title = Reach @minAltitude meters
            hideChildren = true
            optional = true
            rewardFunds = 5000
        }
    }

Aq6vGd4.png

As you can see, there's several optional contract which reward their own funds upon completion.

And yet...

62zSn6M.png

...clearly no such thing is happening.

So something's broken. Is is CC?

Peering through CC's code...

From somewhere this thing called GenerateContract is run on a list of ConfiguredContracts. ConfiguredContract has got an Initalize(contractType) method which runs a method called GenerateParameters off of contractType which just runs ParameterFactor.GenerateParameters and makes sure it returns true. ParameterFactory.GenerateParameters calls this Generate method for each parameter that is stuck onto ContractParameter and Generate runs the SetFunds/Reputation/Science methods as provided by stock.

And then in the SetState method for ContractConfiguratorParameter (which extends stock's ContractParameter it runs stock's AwardCompletion which presumably rewards these funds etc. So all the relevant stuff is in the black box that stock handles.
 
Help! What do I do from here?
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...