Jump to content

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


nightingale

Recommended Posts

Hi! I'm trying to make my first contract

It requires player to visit 4 different biomes. 3 of them should be random, and one preselected.

I'm stuck with determining the list of biomes. here is how I'm trying to do that:

DATA
{
	type = List<Biome>
	hidden = true
	biomestovisit1 = HomeWorld().Biomes()
	biomestovisit2 = @/biomestovisit1.Where(s => !s.IsKSC())
	biomestovisit3 = @/biomestovisit2.Where(s => s != “Poles”)
	biomestovisit4 = @/biomestovisit3.Random(3) 
	biomestovisit = [@/biomestovisit2, “Poles”]
}
PARAMETER
{
	Name = Measure Temperature
	type = CollectScience
	experiment = temperatureScan
	recoveryMethod = RecoverOrTransmit
   		
	ITERATOR
	{
		type = Biome
		biome = @/biomestovisit
	}
}

It returns me a big number of exceptions.

[Exception]: DataStoreCastException: Cannot cast from System.Collections.Generic.List`1[ContractConfigurator.Biome] to ContractConfigurator.Biome.

[Warning]: ContractConfigurator.ConfigNodeUtil: Got an unexpected exception trying to load 'biomestovisit2' as a list:

[Exception]: NullReferenceException: Object reference not set to an instance of an object

 

And so on. I have tried to solve this problem in other ways (defining it through ScienceSubjects for example) But I always get something like :incorrect method for class Biome" or "exception when defining biome as a list"

 

What am I doing wrong? :(

 

 

Link to comment
Share on other sites

1 hour ago, Lan_Morehell said:

Hi! I'm trying to make my first contract

It requires player to visit 4 different biomes. 3 of them should be random, and one preselected.

I'm stuck with determining the list of biomes. here is how I'm trying to do that:


DATA
{
	type = List<Biome>
	hidden = true
	biomestovisit1 = HomeWorld().Biomes()
	biomestovisit2 = @/biomestovisit1.Where(s => !s.IsKSC())
	biomestovisit3 = @/biomestovisit2.Where(s => s != “Poles”)
	biomestovisit4 = @/biomestovisit3.Random(3) 
	biomestovisit = [@/biomestovisit2, “Poles”]
}
PARAMETER
{
	Name = Measure Temperature
	type = CollectScience
	experiment = temperatureScan
	recoveryMethod = RecoverOrTransmit
   		
	ITERATOR
	{
		type = Biome
		biome = @/biomestovisit
	}
}

It returns me a big number of exceptions.

[Exception]: DataStoreCastException: Cannot cast from System.Collections.Generic.List`1[ContractConfigurator.Biome] to ContractConfigurator.Biome.

[Warning]: ContractConfigurator.ConfigNodeUtil: Got an unexpected exception trying to load 'biomestovisit2' as a list:

[Exception]: NullReferenceException: Object reference not set to an instance of an object

And so on. I have tried to solve this problem in other ways (defining it through ScienceSubjects for example) But I always get something like :incorrect method for class Biome" or "exception when defining biome as a list"

What am I doing wrong? :(

You've got a list of list of biomes.  Try changing this line:

    biomestovisit = [@/biomestovisit2, “Poles”]

to:

    biomestovisit = @/biomestovisit4 + [“Poles”]

I forget if you can load biomes as a string that way - there may be a function like Biome(Kerbin, Poles) or something (don't have the doco easily accessible to me at the moment).
 

Link to comment
Share on other sites

41 minutes ago, nightingale said:

You've got a list of list of biomes.  Try changing this line:

    biomestovisit = [@/biomestovisit2, “Poles”]

to:

    biomestovisit = @/biomestovisit4 + [“Poles”]

I forget if you can load biomes as a string that way - there may be a function like Biome(Kerbin, Poles) or something (don't have the doco easily accessible to me at the moment).
 

Got it!! Thanks, that worked! but i had to use add function instead

Edited by Lan_Morehell
Link to comment
Share on other sites

One more question please:

 

How can I iterate the waypoints.

I have several groups of waypoints generated (waypointgenerated1, 2 etc) and want them to be visited in sequence via VisitWaypoint.

i.e:

1. Visit waypoint 1 from group 1

2. Visit waypoint 2 from group 1

...

N. Visit waypoint last from group 1

N+1 Visit waypoint 1 from group 2

 

and so on, in sequence. But when I try to use iterator, it always comes with unability to parse name.

ITERATOR
			{
				type = Waypoint
				waypoint = @/waypointgenerated2.Waypoints()
			}

This does not work

anything like this 

ITERATOR
			{
				type = Waypoint
				index = @/waypointgenerated2.index()
			}

says that it does not know what "index" is... the same with Name()

When I try to use ITERATOR type int - it passes checks

ITERATOR
			{
				type = int
				index = [1, 2, 3, 4, 5]
			}

But... actually it does not convert it into 5 actual waypoints :( Not even saying that it is not related anyhow to the waypoint group....

 

What would be the right way so sequence waypoints in groups? Of course I can just put them manually one after other, but making this with 60 waypoints is.... bviously not an elegant soulution :(

Edited by Lan_Morehell
Link to comment
Share on other sites

Has anyone made a science overhaul that removes science gain from experiments and attaches it to contracts instead? It seems likely, but I've only ever played with the vanilla science system, so I don't know what's out there. 

I plan on doing exactly this, but so far contract configurator is on the complicated side for an amateur like myself.

Link to comment
Share on other sites

Had issues after removing a mod (Quiztech Aero, FWIW) referenced in both completed and potential (but not active) part-test contracts.
Log throws:

Contract: Exception while OnLoad() or SetupID() on contract Test Part landed at Kerbin., exception System.NullReferenceException: Object reference not set to an instance of an object
  at Contracts.Parameters.PartTest.GetHashString () [0x00000] in <filename unknown>:0 
  at Contracts.ContractParameter.get_HashString () [0x00000] in <filename unknown>:0 
  at Contracts.Contract.SetupID () [0x00000] in <filename unknown>:0 
  at Contracts.Contract.Load (Contracts.Contract contract, .ConfigNode node) [0x00000] in <filename unknown>:0

Followed by:

NullReferenceException: Object reference not set to an instance of an object
  at Contracts.Parameters.PartTest.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at Contracts.ContractParameter.Save (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at Contracts.Contract.Save (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at Contracts.ContractSystem.OnSave (.ConfigNode gameNode) [0x00000] in <filename unknown>:0 
  at ScenarioModule.Save (.ConfigNode node) [0x00000] in <filename unknown>:0 
  at ProtoScenarioModule..ctor (.ScenarioModule module) [0x00000] in <filename unknown>:0 
  at ScenarioRunner.GetUpdatedProtoModules () [0x00000] in <filename unknown>:0 
  at Game.Updated () [0x00000] in <filename unknown>:0 
  at GamePersistence.SaveGame (System.String saveFileName, System.String saveFolder, SaveMode saveMode) [0x00000] in <filename unknown>:0 
  at TrackingStationBuilding.OnClicked () [0x00000] in <filename unknown>:0

And I can not enter / exit buildings.
Removing all mention of offending parts from save file has fixed it, just a FYI. Can probably repro w/save complete log etc. if needed.

Edited by steve_v
Link to comment
Share on other sites

11 hours ago, Nnimrod said:

Has anyone made a science overhaul that removes science gain from experiments and attaches it to contracts instead? It seems likely, but I've only ever played with the vanilla science system, so I don't know what's out there. 

I plan on doing exactly this, but so far contract configurator is on the complicated side for an amateur like myself.

I'm doing somewhat the opposite, and unlocking parts via contract instead of R&D. It's not quite ready for prime time yet but I suspect when Contract Configurator 1.19.1 comes out it will be.

Link to comment
Share on other sites

Alright, got a pre-release ready for contract pack developers to test out on KSP 1.2.  This is a pretty quick recompile and fix to get stuff going on 1.2.  Off the top of my head, the following still needs to be done to get a true 1.2-ready version:

  • Move settings into stock menu
  • Clean up overlap in tracking station with CommNet icon
  • Support for RemoteTech
  • Support for Kerbal Konstructs

Please report any issues outside the above items.

Download the pre-release here.

Contract Configurator 1.20.0

  • Support for KSP 1.2
  • Fixed NRE when vessel's Landed At string is null (thanks SamLex).
     
Link to comment
Share on other sites

On 9/13/2016 at 8:14 PM, nightingale said:

Alright, got a pre-release ready for contract pack developers to test out on KSP 1.2.  This is a pretty quick recompile and fix to get stuff going on 1.2.  Off the top of my head, the following still needs to be done to get a true 1.2-ready version:

  • Move settings into stock menu
  • Clean up overlap in tracking station with CommNet icon
  • Support for RemoteTech
  • Support for Kerbal Konstructs

Please report any issues outside the above items.

Download the pre-release here.

Contract Configurator 1.20.0

  • Support for KSP 1.2
  • Fixed NRE when vessel's Landed At string is null (thanks SamLex).
     

Hi there, I think I have a minor GUI bug, with the new ComSat element that is available in the tracking station, the 'toggles' for CC are overlapping.

Link to comment
Share on other sites

2 hours ago, gamerscircle said:

Hi there, I think I have a minor GUI bug, with the new ComSat element that is available in the tracking station, the 'toggles' for CC are overlapping.

Nightingale had mentioned that exact 'bug' in the 'To Be Done' part of his post that you quoted.

Link to comment
Share on other sites

1 hour ago, Poodmund said:

Nightingale had mentioned that exact 'bug' in the 'To Be Done' part of his post that you quoted.

You are right, my apologies on that.  It was my first real opportunity to actually sit down and try out KSP vs get schooled on the new stuff.  Here I thought I was doing a good thing.

Link to comment
Share on other sites

Not a bug: but damn it's confusing seeing those first contracts come under "Exploration" now. I'm ashamed to admit it took me longer than it should have done to find them. (To the point where I had typed up a whole bug report on here saying how stock contracts weren't showing up before I noticed)

cNfgCay.png

Link to comment
Share on other sites

8 hours ago, severedsolo said:

Not a bug: but damn it's confusing seeing those first contracts come under "Exploration" now. I'm ashamed to admit it took me longer than it should have done to find them. (To the point where I had typed up a whole bug report on here saying how stock contracts weren't showing up before I noticed)

cNfgCay.png

Hehe, blame @Arsonide for refactoring stuff. :wink:

Link to comment
Share on other sites

@pap1723

(Darn mobile forum...)

Anyway, @severedsolo & @5thHorseman, I'll probably make it auto size vertically rather clipping the text.  Mind raising a GitHub issue?  I'm currently in an airport and liable to not remember this actually needs fixing.

Edited by nightingale
Link to comment
Share on other sites

10 hours ago, nightingale said:

 I'm currently in an airport and liable to not remember this actually needs fixing.

Done. Good luck in the airport... I flew into Halifax airport once. I had this woman trying to sell me life insurance for about 15 minutes, until she realised I wasn't Canadian I had nothing better to do, so I let her waffle. You would have thought my British accent would have given it away *shrug*.

Edited by severedsolo
Link to comment
Share on other sites

Hi every one.

I've just installed the latest version of contract configurator with some of the contract pack.

In game, when, i go to the mission control bilding i've all the mission in the new configuration , but i dont have the green button for validate mission in the upper right section of the screen.

is is normal or some issu with others mods installed in the game.

Thanks for the answer.

Best Regards Ben Heinrich :-)

Edited by benoit406
Link to comment
Share on other sites

2 minutes ago, benoit406 said:

In game, when, i go to the mission control bilding i've all the mission in the new configuration , but i dont have the green button for validate mission in the upper right section of the screen.

Not very helpful I know but I can confirm that it's working OK for me. Maybe try a complete re-install of CC? A screenshot of where the error shows up might be a good idea too, in case it's user error.

@nightingale - let me know if you want Github issues for these - but I've noticed a few problems with the pre-release version:

1) Tourism Plus - The Tito Kerman contract isn't meeting it's requirements. I'm getting "must not have completed a standard tourism contract: unmet" - but I haven't done any stock tourism contracts (and you can tell this is the case because none of the others have unlocked)

2) Anomaly Surveyor - none of the waypoints have their icon. I'm just getting a square instead. I noticed the log was spitting out something about not liking one of the parameters (which I'm guessing is the issue). Logs available on request (not at my PC right now so can't provide now, sorry).

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