Giter VIP home page Giter VIP logo

contractconfigurator's People

Contributors

aelfhe1m avatar andfchat avatar dbt85 avatar dmagic1 avatar inigmatus avatar io5 avatar jberkman avatar jrossignol avatar keniamin avatar kerbas-ad-astra avatar linuxgurugamer avatar macgyvernl avatar mpharoah avatar nathankell avatar novemberorwhatever avatar pap1723 avatar phillo3 avatar piezpiedpy avatar siimav avatar sirmortimer avatar stevebenz avatar tinygrox avatar ultrajohn avatar uriyuzhui avatar vader111 avatar vapal avatar wraithan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

contractconfigurator's Issues

Orbital Flight With at Least 3 Crew Not Awarding Confidence

Reputation is awarded but the 750 Confidence does not show in either the Tally nor on the Completed contract message. Confidence remains at 219 and does not increment from completion.

Attempted to force complete contract in F12 menu after reloading earlier save and still did not receive confidence.

Included quicksave prior to de-orbiting craft for contract completion. Ran with Express install and RN Soviet Spacecraft
screenshot4
screenshot5
quicksave.zip

Exception when storing a List<string> in the PersistentDataStore

Environment: Clean KSP 1.12.4 install with only ModuleManager and ContractConfigurator

Minimal contract type that reproduces the bug:

CONTRACT_TYPE {
    name = PersistentDataStoreBug
    title = "Trigger an Exception in the PersistentDataStore"
    description = "Build and launch any vessel. The exception is triggered after completing the contract and switching back to the space center scene."
    prestige = Trivial
    synopsis = Just testing.
    completedMessage = "Quicksave now and look at quicksafe.sfs to see the broken entry in the persistent data store."
    PARAMETER {
        type = NewVessel
    }

    BEHAVIOUR {
        type = Expression
        CONTRACT_COMPLETED_SUCCESS {
            type = List<string>
            brokenEntry = [ "any string will do to break it" ]
        }
    }
}

Steps to reproduce:

  • Launch the game with the test contract installed
  • Start a new career game
  • Accept the test contract
  • Build and launch any vessel
    • Optional: Quicksave after completing the contract to analyze the state of the PersistentDataStore
  • Change back to the space center scene.

This will trigger the following exception after changing back to the space center:

