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

1.22.2 ArgumentOutOfRangeException: Argument is out of range: Parameter name: index #618

Closed
doktorstick opened this issue Jan 24, 2017 · 6 comments
Labels

Comments

@doktorstick
Copy link

I was perusing my log and noticed this. What got me to looking through the log is that some simple contract conditions aren't triggering (liking flying at X meters at Y speed, or orbital inclination of Y), whereas previously they were.

[EXC 08:44:05.383] ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
        System.Collections.Generic.List`1[System.String].get_Item (Int32 index)
        ContractConfigurator.Parameters.Rendezvous.OnUpdate ()
        Contracts.ContractParameter.Update ()
        Contracts.Contract.Update ()
        Contracts.ContractSystem.UpdateContracts ()
        Contracts.ContractSystem+<UpdateDaemon>c__Iterator9B.MoveNext ()
        UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)
@doktorstick
Copy link
Author

doktorstick commented Jan 24, 2017

Here you can see that a contract that started 25 Kerbin days ago (the Mun one) successfully registered the sub-criteria to start the 60-day countdown. However, flash forward a few weeks Real Life(tm) and a very similar contract--all save for the body (Kerbin instead of Mun)--doesn't work. My KER info for the orbit is shown for verification that the vessel is orbiting and the inclination and eccentricity are within range.
broken-contract

@doktorstick
Copy link
Author

From Mission Control:
broken-contract-2

@doktorstick
Copy link
Author

doktorstick commented Jan 24, 2017

In DMagic's science thread, I had posted about the problem. He popped over here and looked at the trace and came to the conclusion that the contract parameters are not being updated because the trace above is interrupting the scanning.

If it has to do with an active Rendezvous contract, I do have one--from Historical Progression, the Gemini 7 and 6A rendezvous.

It reads like a bug in CC; it may be exacerbated by something incorrect in Historical Progression. For reference, I've included the CONTRACT_TYPE definition here:

CONTRACT_TYPE
{
    name = Gemini-6
    group = ProjectGemini

    title = Gemini 7 & Gemini 6A
        agent = NASA

        sortKey = 141

    notes = Launch the Gemini 7 Spacecraft and Orbit for 14 days while also being the passive target for Gemini 6A Rendezvous
    synopsis = Launch the Gemini 7 Spacecraft and Orbit for 14 days while also being the passive target for Gemini 6A Rendezvous

    description = Gemini 7 was the fourth crewed Earth-orbiting spacecraft of the Gemini series, having been launched before Gemini 6A. It carried astronauts Frank Borman and Jim Lovell on the 14 day mission.\n\nGemini 6A was the fifth crewed Earth-orbiting spacecraft of the Gemini series, having been launched after Gemini 7, with the intent of making rendezvous with Gemini 7 in Earth orbit. The astronauts on the 26 hour mission were Walter Schirra and Thomas Stafford.\n\n<b><color=white>Significance:</color></b> Gemini 7 was the first mission to keep humans in space for 14 days and Gemini 6A was the first time two spacecraft rendezvoused in space.\n\n<b><color=white>Historical Launch Date:</color></b> December 4, 1965 and December 15, 1965

    completedMessage = Mission Success! The crew of Frank F. Borman, II and James A. Lovell, Jr spent nearly 14 days in space, making a total of 206 orbits. Their spacecraft was the passive target for the first manned space rendezvous performed by the crew of Gemini 6A. Its mission priorities were (1) to demonstrate a 2-week flight, (2) to perform stationkeeping with the Gemini launch vehicle stage 2, (3) to evaluate the 'shirt sleeve' environment and the lightweight pressure suit, (4) to act as a rendezvous target for Gemini 6, and (5) to demonstrate controlled reentry close to the target landing point. The crew members had three scientific, four technological, four spacecraft, and eight medical experiments to perform.

    minExpiry = 0
        maxExpiry = 0
        maxCompletions = 1
        weight = 999

        cancellable = false
        declinable = false

        targetBody = HomeWorld()


        // REWARDS
    rewardScience =     2
    rewardReputation =  5
    rewardFunds =               @HistoricalProgression:Kerbucks5

    advanceFunds =              @HistoricalProgression:Kerbucks8

        prestige = Significant

        REQUIREMENT
        {
                name = CompleteContract
                type = CompleteContract
                contractType = Gemini-5
                title = Complete @contractType Contract
        }

        DATA
        {
                type = double
                dayLength = @targetBody.RotationalPeriod()
                tenDays = @dayLength * 10
                title = 10 Days
        }

        PARAMETER
        {
                name = Gemini-7
                type = VesselParameterGroup
                define = Gemini-7
                title = Gemini 7
                disableOnStateChange = false
                completeInSequence = true

                PARAMETER
                {
                        name = NewVessel
                        type = NewVessel
                        hidden = true
                }
                PARAMETER
                {
                        name = HasCrew
                        type = HasCrew
                        minCrew = 2
                        maxCrew = 2
                        title = Have 2 crewmembers on board
                        hideChildren = true
                }
                PARAMETER
                {
                        name = Gemini7Orbit
                        type = Orbit
                        minAltitude = @targetBody.AtmosphereAltitude()
                        title = Orbit @targetBody
                        disableOnStateChange = true
                        hideChildren = true
                }
                PARAMETER
                {
                        name = Gemini7Duration
                        type = Duration
                        duration = @/tenDays
                        preWaitText = Waiting to reach orbit
                        waitingText = Orbiting for @duration
                        completionText = Orbits Complete! You may fire retros when ready
                        disableOnStateChange = true
                }
        }
        PARAMETER
        {
                name = Gemini-6
                type = VesselParameterGroup
                define = Gemini-6
                title = Gemini 6
                disableOnStateChange = false
                completeInSequence = true

                PARAMETER
                {
                        name = NewVessel
                        type = NewVessel
                        hidden = true
                }
                PARAMETER
                {
                        name = HasCrew
                        type = HasCrew
                        minCrew = 2
                        maxCrew = 2
                        title = Have 2 crewmembers on board
                        hideChildren = true
                }
        }
        PARAMETER
        {
                name = Rendezvous
                type = Rendezvous
                distance = 20
                title = Rendezvous Gemini 6A with Gemini 7
                hideChildren = true
                disableOnStateChange = true
        }
}

@doktorstick
Copy link
Author

I can confirm that this is the problem. After I manually edited the save to make this contract as "Completed", the other contracts began updating properly. Must be either that CC has a bug, or it's not protecting itself from badly written contracts (which is arguably a bug :D).

@jrossignol
Copy link
Owner

jrossignol commented Jan 26, 2017

We made a bunch of changes in KSP 1.2 to prevent a lot of stuff like this from happening (one mod throwing an exception and breaking stuff in other mods or stock KSP). Alas, this is one integration point we've missed, so I've put in a request to get that problem fixed in stock.

As to the issue with the Rendezvous parameter, that should be a fairly straightforward fix with all the details you've provided in your report.

@jrossignol
Copy link
Owner

Fixed for next release. Note that the contract is now correctly shown as invalid and doesn't get loaded, so @pap1723 will need to add a vessel = Gemini-6 to make this work as originally intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants