Jump to content

[1.10.1+] Contract Configurator [v1.30.5] [2020-10-05]


nightingale

Recommended Posts

I owe you so many apologies, I wasn't on the latest version. The scientist requirement now works flawlessly. I'm still getting erratic behavior on the thermometer and I'm trying to pin down what is causing it. I think it might be that it can't detect the part if the vessel isn't actively loaded when the contract loads?

Link to comment
Share on other sites

I owe you so many apologies, I wasn't on the latest version. The scientist requirement now works flawlessly. I'm still getting erratic behavior on the thermometer and I'm trying to pin down what is causing it. I think it might be that it can't detect the part if the vessel isn't actively loaded when the contract loads?

No worries - I only just remembered that I'd run into one or two annoying parsing bugs with strings last week. :)

I seem to remember someone mention that about the parts before... so I suspect you may be right, it only works for loaded vessels. Raised [#262], as the way it currently behaves isn't all that useful.

... actually, the fix looked really easy, but I don't have time to test it at the moment. Any chance you can grab the dev dll and let me know if that makes it work for both loaded and unloaded vessels? If not I'll have to do some more digging.

Link to comment
Share on other sites

Hello,

I'm running 64 bit KSP on Windows and I know that 64 bit KSP is not known to be very stable.

However playing it for a long while it's been more stable than 32 bit aside from the buildings displaying a different upgraded state at times.

Recently I've been having a problem with 64-bit though and it's making my game unplayable. What happends is that when I change the scene three times (Launch, Space Center, Tracking station or Launch, Revert to VA, launch) my game will freeze.

Here is a picture of what this freeze looks like: http://i.imgur.com/6sO48uH.png

So I installed ExceptionDetector to see what exceptions might be causing this. When I change the scene it tells me that Contract Configurator and Clouds are causing an exception.

This is my output_log: https://www.dropbox.com/s/5iht89g3khmjw91/output_log.txt?dl=0

I removed ContractConfigurator and tried without it and my KSP works fine.

However with ContractConfigurator the things that I described occur OFTEN.

I'd be grateful for any help, but I don't expect any since I know mod support for 64 Bit is often excluded.

Link to comment
Share on other sites

Hello,

I'm running 64 bit KSP on Windows and I know that 64 bit KSP is not known to be very stable.

However playing it for a long while it's been more stable than 32 bit aside from the buildings displaying a different upgraded state at times.

Recently I've been having a problem with 64-bit though and it's making my game unplayable. What happends is that when I change the scene three times (Launch, Space Center, Tracking station or Launch, Revert to VA, launch) my game will freeze.

Here is a picture of what this freeze looks like: http://i.imgur.com/6sO48uH.png

So I installed ExceptionDetector to see what exceptions might be causing this. When I change the scene it tells me that Contract Configurator and Clouds are causing an exception.

This is my output_log: https://www.dropbox.com/s/5iht89g3khmjw91/output_log.txt?dl=0

I removed ContractConfigurator and tried without it and my KSP works fine.

However with ContractConfigurator the things that I described occur OFTEN.

I'd be grateful for any help, but I don't expect any since I know mod support for 64 Bit is often excluded.

This is the problem:

NullReferenceException  at (wrapper managed-to-native) UnityEngine.Component:InternalGetGameObject ()
at UnityEngine.Component.get_gameObject () [0x00000] in <filename unknown>:0
at Vessel.recurseCoMs (.Part part) [0x00000] in <filename unknown>:0
at Vessel.recurseCoMs (.Part part) [0x00000] in <filename unknown>:0
at Vessel.recurseCoMs (.Part part) [0x00000] in <filename unknown>:0
at Vessel.findLocalCenterOfMass () [0x00000] in <filename unknown>:0
at ProtoVessel..ctor (.Vessel VesselRef) [0x00000] in <filename unknown>:0
at ContractConfigurator.ContractVesselTracker+<>c__DisplayClassb.<OnVesselDestroy>b__8 (.Vessel v) [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[Vessel].GetIndex (Int32 startIndex, Int32 count, System.Predicate`1 match) [0x00000] in <filename unknown>:0
at System.Collections.Generic.List`1[Vessel].Find (System.Predicate`1 match) [0x00000] in <filename unknown>:0
at ContractConfigurator.ContractVesselTracker.OnVesselDestroy (.Vessel vessel) [0x00000] in <filename unknown>:0
at EventData`1[Vessel].Fire (.Vessel data) [0x00000] in <filename unknown>:0
at Vessel.OnDestroy () [0x00000] in <filename unknown>:0

It's Unity crashing, because Windows 64 bit Unity 4.6 is unstable. Which is why I cannot support this, sorry!

Link to comment
Share on other sites

An error message told me to post this here, so:

Exception occured while saving ScenarioModule 'ContractVesselTracker':

System.InvalidOperationException: Operation is not valid due to the current state of the object

at System.Linq.Enumerable.First[ProtoPartSnapshot] (IEnumerable`1 source) [0x00000] in <filename unknown>:0

at ContractConfigurator.Extensions+<GetHashes>d__18.MoveNext () [0x00000] in <filename unknown>:0

at System.Linq.Enumerable.Contains[uInt32] (IEnumerable`1 source, UInt32 value, IEqualityComparer`1 comparer) [0x00000] in <filename unknown>:0

at System.Linq.Enumerable.Contains[uInt32] (IEnumerable`1 source, UInt32 value) [0x00000] in <filename unknown>:0

at ContractConfigurator.ContractVesselTracker+<>c__DisplayClass6.<OnSave>b__4 (.Vessel v) [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1[Vessel].GetIndex (Int32 startIndex, Int32 count, System.Predicate`1 match) [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1[Vessel].Find (System.Predicate`1 match) [0x00000] in <filename unknown>:0

at ContractConfigurator.ContractVesselTracker.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0

I am using the Advanced Progression, SANSat, KSS, RemoteTech, and Tourism contract packs.

Link to comment
Share on other sites

An error message told me to post this here, so:

Exception occured while saving ScenarioModule 'ContractVesselTracker':

System.InvalidOperationException: Operation is not valid due to the current state of the object

at System.Linq.Enumerable.First[ProtoPartSnapshot] (IEnumerable`1 source) [0x00000] in <filename unknown>:0

at ContractConfigurator.Extensions+<GetHashes>d__18.MoveNext () [0x00000] in <filename unknown>:0

at System.Linq.Enumerable.Contains[uInt32] (IEnumerable`1 source, UInt32 value, IEqualityComparer`1 comparer) [0x00000] in <filename unknown>:0

at System.Linq.Enumerable.Contains[uInt32] (IEnumerable`1 source, UInt32 value) [0x00000] in <filename unknown>:0

at ContractConfigurator.ContractVesselTracker+<>c__DisplayClass6.<OnSave>b__4 (.Vessel v) [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1[Vessel].GetIndex (Int32 startIndex, Int32 count, System.Predicate`1 match) [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1[Vessel].Find (System.Predicate`1 match) [0x00000] in <filename unknown>:0

at ContractConfigurator.ContractVesselTracker.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0

I am using the Advanced Progression, SANSat, KSS, RemoteTech, and Tourism contract packs.

I'll need a little bit more details on this one - KSP.log would be ideal, and whether you're on 32-bit or 64-bit (and what OS).

Link to comment
Share on other sites

New release! A few important bug fixes and some new goodies for contract modders. This should be the last release in the 1.5.x series (unless a major bug crops up), some interesting stuff planned for 1.6.0! Download now!

Contract Configurator 1.5.3

  • Added UnlockPart behaviour.
  • Added CanResearchTech requirement.
  • Added AvailablePart.IsUnlocked and AvailablePart.CrewCapacity.
  • Added Log() function for expressions.
  • Added new basic type-conversion functions for expressions (int(), float(), double(), etc.).
  • Fixed issue with Vessel.Parts() (thanks Whyren).
  • Minor bug fixes.

Link to comment
Share on other sites

I think I found something causing poor performance, or maybe I'm just bending the rules too much.

This works fine:

DATA

{

type = List<CelestialBody>

easyPlanets = HomeWorld().Children()

}

This causes framerate to drop to unplayable levels:

DATA

{

type = List<CelestialBody>

easyPlanets = HomeWorld().Children().Add(HomeWorld())

}

In troubleshooting this I realized I don't even want the homeworld in there, but thought you might want to know anyway.

Link to comment
Share on other sites

New release! A few important bug fixes and some new goodies for contract modders. This should be the last release in the 1.5.x series (unless a major bug crops up), some interesting stuff planned for 1.6.0! Download now!

Contract Configurator 1.5.3

  • Added UnlockPart behaviour.
  • Added CanResearchTech requirement.
  • Added AvailablePart.IsUnlocked and AvailablePart.CrewCapacity.
  • Added Log() function for expressions.
  • Added new basic type-conversion functions for expressions (int(), float(), double(), etc.).
  • Fixed issue with Vessel.Parts() (thanks Whyren).
  • Minor bug fixes.

Yeah this is great:D Thanks a lot for the UnlockPart behaviour (I wasns't too wrong doing C# after all, I checked the behaviour and it wasn't too different from mine so I'll take some more tutorials:D)

Also what does the Log() method do?

EDIT : on the UnlockPart behaviour where do I specify the part to be unlocked? it doesn't say anything on the wiki

Edited by CosmoBro
Link to comment
Share on other sites

I think I found something causing poor performance, or maybe I'm just bending the rules too much.

This works fine:

DATA

{

type = List<CelestialBody>

easyPlanets = HomeWorld().Children()

}

This causes framerate to drop to unplayable levels:

DATA

{

type = List<CelestialBody>

easyPlanets = HomeWorld().Children().Add(HomeWorld())

}

In troubleshooting this I realized I don't even want the homeworld in there, but thought you might want to know anyway.

Yikes, you've uncovered an awful bug... that ends up actually adding it into the real list of children for the homeworld... which then grows every time that gets called. I'll fix for the next release, but your workaround (if you change your mind and decide you do want homeworld in there) would be:

[COLOR=#333333]DATA[/COLOR]
[COLOR=#333333]{[/COLOR]
[COLOR=#333333] type = List<CelestialBody>[/COLOR]
[COLOR=#333333] [/COLOR][COLOR=#333333]easyPlanets = [HomeWorld()].Add(HomeWorld().Children())[/COLOR]
[COLOR=#333333]}

- - - Updated - - -

Also what does the Log() method do?

Takes the logarithm of a number. Not related to logging. :)

EDIT : on the UnlockPart behaviour where do I specify the part to be unlocked? it doesn't say anything on the wiki

It was a dumb copy+paste error in the wiki - I fixed it now.

- - - Updated - - -

Oh and CosmoBro - I have a feeling you may need lots more expressions around tech for what you're working on... I'll raise something to get it into the 1.6.0 release (at least for a starting point).

Link to comment
Share on other sites

I'm trying to add some contracts to a mod of mine (the Triple-Z Radio Telescope), and I think I got most of the cfg file figured out, but the contracts fail to load on this section:

PARAMETER:NEEDS[ZZZ_RadioTelescope]

{

name = PartValidation

type = PartValidation

partModule = radiotelescope

minCount = 1

}

It complains that "radiotelescope" is unknown, which is the name of the part in the part.cfg - my guess is that I'm not using PARAMETER:NEEDS correctly - what string is expected there? The folder name in GameData?

The telescope mod sits inside of a MunSeeker folder like so: GameData/MunSeeker/ZZZ_RadioTelescope/part.cfg

What would I use in this case for the NEEDS value?

Thanks!

Link to comment
Share on other sites

NEEDS is entirely a Module Manager thing. If you're planning on releasing your contracts along with your part you don't need it. Regardless, the fact that you're getting an error means that part is working.

Anyway, the problem is that you're looking for partModule = radiotelescope when you should be looking for part = radiotelescope

Link to comment
Share on other sites

Oh and CosmoBro - I have a feeling you may need lots more expressions around tech for what you're working on... I'll raise something to get it into the 1.6.0 release (at least for a starting point).

Yep I saw it on github. But also something about for getting better test situations. For example a low thrust engine to test it on orbit, and a high thrust engine to test it on the launchpad. It may work with something like filtering? I don't know. I'll raise something on github

Link to comment
Share on other sites

Yep I saw it on github. But also something about for getting better test situations. For example a low thrust engine to test it on orbit, and a high thrust engine to test it on the launchpad. It may work with something like filtering? I don't know. I'll raise something on github

Well, document up some specific cases you want to look for.... it can definitely work with filtering, but there's potentially lots and lots of fields that I'll need to expose for the parts depending on what you want. Just for your example, I could expose atmospheric/vacuum thrust/ISP (so 4 combinations). And that's just to handle engines. :)

Link to comment
Share on other sites

Well, document up some specific cases you want to look for.... it can definitely work with filtering, but there's potentially lots and lots of fields that I'll need to expose for the parts depending on what you want. Just for your example, I could expose atmospheric/vacuum thrust/ISP (so 4 combinations). And that's just to handle engines. :)

But yeah atmospheric/vacuum thrust would be enough and there isn't too many parts other than engines. The other parts that I'll test would be like solar, RTG, Generator. Maybe some fuel tanks but all of them on orbit.

Link to comment
Share on other sites

But yeah atmospheric/vacuum thrust would be enough and there isn't too many parts other than engines. The other parts that I'll test would be like solar, RTG, Generator. Maybe some fuel tanks but all of them on orbit.

Sounds good, raise the enhancement request and I'll get it done. I'll probably still add ISP - not really much additional effort to add it while I'm in there.

Link to comment
Share on other sites

Anyway, the problem is that you're looking for partModule = radiotelescope when you should be looking for part = radiotelescope

Thank You! I really enjoy your mod and very much appreciate all the work you are putting into it!

Link to comment
Share on other sites

I am having a problem spawning vessels on the surface about ground level. The vessel spawns at the desired altitude, and a second or two later, will teleport to ground level. The vessel then proceeds to take off using the BDArmory AI Pilot and will fight as normal.

There are two contracts being used, because i'm sure that KSP would automatically delete a far away vessel that is in atmosphere. Contract "A" requires you to fly to a surface waypoint. Upon completion of Contract "A", Contract "B" auto-accepts and spawns the vessel.

This at least has given the insight that the vessel does indeed spawn at the designated altitude, it is just getting adjusted for some reason.

I checked odin_spain's 5dim Military Contract Pack and, while he included airplanes in his ships folder, they are not used in any contracts.

I updated to the most recent version of Contract Configurator, just in case.

I am in the process of uninstalling KIS and KAS, the only other mods that are installed aside from BDArmory and Contract Configurator.

Link to comment
Share on other sites

I am having a problem spawning vessels on the surface about ground level. The vessel spawns at the desired altitude, and a second or two later, will teleport to ground level. The vessel then proceeds to take off using the BDArmory AI Pilot and will fight as normal.

There are two contracts being used, because i'm sure that KSP would automatically delete a far away vessel that is in atmosphere. Contract "A" requires you to fly to a surface waypoint. Upon completion of Contract "A", Contract "B" auto-accepts and spawns the vessel.

This at least has given the insight that the vessel does indeed spawn at the designated altitude, it is just getting adjusted for some reason.

I checked odin_spain's 5dim Military Contract Pack and, while he included airplanes in his ships folder, they are not used in any contracts.

I updated to the most recent version of Contract Configurator, just in case.

I am in the process of uninstalling KIS and KAS, the only other mods that are installed aside from BDArmory and Contract Configurator.

Try the dev version here. It was never really intended for vessels in flight, because it doesn't really work in stock KSP (they'd just go nose down and crash). I have no idea if you need to do the two-contract stuff or not, but with the new version it *should* work now (limited testing). Let me know how it goes, and if it doesn't work send me the full contract and I'll play with it a bit.

Link to comment
Share on other sites

I believe KSP is the culprit here. It just insists on spawning surface vessels on the ground. Which is probably a good idea for launching vessels from the runway or launchpad...

Anyways I was able to fix the issue. KSP places the lowest point of a vessel at ground level, so I added a cubic octagonal strut to the bottom and put a mini decoupler on that. I set the Gear action group to decouple said decoupler. Then I edited the .craft and placed that decoupler 2km below the vessel. The AI pilot raises the gear, which decouples the decoupler (KSP did not like any object that remained attached to the vessel. Like REALLY didn't like it.) and flies like a normal aircraft.

Seems to work fine for my purposes. I'll just need to make seperate .craft files if I need different altitudes.

Also, thank you for your mod and your support. Having a blast putting together these contracts.

Edited by Volwen
Link to comment
Share on other sites

Hi Nightingale,

Sorry, but I'm having some problems with 1.5.3, which didn't occur in previous versions. Sometimes when I do an F5 or manual save, I get a complaining message from CC telling me something like:

Exception occured while saving contract parameter 'ReachState' in contract 'Tourism_Moons':

System.NullReferenceException: Object reference not set to an instance of an object

at ContractConfigurator.Parameters.ReachState.OnParameterSave (.ConfigNode node) [0x00000] in <filename unknown>:0

at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0

or

Exception occured while loading ScenarioModule 'ContractPreLoader': System.ArgumentException: ContractConfigurator.Parameters.ParameterDelegate`1[T] is an open generic type

Looking in my output_log I find things such as...

ArgumentException: Missing required value 'biome'.

at ContractConfigurator.ConfigNodeUtil.ParseValue[string] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0

at ContractConfigurator.Parameters.ReachState.OnParameterLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

UnityEngine.Debug:Internal_LogException(Exception, Object)

UnityEngine.Debug:LogException(Exception)

ContractConfigurator.LoggingUtil:LogException(Exception)

ContractConfigurator.Parameters.ContractConfiguratorParameter:OnLoad(ConfigNode)

Contracts.ContractParameter:Load(ConfigNode)

Contracts.ContractParameter:Load(ConfigNode)

Contracts.Contract:Load(Contract, ConfigNode)

ContractConfigurator.ContractPreLoader:OnLoad(ConfigNode)

ScenarioModule:Load(ConfigNode)

ScenarioRunner:AddModule(ConfigNode)

ProtoScenarioModule:Load(ScenarioRunner)

:MoveNext()

As yet, it's shown no sign of breaking my game, but I'm hesitant to pick up any tourist contracts, for obvious reasons... Advice appreciated ^^;

Link to comment
Share on other sites

Got a popup telling me to post this here and quit immediately if I want to keep my save:

Exception occured while loading ScenarioModule 'ContractPreLoader':

System.ArgumentOutOfRangeException: Argument is out of range.

Parameter name: index

at System.Collections.Generic.List`1[Contracts.Agents.Agent].get_Item (Int32 index) [0x00000] in <filename unknown>:0

at Contracts.Agents.AgentList.GetAgentRandom () [0x00000] in <filename unknown>:0

at Contracts.Contract.Load (Contracts.Contract contract, .ConfigNode node) [0x00000] in <filename unknown>:0

at ContractConfigurator.ContractPreLoader.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

Between last launch and this one (when the error popped up) I installed DDS4KSP (ran through Gamedata) and sarbian's graphic memory usage mod.

Edited by mskrod
typo
Link to comment
Share on other sites

I believe KSP is the culprit here. It just insists on spawning surface vessels on the ground. Which is probably a good idea for launching vessels from the runway or launchpad...

Anyways I was able to fix the issue. KSP places the lowest point of a vessel at ground level, so I added a cubic octagonal strut to the bottom and put a mini decoupler on that. I set the Gear action group to decouple said decoupler. Then I edited the .craft and placed that decoupler 2km below the vessel. The AI pilot raises the gear, which decouples the decoupler (KSP did not like any object that remained attached to the vessel. Like REALLY didn't like it.) and flies like a normal aircraft.

Seems to work fine for my purposes. I'll just need to make seperate .craft files if I need different altitudes.

Also, thank you for your mod and your support. Having a blast putting together these contracts.

Did you try the dev dll I linked to? It's not KSP that's the issue, it's that I had my code not catering for flying vessels. I'm still going to take a look at fixing it, as I'm not going to tell the next guy that comes along to hack in a 2km decoupler. :)

- - - Updated - - -

Hi Nightingale,

Sorry, but I'm having some problems with 1.5.3, which didn't occur in previous versions. Sometimes when I do an F5 or manual save, I get a complaining message from CC telling me something like:

Exception occured while saving contract parameter 'ReachState' in contract 'Tourism_Moons':

System.NullReferenceException: Object reference not set to an instance of an object

at ContractConfigurator.Parameters.ReachState.OnParameterSave (.ConfigNode node) [0x00000] in <filename unknown>:0

at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0

or

Exception occured while loading ScenarioModule 'ContractPreLoader': System.ArgumentException: ContractConfigurator.Parameters.ParameterDelegate`1[T] is an open generic type

Looking in my output_log I find things such as...

ArgumentException: Missing required value 'biome'.

at ContractConfigurator.ConfigNodeUtil.ParseValue[string] (.ConfigNode configNode, System.String key, Boolean allowExpression) [0x00000] in <filename unknown>:0

at ContractConfigurator.Parameters.ReachState.OnParameterLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

at ContractConfigurator.Parameters.ContractConfiguratorParameter.OnLoad (.ConfigNode node) [0x00000] in <filename unknown>:0

UnityEngine.Debug:Internal_LogException(Exception, Object)

UnityEngine.Debug:LogException(Exception)

ContractConfigurator.LoggingUtil:LogException(Exception)

ContractConfigurator.Parameters.ContractConfiguratorParameter:OnLoad(ConfigNode)

Contracts.ContractParameter:Load(ConfigNode)

Contracts.ContractParameter:Load(ConfigNode)

Contracts.Contract:Load(Contract, ConfigNode)

ContractConfigurator.ContractPreLoader:OnLoad(ConfigNode)

ScenarioModule:Load(ConfigNode)

ScenarioRunner:AddModule(ConfigNode)

ProtoScenarioModule:Load(ScenarioRunner)

:MoveNext()

As yet, it's shown no sign of breaking my game, but I'm hesitant to pick up any tourist contracts, for obvious reasons... Advice appreciated ^^;

There's a lot of noise with those different errors - I need to know what happened first (as most of those would be caused by other problems). If you have an uncorrupted save (from just before this started happening, are you able to send the log from doing a save there?). If not, send a log and the save file (as I'll need to compare what's in the save file to the load/save errors that are happening).

- - - Updated - - -

Nightingale, just wanted to say thanks again. I've got my rover missions working the way I wanted and just put up a thread for them. Feel free to check them out if you are interested.

Congrats on the release! I've updated the first second post with a link.

- - - Updated - - -

Got a popup telling me to post this here and quit immediately if I want to keep my save:

Between last launch and this one (when the error popped up) I installed DDS4KSP (ran through Gamedata) and sarbian's graphic memory usage mod.

Post the full log - if you run DDS4KSP on the whole GameData, you're going to get some trouble with agent icons. If I see the full log I can give you a better idea where the issue is (in short, convert any of the agent icons back to PNG).

Link to comment
Share on other sites

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