Exception occured while loading ScenarioModule 'PersistentDataStore':
System.Exception: Error parsing statement.
Error occurred near '*':
[ any string will do to break it ]
..................................* <-- HERE ---> System.ArgumentException: Expected ',' or ']', got end of statement.
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseList[TResult] () [0x00167] in <acee7c1cecb143188a2b003e7f2fafc9>:0 
  at ContractConfigurator.ExpressionParser.ListExpressionParser`1[T].ParseList[TResult] () [0x00007] in <acee7c1cecb143188a2b003e7f2fafc9>:0 
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseSimpleStatement[TResult] () [0x0037e] in <acee7c1cecb143188a2b003e7f2fafc9>:0 
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseStatementInner[TResult] () [0x0005c] in <acee7c1cecb143188a2b003e7f2fafc9>:0 
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseStatement[TResult] () [0x000f3] in <acee7c1cecb143188a2b003e7f2fafc9>:0 
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00026] in <acee7c1cecb143188a2b003e7f2fafc9>:0 
--- End of inner exception stack trace ---
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00089] in <acee7c1cecb143188a2b003e7f2fafc9>:0 
  at ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpressionGeneric (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) [0x00000] in <acee7c1cecb143188a2b003e7f2fafc9>:0 
  at ContractConfigurator.PersistentDataStore.OnLoad (ConfigNode node) [0x000e0] in <acee7c1cecb143188a2b003e7f2fafc9>:0 

Request: Change how vessels in VPGs are tracked when not in focus

Current behavior:
Parameters in VPGs with vessels are only tracked when the vessel is currently controlled by the player. This works fine for parameters which can be instantly completed and kept that way, such as having crew, but does not work fine for "progressive" parameters like the Duration parameter, as they do not progress when the vessel is not in focus.
VPGs with vessels tracked also seem to check the current vessel for the tracked vessel's parameters first, resulting in progressive parameters resetting and forcing the player to control the tracked vessel

Desired behavior:
Parameters in VPGs with vessels tracked keep their previous states when switching away, and don't get updated when the current vessel is not the tracked vessel.
Progressive parameters are able to track their progress while away from the tracked vessel, only resetting progress while in control of the vessel.

Possible memory leak caused by TitleTracker.cs

KSPCF's logging feature tells me that this mod has a possible GameEvents leak issue, and I have had multiple crashes caused by memory access violations in a heavily modded career using Contract Configurator. I am unsure exactly what is going on but figured I should report it.

[LOG 20:39:49.744] [KSPCF:MemoryLeaks] Potential GameEvents leaks for scene Flight :

  • "onVesselRenamed" had 1633 subscribers on last scene switch, now it has 1977. Those subscribers are likely leaking :
    • ContractConfigurator:TitleTracker - Subscriptions : 1632/1976 (last/now)
  • "Contract.ParameterChange" had 1632 subscribers on last scene switch, now it has 1976. Those subscribers are likely leaking :
    • ContractConfigurator:TitleTracker - Subscriptions : 1632/1976 (last/now)

Also noticed:

  • "OnContractLoaded" had 247 subscribers on last scene switch, now it has 299. Those subscribers are likely leaking :
    • ContractConfigurator:VesselParameterGroup - Subscriptions : 247/299 (last/now)

Exception handling event onPartJointBreak in class VesselNotDestroyed:System.NullReferenceException

KSP and player Log files located here: https://drive.google.com/file/d/1bkFV4rhUCdky553GYNC1hLkBT8UI70qR/view?usp=sharing

I am receiving multiple errors and Exceptions when using contracts that contain VesselNotDestroyed parameters. The contracts behave normally and complete when the vessel is not destroyed/damaged and they fail correctly when it is, however the logs are filled with the exception errors

Example from contract

	PARAMETER
	{
		name = All
		type = All
		title = safely
		completeInSequence = true
		disableOnStateChange = true
		
		PARAMETER
		{
			**name = VesselNotDestroyed
			type = VesselNotDestroyed**
			title = without destroying your aircraft
			vessel = @/craft
		}
		
		PARAMETER
		{
			name = KerbalDeaths
			type = KerbalDeaths
			title = or killing anyone
			vessel = @/craft
		}
	}

There errors are as follows;

[ERR 07:27:24.408] Exception handling event onPartJointBreak in class VesselNotDestroyed:System.NullReferenceException: Object reference not set to an instance of an object
  at ContractConfigurator.Parameters.VesselNotDestroyed.OnPartJointBreak (PartJoint p, System.Single breakForce) [0x00014] in <3f35055287d9495681be8185e69ae773>:0 
  at EventData`2[T,U].Fire (T data0, U data1) [0x000b0] in <39c0323fb6b449a4aaf3465c00ed3c8d>:0 

[EXC 07:27:24.410] NullReferenceException: Object reference not set to an instance of an object
	ContractConfigurator.Parameters.VesselNotDestroyed.OnPartJointBreak (PartJoint p, System.Single breakForce) (at <3f35055287d9495681be8185e69ae773>:0)
	EventData`2[T,U].Fire (T data0, U data1) (at <39c0323fb6b449a4aaf3465c00ed3c8d>:0)
	UnityEngine.DebugLogHandler:LogException(Exception, Object)
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
	UnityEngine.Debug:LogException(Exception)
	EventData`2:Fire(PartJoint, Single)
	PartJoint:DestroyJoint()
	Part:ReleaseAutoStruts()
	Part:OnDestroy()

2.6.5.0 PartValidation Doesn't Seem to Properly Deal With Engine Types

After updating this mod to 2.6.5.0 the contracts of Giving Aircraft a Purpose (GAP) don't seem to be able to determine parameters relating to engine types. It seems something to do with the PartValidation changes might have affected this. I downgraded back to 2.6.4 and can confirm the parameters still work there.

Pictured is a plane that should be valid but is not. This plane was made on a new career mode save and was the first launch of the save. Also I uninstalled all other mods besides: this mod, GAP, Harmony, and Module Manager.
20231010083326_1

Snippets of the craft definitions from two of the missions where the contract pack checks for engine types are included below. Each checks in a different way and neither works. The crew and aero checks still work, it is only the parts that deal with engines that don't seem to function as they did before the update.

