Jump to content

[1.4.x] Contract Pack: Tourism Plus [v1.5.2] [2016-12-14]


nightingale

Recommended Posts

5 hours ago, Lijazos said:

This mod destroyed my save. Awesome. 

Right after finishing the KSC Tour, I got the Hotel contract. Now, as stated in messages above, I can't switch to on orbit vessels, the camera on launch pad vessels is broken and the vessel is completely uncontrollable.

Please someone tell me there is a way to fix this hell.

Declining the remaining contracts doesn't fix it.

You should probably post your log files for issues like that.

Link to comment
Share on other sites

  • 2 months later...

Can I know what vessel spams this CONTRACT_TYPE 'Tourism_Base' error ?

Spoiler

[ERR 14:14:05.713] ContractConfigurator.VesselParameterGroupFactory: CONTRACT_TYPE 'Tourism_Base', PARAMETER 'VesselParameterGroup' of type 'VesselParameterGroup': Error parsing vessel

[EXC 14:14:05.716] NullReferenceException: Object reference not set to an instance of an object
    ContractConfigurator.Extensions+<>c__DisplayClass5_1.<GetHashes>b__1 (ProtoPartSnapshot childPart) (at <3f35055287d9495681be8185e69ae773>:0)
    System.Linq.Enumerable+WhereListIterator`1[TSource].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Boolean& found) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    ContractConfigurator.Extensions+<GetHashes>d__5.MoveNext () (at <3f35055287d9495681be8185e69ae773>:0)
    System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Boolean& found) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    ContractConfigurator.ContractVesselTracker+VesselInfo..ctor (Vessel v) (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ContractVesselTracker.AssociateVessel (System.String key, Vessel vessel) (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ExpressionParser.VesselParser.ConvertType (Vessel value) (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T]._ConvertType (U value) (at <3f35055287d9495681be8185e69ae773>: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].ConvertType (System.Object value, System.Type type) (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].CompleteIdentifierParsing (U value) (at <3f35055287d9495681be8185e69ae773>: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 <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseSimpleStatement[TResult] () (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseStatementInner[TResult] () (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseStatement[TResult] () (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) (at <3f35055287d9495681be8185e69ae773>:0)
    Rethrow as Exception: Error parsing statement.
    Error occurred near '*':
    @/targetVessel
    ..............* <-- HERE
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ParseExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ExpressionParser.ExpressionParser`1[T].ExecuteExpression (System.String key, System.String expression, ContractConfigurator.ExpressionParser.DataNode dataNode) (at <3f35055287d9495681be8185e69ae773>:0)
    ContractConfigurator.ConfigNodeUtil.ParseSingleValue[T] (System.String key, System.String stringValue, System.Boolean allowExpression) (at <3f35055287d9495681be8185e69ae773>: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.ConfigNodeUtil.ParseValue[T] (ConfigNode configNode, System.String key, System.Boolean allowExpression) (at <3f35055287d9495681be8185e69ae773>: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 <3f35055287d9495681be8185e69ae773>: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, List`1, Func`2)
    ContractConfigurator.ConfigNodeUtil:ParseValue(ConfigNode, String, Action`1, IContractConfiguratorFactory, Func`2)
    ContractConfigurator.DeferredLoadUtil:ExecuteLoad(DeferredLoadObject`1)
    System.Reflection.MethodBase:Invoke(Object, Object[])
    ContractConfigurator.<UpdateNonDeterministicValuesIterator>d__31:MoveNext()
    System.Linq.ConcatIterator`1:MoveNext()
    ContractConfigurator.<GenerateContract>d__33:MoveNext()
    ContractConfigurator.<ContractEnumerator>d__32:MoveNext()
    ContractConfigurator.ContractPreLoader:Update()

ksp.log: https://file.io/9fOu2EJ3h9pb

Edited by flart
Link to comment
Share on other sites

36 minutes ago, flart said:

'Tourism_Base' error ?

The @/targetVessel parameter check is based on the following data object; 

    DATA
    {
        type = Vessel

        uniquenessCheck = CONTRACT_ACTIVE
        title = Must have a base with sufficient empty space

        targetVessel = AllVessels().Where(v => v.VesselType() == Base).Where(v => HomeWorld().Children().Contains(v.CelestialBody()) && v.IsLanded() && v.EmptyCrewSpace() > @Tourism:touristCount).Random()
    }

If the check for empty crew space on a base on the moons of the homeworld is not greater than the  tourism count, then the variable targetVessel will be null and generally a Null Reference Exception will be thrown.  This will continue until the  the uniqueness check is completed successfully.    

Do you have any bases on the moons that have empty crew space greater than your tourism count? You can fined the value by searching the persistent.sfs file for the game and searching for the PersistentDataStore section and seeing what the tourism count is. 

Link to comment
Share on other sites

4 hours ago, Caerfinon said:

... bases on the moons .... PersistentDataStore ... 

Moons vessels:

Spoiler

1CXUpVX.jpeg

 

    SCENARIO
    {
        name = PersistentDataStore
        scene = 7, 8, 5
        DATA
        {
            ourHome = CelestialBody:Kerbin
            SatList = List<VesselIdentifier>:[ Vesselbf769d9c-62f5-42a1-82e6-544f6a601e09, Vessel0ab2365e-72f9-424f-ae1e-e56b1f69dd9e ]
            TouristCount = Double:111
            TouristLowOrbitCount = Double:20
            firstSpaceStation = List<VesselIdentifier>:[ Vesseld04addb6-c27e-44a7-a6d3-bf311449a7d2 ]
            TouristStationCount = Double:13
            Tourism_HotelConstruction = Double:0
            BaseConstruction = Boolean:False
            TouristAsteroidCount = Double:55
            Tourism_Hotels = List<VesselIdentifier>:[ Vessel5fc38c0d-2235-4b30-af70-b45540a487e5 ]
            TouristAttractionCount = Double:12
        }
    }

I'm not sure, TouristCount looks like just global counter of all tourists, why compare EmptyCrewSpace to that?

Link to comment
Share on other sites

12 minutes ago, flart said:

why compare EmptyCrewSpace to that?

Actually, the value Tourist Count in the persistent data store is never really referenced for lookup. It just has the same name  as the variable at the Group level data from the tourism.cfg file. 

According to that calculation touristcount is calculated as a random number between 1-4.  

    DATA
    {
        type = int

        hidden = true

        maxTourists = @hasFourSeatParts ? 4 : @hasTwoSeatParts ? 2 : 1
        touristCount = Random(1, @maxTourists)
    }

If possible could you turn on debugging for Contract Configurator.  See the file "Kerbal Space Program\GameData\ContractConfigurator\ContractConfigurator.cfg.default"  

  1. edit the file
  2. set al logLevel = VERBOSE
  3. save and remove the .default and reload KSP

Then check the directory  Kerbal Space Program\GameData\ContractConfigurator\log\Tourism\   and  post the file Tourism_Base.log  

Also looking at the section in persistent.sfs  that starts with

	SCENARIO
	{
		name = ContractSystem

You should be able to see that data associated with the active Bases contract by searching  for subtype = Tourism_Base. You can then look at the current values of @/targetVessel   is. 

Debugging contracts is pretty labour intensive. 

 

 

Link to comment
Share on other sites

3 hours ago, Caerfinon said:

post the file Tourism_Base.log  

https://pastebin.com/B29steSu

 

3 hours ago, Caerfinon said:

section in persistent.sfs

save file https://file.io/M6D1TQ8JLc2q

 

3 hours ago, Caerfinon said:

by searching  for subtype = Tourism_Base

can't find Tourism_Base in the save file

 

ksp.log : https://file.io/NJDEsES8k6MN

 

Link to comment
Share on other sites

1 hour ago, flart said:

can't find Tourism_Base in the save file

Well all this data makes things a little clearer.  the Base contract is failing during evaluation by Contract configurator. It never makes it into the persistent.sfs file because it doesn't appear to be offered. 

Your base on Minmus, does it have 4 or more empty crew spots? 

The debug log shows that the Tourism:touristCount can be evaluated from 1 -4  but the initial load has the target vessel evaluated as null.  

The  errors in the ksp.log shows the null exception gets thrown every time contract configurator tries to offer new contracts indicating that the evaluation is returning no value  

targetVessel = AllVessels().Where(v => v.VesselType() == Base).Where(v => HomeWorld().Children().Contains(v.CelestialBody()) && v.IsLanded() && v.EmptyCrewSpace() > @Tourism:touristCount).Random()

 So either the empty crew space is always evaluating lower than the @Tourism:touristcount or the syntax of the evaluation is failing in some other way. I doubt that it's always the former unless all your bases are currently full. On the other hand if the evaluation syntax is the problem then it would need to be reworked to obtain the answer in a different way with a safety check that prevents a null value from being copied into a Vessel parameter. 

Or simply delete the base.cfg file and the problem is swept under the rug.    

Link to comment
Share on other sites

Just now, flart said:

Could that be a problem?

No.  If the evaluation ran correctly then it would compare 33 available spaces is greater than the random 1 to 4 tourists possible.  

So it seems be tied to the syntax related to the AllVessels().Where(v => v.VesselType() == Base).Where(v => HomeWorld().Children().Contains(v.CelestialBody()) part of the evaluation. 

This attempts to create a list of all bases that are on any of the the moons of the homeworld. I suspect that this is the piece that is returning a null value and needs to be rewritten another way. 

This might work 

targetVessel = AllVessels().Where(v => v.VesselType() == Base && v.CelestialBody().Parent() == v.CelestialBody().Homeworld() && v.IsLanded() && v.EmptyCrewSpace() > @Tourism:touristCount).Random() 

no guarantees however. I don't have a install of KSP where I can test it. 

Link to comment
Share on other sites

On 8/5/2022 at 2:40 PM, Caerfinon said:

targetVessel = AllVessels().Where(v => v.VesselType() == Base && v.CelestialBody().Parent() == v.CelestialBody().Homeworld() && v.IsLanded() && v.EmptyCrewSpace() > @Tourism:touristCount).Random() 

It is fixed the exception

Link to comment
Share on other sites

  • 3 weeks later...
On 5/17/2021 at 9:00 PM, Kerbex said:

Hey, I know it's been a few.  I did try the crew transfer, but I still ended up borking the save file completing the investor tour.  The only solution I've found so far is to do the investor tour,  do not recover vessel or switch scenes from the investor kerbal, wait for the game to save (check in alt+f12), hit esc, quit to main menu, load the save, accept whichever casino or hotel contract (while the null refs are being spammed), wait for the game to save, quit the game completely and then reload it.  So far that worked. 

Alright, here are the steps I took after a few other things didn't pan out. Any number (or combination) of these might do the trick for you. Or not. My game is thick-bone-modded, so YMMV.
1. From the KSC, I recovered the (hotel) investor I wasn't gonna use.
2. Walked the Casino investor to all the prescribed locations at 12x phys warp.
3. For some reasons, as soon as the contract was completed, the investor was yeeted by the kraken and disappeared in a puff of smoke. I have an inkling that whatever did this is related to the stuck-camera bug.
4. Quit to main menu directly.
5. Opened the game, loaded the save up.
6. Accepted the Build a Casino contract. Quit again.
7. Reopened the game, loaded the save once more.

And now everything seems fine. I declined the second coming of the investor tour contract at this point too. Kind of a shame how getting this mod to not crap the bed has more to do with wizardry than anything else.

Edited by Axelord FTW
Link to comment
Share on other sites

  • 3 months later...
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...