Whitecat106 / Historic-Missions

Historic Missions Contract Pack for KSP 2.2.0
2 stars 0 forks source link

Duration Requirements reset after vessel switch #1

Closed Whitecat106 closed 8 years ago

Whitecat106 commented 8 years ago

Possibly use DisableOnStateChange = true?

Whitecat106 commented 8 years ago

Nope no fix with this, pretty much a necessity for long duration Salyut missions. Could you provide some assistance @jrossignol ?

jrossignol commented 8 years ago

Probably needs to be within a VesselParameterGroup? Hard to say - can you link to an example of a contract where you're having problems?

Whitecat106 commented 8 years ago

`CONTRACT_TYPE { name = Vostok-3 group = VostokMission title = Vostok-3 notes = Perform the third Vostok Flight. synopsis = Launch the third Vostok Mission. description = Vostok 3 (Russian: Orient 3 or East 3) was a spaceflight of the Soviet space program intended to determine the ability of the human body to function in conditions of weightlessness and test the endurance of the Vostok 3KA spacecraft over longer flights. Cosmonaut Andriyan Nikolayev orbited the Earth 64 times over nearly four days in space, August 11–15, 1962, a feat which would not be matched by NASA until the Gemini program (1965–1966). completedMessage = Mission Success! prestige = Trivial minExpiry = 1 maxExpiry = 30 agent = The Vostok Program deadline = 70 maxCompletions = 1 cancellable = true declinable = true targetBody = HomeWorld() rewardScience = 5 rewardReputation = 20 rewardFunds = 20000 failureReputation = 75 failureFunds = 5000 advanceFunds = 10000

PARAMETER { name = Vostok-3 type = VesselParameterGroup title = Perform the third Vostok flight.
define = Vostok-3

PARAMETER { name = NewVessel type = NewVessel hidden = true }

PARAMETER { name = Crewmembers type = HasCrew trait = Pilot minCrew = 1 maxCrew = 1 }

PARAMETER { name = Orbit type = Orbit minPeA = 140000 targetBody = HomeWorld() disableOnStateChange = true

PARAMETER { name = Duration type = Duration duration = 4d 2h preWaitText = Reach orbit waitingText = Making orbital observations. completionText = Observations Complete, return to Earth. } }

PARAMETER { name = ReturnHome type = ReturnHome completeInSequence = true } }

REQUIREMENT { name = PreviousMission type = CompleteContract contractType = Vostok-2 minCount = 1 maxCount = 1 cooldownDuration = 10d } }`

Here is one example, the duration requirement is within the Orbit Parameter, which in turn is within the VesselParameterGroup. Might I need to remove the duration requirement from the Orbit Parameter and just have this attached to the VesselParameterGroup?

I know contract configurator has been updated alot since I first wrote these contracts so there is probably a simpler way to do this but I am just checking if it would be more of a 'find and replace' fix rather than adjusting every contract which has a duration requirement. Thanks!

jrossignol commented 8 years ago

Use the duration attribute on the VesselParameterGroup. Using the duration like that (as a child of a ReachState) does work, but not when under a VPG.

Otherwise, raise an issue against Contract Configurator, and I'll see if I can't make some changes to make it work the way you have it (which is actually better, because if you do it the way I suggested, you need to move the ReturnHome out, which gets messy).

Just FYI though, I'm heading off on vacation in a couple hours - so I won't be able to look at the issue until about a week and a half from now.

Whitecat106 commented 8 years ago

Great! I'll raise an issue and see if I can send a pull request in the mean time! Enjoy your vacation!

jrossignol commented 8 years ago

One last thing you should double check - does it actually reset, or is it going in the background? In other words if you go back to the original vessel, does it still have its counter going down from where it left off, or did it reset completely?

Whitecat106 commented 8 years ago

The timer is completely reset and does not recognise the vessel in the background, I will look into this whilst you're away and see what works.

I will try your first suggestion first, then by writing a plugin to edit my contracts automatically once at the main menu rather than having to manually change 2000 versions by hand.