Wright-FirstFlight.txt
SSI-Mach1.txt

Contracts are not spawning with CC v2.9

When using Contract Configurator v2.9 in RP-1 v3.3 many contracts are missing and required contracts are not being offered for the active Programs, completely blocking progress.
Rolling back to v2.8 fixed the issue entirely, the contracts are offered as expected.

I was unable to get the logs with v2.9 as they were overwritten when I loaded with v2.8.

With v2.9:
v2 9 Programs accepted
v2 9 contracts missing
v2 9 no contracts offered

With v2.8:
v2 8 contracts are there

Feature Request: If a contract is closed manually by the player, it will stay closed even if parameters of the contract are completed

Basically, the action of me closing a contract makes it not open unless I open it again myself. Currently, if I close manually, for example, a crewed duration record of 2 days, that contract will still open when I enter orbit. (which is one of the parameters for that mission) This change would make it so the highest priority of who opens or closes a contract is left to the player.

Contract is closed manually by the player

Contract annoyingly opens automatically when one of the parameters is met (in this case, a sub-orbital trajectory)

Error parsing statement

Game Version:

1.12.5

Mods Installed:

  • ModuleManager
  • ContractConfigurator
  • Contract Pack: Field Research

Problem

My friends trying to translate the Contract Pack Field Research and he doing this in GameData\ContractPacks\FieldResearch\Experiment.cfg :

CONTRACT_TYPE
{
    name = FS_Experiment
    ...
    // title = Perform @experiment.Name().ToLower().FirstCap() experiments on @targetBody
    title = 在 @targetBody 上进行 @experiment.Name().ToLower().FirstCap() 实验。
   ...
}

when he enter the game, the contract will just gone

I look into the KSP.log and found:

ContractConfigurator.ContractType: CONTRACT_TYPE 'FS_Experiment': Error parsing title

ArgumentException: Expected a valid expression, found: ''
	ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseToken () (at <20a3a039060941bfb465629683bb64bf>:0)
	ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseMethod[TResult] (ContractConfigurator.ExpressionParser.BaseParser+Token token, T obj, System.Boolean isFunction) (at <20a3a039060941bfb465629683bb64bf>:0)
	System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
	Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
	System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
	System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
	ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseMethod[TResult] (ContractConfigurator.ExpressionParser.BaseParser+Token token, T obj, System.Boolean isFunction) (at <20a3a039060941bfb465629683bb64bf>:0)
	System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
	Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
	System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
	System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
	ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseMethod[TResult] (ContractConfigurator.ExpressionParser.BaseParser+Token token, T obj, System.Boolean isFunction) (at <20a3a039060941bfb465629683bb64bf>:0)
	ContractConfigurator.ExpressionParser.ExpressionParser`1[T].CompleteIdentifierParsing[U] (U value) (at <20a3a039060941bfb465629683bb64bf>:0)
	System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
	Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
	System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
	System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
	ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseSpecialIdentifier (ContractConfigurator.ExpressionParser.BaseParser+Token token) (at <20a3a039060941bfb465629683bb64bf>:0)
	ContractConfigurator.ExpressionParser.StringExpressionParser.ParseStatement[TResult] () (at <20a3a039060941bfb465629683bb64bf>:0)
	ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) (at <20a3a039060941bfb465629683bb64bf>:0)
	Rethrow as Exception: Error parsing statement.
	Error occurred near '*':
	在 @targetBody 上进行 @experiment.Name().ToLower().FirstCap() 实验。
	..........................................................* <-- HERE
	ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) (at <20a3a039060941bfb465629683bb64bf>:0)
	ContractConfigurator.ConfigNodeUtil.ParseSingleValue[T] (System.String key, System.String stringValue, System.Boolean allowExpression) (at <20a3a039060941bfb465629683bb64bf>:0)
	ContractConfigurator.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, System.Boolean allowExpression) (at <20a3a039060941bfb465629683bb64bf>:0)
	ContractConfigurator.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, System.Action`1[T] setter, ContractConfigurator.IContractConfiguratorFactory obj, T defaultValue, System.Func`2[T,TResult] validation) (at <20a3a039060941bfb465629683bb64bf>:0)
	UnityEngine.DebugLogHandler:LogException(Exception, Object)
	ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
	UnityEngine.Debug:LogException(Exception)
	ContractConfigurator.LoggingUtil:LogException(Exception)
	ContractConfigurator.ConfigNodeUtil:ParseValue(ConfigNode, String, Action`1, IContractConfiguratorFactory, String, Func`2)
	ContractConfigurator.ConfigNodeUtil:ParseValue(ConfigNode, String, Action`1, IContractConfiguratorFactory, Func`2)
	ContractConfigurator.DeferredLoadUtil:ExecuteLoad(DeferredLoadObject`1)
	System.Reflection.MethodBase:Invoke(Object, Object[])
	ContractConfigurator.ConfigNodeUtil:ExecuteDeferredLoads()
	ContractConfigurator.ContractType:Load(ConfigNode)
	ContractConfigurator.<LoadContractTypeConfig>d__32:MoveNext()
	ContractConfigurator.<FinalizeContractTypeLoad>d__31:MoveNext()
	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
ContractConfigurator.ContractType: Errors encountered while trying to load CONTRACT_TYPE 'FS_Experiment'

And then I delete the 实验 like this:

CONTRACT_TYPE
{
    name = FS_Experiment
    ...
    // title = Perform @experiment.Name().ToLower().FirstCap() experiments on @targetBody
    title = 在 @targetBody 上进行 @experiment.Name().ToLower().FirstCap()
   ...
}

it works again. The contract is back in Mission Control.

Couple of NullPointerExceptions

Hi, after installing some additional contracts, e.g. Kerbal Academy Contract Pack, I repeatedly get NullPointerExceptions. This is just one example. More details can be provided if needed.

Exception occured while attempt to generate contract of type 'ProgressionorbitContracts.ProgressionorbitJNSQRiga':
System.NullReferenceException: Object reference not set to an instance of an object
at ContractConfigurator.Parameters.ReachState+<>c.b__85_0 (CelestialBody cb) [0x00000] in :0
at ContractConfigurator.LocalizationUtil._LocalizeList[T] (ContractConfigurator.LocalizationUtil+Conjunction conjunction, System.Collections.Generic.IEnumerable1[T] values, System.Func2[T,TResult] strFunc) [0x0001c] in :0
at ContractConfigurator.LocalizationUtil.LocalizeList[T] (ContractConfigurator.LocalizationUtil+Conjunction conjunction, System.Collections.Generic.IEnumerable1[T] values, System.Func2[T,TResult] strFunc) [0x00005] in :0
at ContractConfigurator.Parameters.ReachState.BodyList () [0x00007] in :0
at ContractConfigurator.Parameters.ReachState.CreateDelegates () [0x0001f] in :0
at ContractConfigurator.Parameters.ReachState..ctor (System.Collections.Generic.List1[T] targetBodies, System.String biome, System.Collections.Generic.List1[T] situation, System.Single minAltitude, System.Single maxAltitude, System.Single minTerrainAltitude, System.Single maxTerrainAltitude, System.Double minSpeed, System.Double maxSpeed, System.Double minRateOfClimb, System.Double maxRateOfClimb, System.Single minAcceleration, System.Single maxAcceleration, System.Double minDeltaVeeActual, System.Double maxDeltaVeeActual, System.Double minDeltaVeeVacuum, System.Double maxDeltaVeeVacuum, System.String title) [0x0008d] in :0
at ContractConfigurator.ReachStateFactory.Generate (Contracts.Contract contract) [0x00000] in :0
at ContractConfigurator.ParameterFactory.Generate (ContractConfigurator.ConfiguredContract contract, Contracts.IContractParameterHost contractParamHost) [0x00016] in :0
at ContractConfigurator.ParameterFactory.GenerateParameters (ContractConfigurator.ConfiguredContract contract, Contracts.IContractParameterHost contractParamHost, System.Collections.Generic.List`1[T] paramFactories) [0x0007e] in :0
at ContractConfigurator.ContractType.GenerateParameters (ContractConfigurator.ConfiguredContract contract) [0x00000] in :0
at ContractConfigurator.ConfiguredContract.Initialize (ContractConfigurator.ContractType contractType) [0x00221] in :0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.